annotate src/system-init.pl @ 31:2ea43f89d84f

supress output.
author Robert McIntyre <rlm@mit.edu>
date Tue, 15 Jan 2013 12:24:31 +0000
parents 819e950ac8cc
children 4c49f8e6d79d
rev   line source
rlm@29 1 #!/usr/bin/perl
rlm@29 2 use Cwd;
rlm@17 3
rlm@17 4
rlm@17 5 sub create_install_dir{
rlm@17 6 @install_cmd =
rlm@17 7 ("install", "-d", "-m",
rlm@17 8 "775", "-o", "root", "-g",
rlm@17 9 "install", $_[0]);
rlm@17 10 print "@install_cmd\n";
rlm@17 11 system(@install_cmd) and die $!;}
rlm@17 12
rlm@17 13 @install_dirs = qw(
rlm@17 14 /usr/bin
rlm@17 15 /usr/sbin
rlm@17 16 /usr/include
rlm@17 17 /usr/lib
rlm@17 18 /usr/man/man1
rlm@17 19 /usr/man/man2
rlm@17 20 /usr/man/man3
rlm@17 21 /usr/man/man4
rlm@17 22 /usr/man/man5
rlm@17 23 /usr/man/man6
rlm@17 24 /usr/man/man7
rlm@17 25 /usr/man/man8
rlm@17 26 /usr/doc
rlm@17 27 /usr/info
rlm@17 28 /usr/share
rlm@17 29 /usr/share/dict
rlm@17 30 /usr/share/doc
rlm@17 31 /usr/share/info
rlm@17 32 /usr/share/locale
rlm@17 33 /usr/share/man/man1
rlm@17 34 /usr/share/man/man2
rlm@17 35 /usr/share/man/man3
rlm@17 36 /usr/share/man/man4
rlm@17 37 /usr/share/man/man5
rlm@17 38 /usr/share/man/man6
rlm@17 39 /usr/share/man/man7
rlm@17 40 /usr/share/man/man8
rlm@17 41 /usr/share/nls
rlm@17 42 /usr/share/misc
rlm@17 43 /usr/share/terminfo
rlm@17 44 /usr/share/zoneinfo
rlm@17 45 /usr/share/i18n
rlm@17 46 /usr/share/aclocal
rlm@17 47 /opt
rlm@17 48 /opt/doc
rlm@17 49 /opt/info
rlm@17 50 /opt/bin
rlm@17 51 /opt/include
rlm@17 52 /opt/lib
rlm@17 53 /opt/man/man1
rlm@17 54 /opt/man/man2
rlm@17 55 /opt/man/man3
rlm@17 56 /opt/man/man4
rlm@17 57 /opt/man/man5
rlm@17 58 /opt/man/man6
rlm@17 59 /opt/man/man7
rlm@17 60 /opt/man/man8
rlm@17 61 /var/lib
rlm@17 62 /var/opt
rlm@17 63 /etc
rlm@17 64 /etc/opt
rlm@31 65 );
rlm@17 66
rlm@19 67
rlm@19 68 sub execute{
rlm@19 69 print "\t$_[0]\n";
rlm@19 70 `$_[0]`;
rlm@19 71 if ($?){die $!;}
rlm@19 72 }
rlm@19 73
rlm@19 74 execute("groupadd --force install");
rlm@19 75
rlm@17 76 foreach $install_dir(@install_dirs){
rlm@17 77 create_install_dir($install_dir);}
rlm@17 78
rlm@19 79
rlm@31 80 execute("find /.hg -type d -print0 | xargs -0 chmod 2770");
rlm@31 81 execute("find /.hg -type f -print0 | xargs -0 chmod 660");
rlm@19 82
rlm@26 83 execute("install -d -o root -g root -m 755 /pkg/skel");
rlm@19 84
rlm@25 85 execute("chown -Rv root:root /.hg");
rlm@19 86
rlm@29 87 $pwd = cwd();
rlm@26 88 execute("ln -sf $pwd/profile /pkg/skel/.profile");
rlm@26 89 execute("ln -sf $pwd/hg-wrapper /pkg/skel/");
rlm@26 90 execute("ln -sf $pwd/save-acls /pkg/skel/");
rlm@26 91 execute("ln -sf `which hg` /pkg/skel/");
rlm@22 92
rlm@25 93 execute("install -o root -g root -m 660 $pwd/hgignore /.hgignore");
rlm@25 94 execute("install -o root -g root -m 660 $pwd/hgrc /.hg/");
rlm@19 95
rlm@19 96
rlm@19 97
rlm@31 98
rlm@31 99
rlm@31 100 ## other install dirs
rlm@31 101 # /usr/local/man/man1
rlm@31 102 # /usr/local/man/man2
rlm@31 103 # /usr/local/man/man3
rlm@31 104 # /usr/local/man/man4
rlm@31 105 # /usr/local/man/man5
rlm@31 106 # /usr/local/man/man6
rlm@31 107 # /usr/local/man/man7
rlm@31 108 # /usr/local/man/man8
rlm@31 109 # /usr/local/doc
rlm@31 110 # /usr/local/info
rlm@31 111 # /usr/local/bin
rlm@31 112 # /usr/local/etc
rlm@31 113 # /usr/local/include
rlm@31 114 # /usr/local/lib
rlm@31 115 # /usr/local/sbin
rlm@31 116 # /usr/local/share
rlm@31 117 # /usr/local/share/dict
rlm@31 118 # /usr/local/share/doc
rlm@31 119 # /usr/local/share/info
rlm@31 120 # /usr/local/share/locale
rlm@31 121 # /usr/local/share/man/man1
rlm@31 122 # /usr/local/share/man/man2
rlm@31 123 # /usr/local/share/man/man3
rlm@31 124 # /usr/local/share/man/man4
rlm@31 125 # /usr/local/share/man/man5
rlm@31 126 # /usr/local/share/man/man6
rlm@31 127 # /usr/local/share/man/man7
rlm@31 128 # /usr/local/share/man/man8
rlm@31 129 # /usr/local/share/nls
rlm@31 130 # /usr/local/share/misc
rlm@31 131 # /usr/local/share/terminfo
rlm@31 132 # /usr/local/share/zoneinfo
rlm@31 133 # /sbin
rlm@31 134 # /bin
rlm@31 135 # /lib