From 2b6d115da4ba39a0b30eb6e014684d82101f3265 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 17 Dec 1999 00:21:09 +0000 Subject: no_comment --- autoirpm.uninstall | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 autoirpm.uninstall (limited to 'autoirpm.uninstall') diff --git a/autoirpm.uninstall b/autoirpm.uninstall new file mode 100644 index 00000000..d0483a03 --- /dev/null +++ b/autoirpm.uninstall @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +$DIR = "/etc/urpmi"; +$BASE = "$DIR/autoirpm"; +$AUTO_INSTALL_BIN_LIST = "$BASE.binaries"; +$INSTALL_SCRIPT_REP = "$BASE.scripts"; + +open F, $AUTO_INSTALL_BIN_LIST or die; +map { chop; remove_links_and_scripts($_) } ; +close F; + +sub remove_links_and_scripts($) { + my ($rpm, @progs) = split; + + my $script = "$INSTALL_SCRIPT_REP/$rpm"; + + -e $script or return 0; # not installed for this package + foreach (<@progs>) { + readlink "/$_" ne $script and next; + unlink "/$_" or warn "removing $_ failed"; + } + unlink $script or warn "removing $script failed"; +} -- cgit v1.2.1