[Lunar-commits] r23660 - lunar/trunk/sbin

Auke Kok sofar at lunar-linux.org
Fri Mar 16 08:02:27 CET 2007


Author: sofar
Date: 2007-03-16 08:02:27 +0100 (Fri, 16 Mar 2007)
New Revision: 23660

Modified:
   lunar/trunk/sbin/lrm
Log:
Automatically remove alias mappings once a user manually uninstalls
(thus not upgrades) a module which is an alias


Modified: lunar/trunk/sbin/lrm
===================================================================
--- lunar/trunk/sbin/lrm	2007-03-16 06:31:23 UTC (rev 23659)
+++ lunar/trunk/sbin/lrm	2007-03-16 07:02:27 UTC (rev 23660)
@@ -195,6 +195,13 @@
   else
     verbose_msg "removing module from dependency listing and configs"
     remove_depends $MODULE
+    # remove alias if required
+    for ALIAS in `cut -d: -f1 $MOONBASE/aliases`; do
+      if [ "$(get_local_config `echo LUNAR_ALIAS_${ALIAS:1}`)" == "$MODULE" ]; then
+        verbose_msg "removing alias mapping from \"$ALIAS\" to \"$MODULE\""
+        unset_local_config `echo LUNAR_ALIAS_${ALIAS:1}`
+      fi
+    done
     # restart xinetd after xinetd.confs have been removed by lrm...
     if [ -n "$SERVICES" -a -n "$XINETD" ] ; then
       verbose_msg "restarting xinetd"



More information about the Lunar-commits mailing list