comparison src/pkg.pl @ 21:d46aeb3166d0

going to work on file permissions/ownership since mercurial doesn't track them.
author Robert McIntyre <rlm@mit.edu>
date Thu, 10 Jan 2013 07:02:49 +0000
parents c75924bd38e3
children 43cfd1a2c523
comparison
equal deleted inserted replaced
20:c75924bd38e3 21:d46aeb3166d0
71 "-m", "755", $pkg_home); 71 "-m", "755", $pkg_home);
72 72
73 @pkg_add_install_cmd = 73 @pkg_add_install_cmd =
74 ("gpasswd", "--add", $pkg_name, "install"); 74 ("gpasswd", "--add", $pkg_name, "install");
75 75
76 sub copy_default_file {
77 execute(("install", "-g", $pkg_name, "-o", $pkg_name,
78 "/pkg/hg-committer/$_[0]", "$pkg_home"));
79 }
80
81
76 @pkg_link_bashrc_cmd = 82 @pkg_link_bashrc_cmd =
77 ("install", "-g", $pkg_name, "-o", $pkg_name, 83 ("install", "-g", $pkg_name, "-o", $pkg_name,
78 "/pkg/hg-committer/.profile", "$pkg_home/.profile"); 84 "/pkg/hg-committer/.profile", "$pkg_home/.profile");
79 85
80 @pkg_copy_hg_wrapper_cmd = 86 @pkg_copy_hg_wrapper_cmd =
81 (install, "-g", "hg-wheel", "-o", "hg-committer", 87 ("install", "-g", "hg-wheel", "-o", "hg-committer",
82 "-m", "6111", "/pkg/hg-committer/hg-wrapper", "$pkg_home/.hg-wrapper"); 88 "-m", "6111", "/pkg/hg-committer/hg-wrapper", "$pkg_home/.hg-wrapper");
83 89
84 sub execute{print "\t@_\n"; system(@_) and die $!;} 90 sub execute{print "\t@_\n"; system(@_) and die $!;}
85 91
86 #determine if the user already exists: 92 #determine if the user already exists:
100 106
101 print "Add $pkg_name to install group.\n"; 107 print "Add $pkg_name to install group.\n";
102 execute(@pkg_add_install_cmd); 108 execute(@pkg_add_install_cmd);
103 109
104 print "Copy Default Files.\n"; 110 print "Copy Default Files.\n";
105 execute(@pkg_link_bashrc_cmd); 111
106 execute(@pkg_copy_hg_wrapper_cmd); 112 execute(@pkg_copy_hg_wrapper_cmd);
113 copy_default_file(".hgrc");
114 copy_default_file(".profile");
115
116 #execute(@pkg_link_bashrc_cmd);
117 #execute(@pkg_copy_hgrc_cmd);
107 118
108 print "Change user.\n"; 119 print "Change user.\n";
109 execute(@pkg_switch_cmd); 120 execute(@pkg_switch_cmd);