summaryrefslogtreecommitdiffstats
path: root/autoirpm.uninstall
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-17 00:21:09 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-17 00:21:09 +0000
commit2b6d115da4ba39a0b30eb6e014684d82101f3265 (patch)
tree7ead586efca6413473c0b880d976f3dc5d7f2849 /autoirpm.uninstall
parent8bc2804dffe993ded66f55ec4a6d13d9e8ed0bd7 (diff)
downloadurpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar
urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.gz
urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.bz2
urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.tar.xz
urpmi-2b6d115da4ba39a0b30eb6e014684d82101f3265.zip
no_comment
Diffstat (limited to 'autoirpm.uninstall')
-rw-r--r--autoirpm.uninstall23
1 files changed, 23 insertions, 0 deletions
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($_) } <F>;
+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";
+}