diff src/pkg.pl @ 7:ab4011ea1463

using C wrapper instead of perl wrapper.
author Robert McIntyre <rlm@mit.edu>
date Tue, 08 Jan 2013 18:10:15 +0000
parents fe56b4698cf8
children 7b9d471fc1d3
line wrap: on
line diff
     1.1 --- a/src/pkg.pl	Tue Jan 08 16:03:31 2013 +0000
     1.2 +++ b/src/pkg.pl	Tue Jan 08 18:10:15 2013 +0000
     1.3 @@ -68,10 +68,23 @@
     1.4    ("groupadd", "--force", $pkg_name);
     1.5  
     1.6  @pkg_create_home_cmd = 
     1.7 -  ("install", "-d", "-g", $pkg_name, "-o", $pkg_name, "-m", "700", $pkg_home);
     1.8 +  ("install", "-d", "-g", $pkg_name, "-o", $pkg_name, 
     1.9 +   "-m", "700", $pkg_home);
    1.10 +
    1.11 +@pkg_add_install_cmd = 
    1.12 +  ("gpasswd", "--add", $pkg_name, "install");
    1.13  
    1.14  sub execute{print "\t@_\n"; system(@_) and die $!;}
    1.15  
    1.16 +
    1.17 +@pkg_link_bashrc_cmd =
    1.18 +  ("install", "-g", $pkg_name, "-o", $pkg_name,
    1.19 +   "/pkg/defaults/.bashrc", "$pkg_home/.profile");
    1.20 +
    1.21 +@pkg_copy_hg_wrapper_cmd =
    1.22 +  (install, "-g", "root", "-o", "root",
    1.23 +   "-m", "4777", "/pkg/defaults/.hg-wrapper", $pkg_home);
    1.24 +
    1.25  #determine if the user already exists:
    1.26  `id $pkg_name 2>/dev/null`;
    1.27  if (!$?){
    1.28 @@ -87,6 +100,13 @@
    1.29  print "Create home directory for $pkg_name.\n";
    1.30  execute(@pkg_create_home_cmd);
    1.31  
    1.32 +print "Add $pkg_name to install group.\n";
    1.33 +execute(@pkg_add_install_cmd);
    1.34 +
    1.35 +print "Copy Default Files.\n";
    1.36 +execute(@pkg_link_bashrc_cmd);
    1.37 +execute(@pkg_copy_hg_wrapper_cmd);
    1.38 +
    1.39  print "Change user.\n";
    1.40  execute(@pkg_switch_cmd);
    1.41  
    1.42 @@ -96,3 +116,4 @@
    1.43  
    1.44  
    1.45  
    1.46 +