Mercurial > pkg
view src/system-init.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 |
line wrap: on
line source
1 #!/usr/bin/env perl3 use Cwd;5 sub create_install_dir{6 @install_cmd =7 ("install", "-d", "-m",8 "775", "-o", "root", "-g",9 "install", $_[0]);10 print "@install_cmd\n";11 system(@install_cmd) and die $!;}13 @install_dirs = qw(14 /usr/bin15 /usr/sbin16 /usr/include17 /usr/lib18 /usr/man/man119 /usr/man/man220 /usr/man/man321 /usr/man/man422 /usr/man/man523 /usr/man/man624 /usr/man/man725 /usr/man/man826 /usr/doc27 /usr/info28 /usr/local/man/man129 /usr/local/man/man230 /usr/local/man/man331 /usr/local/man/man432 /usr/local/man/man533 /usr/local/man/man634 /usr/local/man/man735 /usr/local/man/man836 /usr/local/doc37 /usr/local/info38 /usr/share39 /usr/share/dict40 /usr/share/doc41 /usr/share/info42 /usr/share/locale43 /usr/share/man/man144 /usr/share/man/man245 /usr/share/man/man346 /usr/share/man/man447 /usr/share/man/man548 /usr/share/man/man649 /usr/share/man/man750 /usr/share/man/man851 /usr/share/nls52 /usr/share/misc53 /usr/share/terminfo54 /usr/share/zoneinfo55 /usr/share/i18n56 /usr/share/aclocal57 /usr/local/bin58 /usr/local/etc59 /usr/local/include60 /usr/local/lib61 /usr/local/sbin62 /usr/local/share63 /usr/local/share/dict64 /usr/local/share/doc65 /usr/local/share/info66 /usr/local/share/locale67 /usr/local/share/man/man168 /usr/local/share/man/man269 /usr/local/share/man/man370 /usr/local/share/man/man471 /usr/local/share/man/man572 /usr/local/share/man/man673 /usr/local/share/man/man774 /usr/local/share/man/man875 /usr/local/share/nls76 /usr/local/share/misc77 /usr/local/share/terminfo78 /usr/local/share/zoneinfo79 /opt80 /opt/doc81 /opt/info82 /opt/bin83 /opt/include84 /opt/lib85 /opt/man/man186 /opt/man/man287 /opt/man/man388 /opt/man/man489 /opt/man/man590 /opt/man/man691 /opt/man/man792 /opt/man/man893 /var/lib94 /var/opt95 /etc96 /etc/opt97 /sbin98 /bin99 /lib);102 sub execute{103 print "\t$_[0]\n";104 `$_[0]`;105 if ($?){die $!;}106 }108 execute("groupadd --force install");110 foreach $install_dir(@install_dirs){111 create_install_dir($install_dir);}114 execute("find /.hg -type d -print0 | xargs -0 -L 1 -t chmod 2770");115 execute("find /.hg -type f -print0 | xargs -0 -L 1 -t chmod 660");117 execute("groupadd --force hg-committer");118 execute("groupadd --force hg-wheel");120 if (!`id hg-committer`){121 execute("useradd -c hg-committer -d /pkg/hg-committer -g hg-committer -s /bin/bash hg-committer");122 }124 execute("chown -Rv hg-committer:hg-wheel /.hg");126 $pwd = getcwd;127 execute("gpasswd --add hg-committer hg-wheel");128 execute("gpasswd --add hg-committer users");129 execute("ln -sf $pwd/profile /pkg/hg-committer/.profile");130 execute("ln -sf $pwd/hgrc /pkg/hg-committer/.hgrc");131 execute("ln -sf $pwd/hg-wrapper /pkg/hg-committer/");132 execute("ln -sf `which hg` /pkg/hg-committer/");133 execute("install -o hg-committer -g hg-wheel -m 660 $pwd/hgignore /.hgignore");