diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-12-17 00:21:09 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-12-17 00:21:09 +0000 |
commit | 2b6d115da4ba39a0b30eb6e014684d82101f3265 (patch) | |
tree | 7ead586efca6413473c0b880d976f3dc5d7f2849 /autoirpm.update | |
parent | 8bc2804dffe993ded66f55ec4a6d13d9e8ed0bd7 (diff) | |
download | urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.gz urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.bz2 urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.xz urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.zip |
no_comment
Diffstat (limited to 'autoirpm.update')
-rw-r--r-- | autoirpm.update | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/autoirpm.update b/autoirpm.update new file mode 100644 index 00000000..3dfff948 --- /dev/null +++ b/autoirpm.update @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +$DIR = "/etc/urpmi"; +$BASE = "$DIR/autoirpm"; +$AUTO_INSTALL_BIN_LIST = "$BASE.binaries"; +$INSTALL_SCRIPT_REP = "$BASE.scripts"; + +system("autoirpm.update-all $BASE.allow $BASE.deny $DIR/hdlist.* > $AUTO_INSTALL_BIN_LIST"); +$? == 0 or die "autoirpm.upgrade-all failed\n"; + +open F, $AUTO_INSTALL_BIN_LIST or die; +map { chop; create_links_and_install_scripts($_) } <F>; +close F; + +sub create_links_and_install_scripts($) { + my ($rpm, @progs) = split ' ', $_[0]; + my $script = "$INSTALL_SCRIPT_REP/$rpm"; + + foreach (@progs) { lstat "/$_" and return } # verify that it's not installed + + foreach (@progs) { + make_dirname("/$_"); + symlink $script, "/$_"; # or die "$rpm: /$_"; + } + + open G, ">$script" or die; + print G "_irpm $rpm \$0 \$*\n"; + close G; + chmod 0755, "$script"; +} + +sub make_dirname($) { + my $file = $_[0]; + my $dir = `dirname $file`; + `mkdir -p $dir 2>/dev/null`; +} |