view src/system-init.pl @ 29:819e950ac8cc

minor changes.
author Robert McIntyre <rlm@mit.edu>
date Thu, 10 Jan 2013 16:59:50 +0000
parents 5caff062fd36
children 2ea43f89d84f
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/local/man/man1
29 /usr/local/man/man2
30 /usr/local/man/man3
31 /usr/local/man/man4
32 /usr/local/man/man5
33 /usr/local/man/man6
34 /usr/local/man/man7
35 /usr/local/man/man8
36 /usr/local/doc
37 /usr/local/info
38 /usr/share
39 /usr/share/dict
40 /usr/share/doc
41 /usr/share/info
42 /usr/share/locale
43 /usr/share/man/man1
44 /usr/share/man/man2
45 /usr/share/man/man3
46 /usr/share/man/man4
47 /usr/share/man/man5
48 /usr/share/man/man6
49 /usr/share/man/man7
50 /usr/share/man/man8
51 /usr/share/nls
52 /usr/share/misc
53 /usr/share/terminfo
54 /usr/share/zoneinfo
55 /usr/share/i18n
56 /usr/share/aclocal
57 /usr/local/bin
58 /usr/local/etc
59 /usr/local/include
60 /usr/local/lib
61 /usr/local/sbin
62 /usr/local/share
63 /usr/local/share/dict
64 /usr/local/share/doc
65 /usr/local/share/info
66 /usr/local/share/locale
67 /usr/local/share/man/man1
68 /usr/local/share/man/man2
69 /usr/local/share/man/man3
70 /usr/local/share/man/man4
71 /usr/local/share/man/man5
72 /usr/local/share/man/man6
73 /usr/local/share/man/man7
74 /usr/local/share/man/man8
75 /usr/local/share/nls
76 /usr/local/share/misc
77 /usr/local/share/terminfo
78 /usr/local/share/zoneinfo
79 /opt
80 /opt/doc
81 /opt/info
82 /opt/bin
83 /opt/include
84 /opt/lib
85 /opt/man/man1
86 /opt/man/man2
87 /opt/man/man3
88 /opt/man/man4
89 /opt/man/man5
90 /opt/man/man6
91 /opt/man/man7
92 /opt/man/man8
93 /var/lib
94 /var/opt
95 /etc
96 /etc/opt
97 /sbin
98 /bin
99 /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("install -d -o root -g root -m 755 /pkg/skel");
119 execute("chown -Rv root:root /.hg");
121 $pwd = cwd();
122 execute("ln -sf $pwd/profile /pkg/skel/.profile");
123 execute("ln -sf $pwd/hg-wrapper /pkg/skel/");
124 execute("ln -sf $pwd/save-acls /pkg/skel/");
125 execute("ln -sf `which hg` /pkg/skel/");
127 execute("install -o root -g root -m 660 $pwd/hgignore /.hgignore");
128 execute("install -o root -g root -m 660 $pwd/hgrc /.hg/");