[zaptel-commits] mattf: branch 1.2 r3375 - in /branches/1.2: Makefile uninstall-modules-sh

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Sat Dec 8 16:46:12 CST 2007


Author: mattf
Date: Sat Dec  8 16:46:11 2007
New Revision: 3375

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3375
Log:
Add support to remove old module locations for modules that previously weren't in subdirectories

Added:
    branches/1.2/uninstall-modules-sh   (with props)
Modified:
    branches/1.2/Makefile

Modified: branches/1.2/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.2/Makefile?view=diff&rev=3375&r1=3374&r2=3375
==============================================================================
--- branches/1.2/Makefile (original)
+++ branches/1.2/Makefile Sat Dec  8 16:46:11 2007
@@ -450,6 +450,7 @@
 # Specific to a kernel version:
 install-modules: modules
 ifeq ($(BUILDVER),linux26)
+	@./uninstall-modules-sh $(DESTDIR)/lib/modules/$(KVERS) $(MODULES)
 	for x in $(MODULESKO); do \
 		rm -f $(DESTDIR)/lib/modules/$(KVERS)/extra/$$x ; \
 	done

Added: branches/1.2/uninstall-modules-sh
URL: http://svn.digium.com/view/zaptel/branches/1.2/uninstall-modules-sh?view=auto&rev=3375
==============================================================================
--- branches/1.2/uninstall-modules-sh (added)
+++ branches/1.2/uninstall-modules-sh Sat Dec  8 16:46:11 2007
@@ -1,0 +1,36 @@
+#!/bin/sh
+# uninstall-modules-sh
+#
+# Remove all the modules passed in on the command line from the modules
+# directory.  This script is called by the makefile.
+#
+# USAGE: uninstall-modules-sh <modules dir> modules to delete ...
+
+KERNEL_MODULES_DIR=$1
+shift
+MODULES=$@
+
+function usage {
+	echo "$0: Used to delete kernel modules from the modules directory."
+}
+
+if [ -z "$KERNEL_MODULES_DIR" ]; then
+	echo "Missing kernel module directory."
+	usage
+	exit 1;
+fi
+
+if [ -z "$MODULES" ]; then
+	echo "Missing one or more modules to delete."
+	usage
+	exit 1;
+fi
+for mod in $MODULES; do 
+	for file in `cat $KERNEL_MODULES_DIR/modules.dep | cut -d : -f 1 | grep $mod`; do
+		if [ -e "$file" ]; then
+			echo "Deleting $file."
+			rm -f $file
+		fi
+	done
+done
+exit 0

Propchange: branches/1.2/uninstall-modules-sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/1.2/uninstall-modules-sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/1.2/uninstall-modules-sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/1.2/uninstall-modules-sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the zaptel-commits mailing list