view src/system-init.pl @ 32:426344e3e639

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