comparison src/pkg.pl @ 14:ac1ca422bd54

saving progress.
author Robert McIntyre <rlm@mit.edu>
date Wed, 09 Jan 2013 10:59:43 +0000
parents e056798af879
children cd47c42f1d0a
comparison
equal deleted inserted replaced
13:dcdeabe9e903 14:ac1ca422bd54
80 80
81 @pkg_copy_hg_wrapper_cmd = 81 @pkg_copy_hg_wrapper_cmd =
82 (install, "-g", "hg-wheel", "-o", "hg-committer", 82 (install, "-g", "hg-wheel", "-o", "hg-committer",
83 "-m", "6111", "/pkg/defaults/.hg-wrapper", $pkg_home); 83 "-m", "6111", "/pkg/defaults/.hg-wrapper", $pkg_home);
84 84
85 $pkg_hgrc = "[ui]\n\
86 username = $pkg_name\n\
87 [extensions]\n\
88 hgext.purge =\n";
89
90 $pkg_hgrc_filename = "$pkg_home/.hgrc";
91
92 @pkg_set_hgrc_user_cmd =
93 ("chown", "$pkg_name:$pkg_name", $pkg_hgrc_filename);
94
95
96 sub execute{print "\t@_\n"; system(@_) and die $!;} 85 sub execute{print "\t@_\n"; system(@_) and die $!;}
97
98 86
99 #determine if the user already exists: 87 #determine if the user already exists:
100 `id $pkg_name 2>/dev/null`; 88 `id $pkg_name 2>/dev/null`;
101 if (!$?){ 89 if (!$?){
102 print "Change user.\n"; 90 print "Change user.\n";
116 104
117 print "Copy Default Files.\n"; 105 print "Copy Default Files.\n";
118 execute(@pkg_link_bashrc_cmd); 106 execute(@pkg_link_bashrc_cmd);
119 execute(@pkg_copy_hg_wrapper_cmd); 107 execute(@pkg_copy_hg_wrapper_cmd);
120 108
121 # print "Create ~/.hgrc\n";
122 # open(HGRC, ">$pkg_hgrc_filename") or die $!;
123 # select HGRC;
124 # print $pkg_hgrc;
125 # close(HGRC);
126
127 # select(STDOUT);
128 # print "Set permissions on ~/.hgrc.\n";
129 # execute(@pkg_set_hgrc_user_cmd);
130
131 print "Change user.\n"; 109 print "Change user.\n";
132 execute(@pkg_switch_cmd); 110 execute(@pkg_switch_cmd);