[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/module-init-tools/devel weak-modules,1.7,1.8



Author: jcm

Update of /cvs/dist/rpms/module-init-tools/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv28916

Modified Files:
	weak-modules 
Log Message:
cleanup module removal process.



Index: weak-modules
===================================================================
RCS file: /cvs/dist/rpms/module-init-tools/devel/weak-modules,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- weak-modules	1 Aug 2006 07:48:22 -0000	1.7
+++ weak-modules	1 Aug 2006 08:09:45 -0000	1.8
@@ -12,7 +12,7 @@
 # General Public License (GPL).
 
 __author__ = "Jon Masters <jcm redhat com>"
-__version__ = "2.1"
+__version__ = "2.2"
 __date__ = "2006/08/01 06:30:00"
 __copyright__ = "Copyright (C) 2006 Red Hat, Inc"
 __license__ = "GPL"
@@ -282,7 +282,7 @@
 
 		m = p.match(module)
 		if not m:
-			print "Non-standard module locations"
+			print "Non-standard weak module location"
 			sys.exit(1)
 		weak_link=m.group(2)+"/"+m.group(3)
 
@@ -299,9 +299,7 @@
 						print "remove: " \
 							+ weak_path
 					if dry_run == "no":
-						os.system("rm -f " +weak_path)
-
-						os.system("rmdir " +weak_dir)
+						os.system("rm -rf "+weak_dir)
 						run_depmod(kernel)
 						run_mkinitrd(kernel)	
 
@@ -380,32 +378,16 @@
 def remove_kernel(kernel):
 	"""Remove the given kernel from the system."""
 	
-	weakup_dir = "/lib/modules/" + kernel + "/weak-updates"
+	weakup_dir = "/lib/modules/"+kernel+"/weak-updates"
 	if not os.path.isdir(weakup_dir):
 		print "No weak updates directory found."
 		sys.exit(0)
-	weak_updates = os.popen("find " + weakup_dir + " -iname \"*.ko\"")
 
-	while true:
-		in_line = (weak_updates.readline())[:-1]
-		if in_line == "":
-			break
-		module=in_line
-		p = re.compile('^.*/lib/modules/(.*)/weak-updates/(.*)/(.*)$')
-		m = p.match(module)
-		if not m:
-			print "Non standard module location!"
-			sys.exit(1)
-		weak_dir = weakup_dir+"/"+m.group(2)
-
-		if verbose == "yes":
-			print "remove: " + module
+	if verbose == "yes":
+		print "remove: "+weakup_dir
 
-		if dry_run == "no":
-			os.system("rm -f " + module)
-			os.system("rmdir " + weak_dir)
-			#kernel removed so no need to rerun mkinitrd or depmod
-	
+	if dry_run == "no":
+		os.system("rm -rf "+weakup_dir)
 
 if __name__ == "__main__":
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]