# HG changeset patch # User Robert McIntyre # Date 1357659689 0 # Node ID fe56b4698cf819328c3ec90c62110462cc4dae21 # Parent 9ff0fcf3492079aa48a2d6e81d560a7d6c322c48 add install-init, and refine pkg.pl. diff -r 9ff0fcf34920 -r fe56b4698cf8 src/create-install-dirs.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/create-install-dirs.pl Tue Jan 08 15:41:29 2013 +0000 @@ -0,0 +1,106 @@ +#!/usr/bin/env perl + +@create_install_cmd = + ("groupadd", "--force", "install"); +print "@create_install_cmd\n"; +system(@create_install_cmd) and die $!; + +sub create_install_dir{ + @install_cmd = + ("install", "-d", "-m", + "775", "-o", "root", "-g", + "install", $_[0]); + print "@install_cmd\n"; + system(@install_cmd) and die $!;} + +@install_dirs = qw( +/usr/bin +/usr/sbin +/usr/include +/usr/lib +/usr/man/man1 +/usr/man/man2 +/usr/man/man3 +/usr/man/man4 +/usr/man/man5 +/usr/man/man6 +/usr/man/man7 +/usr/man/man8 +/usr/doc +/usr/info +/usr/local/man/man1 +/usr/local/man/man2 +/usr/local/man/man3 +/usr/local/man/man4 +/usr/local/man/man5 +/usr/local/man/man6 +/usr/local/man/man7 +/usr/local/man/man8 +/usr/local/doc +/usr/local/info +/usr/share +/usr/share/dict +/usr/share/doc +/usr/share/info +/usr/share/locale +/usr/share/man/man1 +/usr/share/man/man2 +/usr/share/man/man3 +/usr/share/man/man4 +/usr/share/man/man5 +/usr/share/man/man6 +/usr/share/man/man7 +/usr/share/man/man8 +/usr/share/nls +/usr/share/misc +/usr/share/terminfo +/usr/share/zoneinfo +/usr/share/i18n +/usr/share/aclocal +/usr/local/bin +/usr/local/etc +/usr/local/include +/usr/local/lib +/usr/local/sbin +/usr/local/share +/usr/local/share/dict +/usr/local/share/doc +/usr/local/share/info +/usr/local/share/locale +/usr/local/share/man/man1 +/usr/local/share/man/man2 +/usr/local/share/man/man3 +/usr/local/share/man/man4 +/usr/local/share/man/man5 +/usr/local/share/man/man6 +/usr/local/share/man/man7 +/usr/local/share/man/man8 +/usr/local/share/nls +/usr/local/share/misc +/usr/local/share/terminfo +/usr/local/share/zoneinfo +/opt +/opt/doc +/opt/info +/opt/bin +/opt/include +/opt/lib +/opt/man/man1 +/opt/man/man2 +/opt/man/man3 +/opt/man/man4 +/opt/man/man5 +/opt/man/man6 +/opt/man/man7 +/opt/man/man8 +/var/lib +/var/opt +/etc +/etc/opt +/sbin +/bin +/lib); + +foreach $install_dir(@install_dirs){ + create_install_dir($install_dir);} + diff -r 9ff0fcf34920 -r fe56b4698cf8 src/pkg.pl --- a/src/pkg.pl Tue Jan 08 14:42:09 2013 +0000 +++ b/src/pkg.pl Tue Jan 08 15:41:29 2013 +0000 @@ -70,11 +70,13 @@ @pkg_create_home_cmd = ("install", "-d", "-g", $pkg_name, "-o", $pkg_name, "-m", "700", $pkg_home); -sub execute{print "@_\n"; system(@_) and die $!;} +sub execute{print "\t@_\n"; system(@_) and die $!;} #determine if the user already exists: `id $pkg_name 2>/dev/null`; -if (!$?){execute(@pkg_switch_cmd); exit 0;} +if (!$?){ + print "Change user.\n"; + execute(@pkg_switch_cmd); exit 0;} print "Creating package group.\n"; execute(@pkg_create_group_cmd);