comparison src/pkg.pl @ 12:e056798af879

fixing problem with shell interpretation.
author Robert McIntyre <rlm@mit.edu>
date Wed, 09 Jan 2013 07:09:37 +0000
parents a0c0ccd22ca5
children ac1ca422bd54
comparison
equal deleted inserted replaced
11:389f8678f1d8 12:e056798af879
72 "-m", "755", $pkg_home); 72 "-m", "755", $pkg_home);
73 73
74 @pkg_add_install_cmd = 74 @pkg_add_install_cmd =
75 ("gpasswd", "--add", $pkg_name, "install"); 75 ("gpasswd", "--add", $pkg_name, "install");
76 76
77 sub execute{print "\t@_\n"; system(@_) and die $!;}
78
79
80 @pkg_link_bashrc_cmd = 77 @pkg_link_bashrc_cmd =
81 ("install", "-g", $pkg_name, "-o", $pkg_name, 78 ("install", "-g", $pkg_name, "-o", $pkg_name,
82 "/pkg/defaults/.profile", "$pkg_home/.profile"); 79 "/pkg/defaults/.profile", "$pkg_home/.profile");
83 80
84 @pkg_copy_hg_wrapper_cmd = 81 @pkg_copy_hg_wrapper_cmd =
85 (install, "-g", "users", "-o", "r", 82 (install, "-g", "hg-wheel", "-o", "hg-committer",
86 "-m", "4777", "/pkg/defaults/.hg-wrapper", $pkg_home); 83 "-m", "6111", "/pkg/defaults/.hg-wrapper", $pkg_home);
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 $!;}
97
87 98
88 #determine if the user already exists: 99 #determine if the user already exists:
89 `id $pkg_name 2>/dev/null`; 100 `id $pkg_name 2>/dev/null`;
90 if (!$?){ 101 if (!$?){
91 print "Change user.\n"; 102 print "Change user.\n";
105 116
106 print "Copy Default Files.\n"; 117 print "Copy Default Files.\n";
107 execute(@pkg_link_bashrc_cmd); 118 execute(@pkg_link_bashrc_cmd);
108 execute(@pkg_copy_hg_wrapper_cmd); 119 execute(@pkg_copy_hg_wrapper_cmd);
109 120
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
110 print "Change user.\n"; 131 print "Change user.\n";
111 execute(@pkg_switch_cmd); 132 execute(@pkg_switch_cmd);
112
113
114
115
116
117
118
119