aur/python2-rtslib: added patch file

This commit is contained in:
Kevin Mihelich 2012-04-15 13:09:45 -04:00
parent 799962d8b9
commit 341d81566d

View file

@ -0,0 +1,31 @@
commit ee65af95e71018c1727825752b31ec55f608e323
Author: Jerome Martin <jxm@risingtidesystems.com>
Date: Tue Nov 1 11:39:16 2011 +0100
Added gzipped kernel fabric modules support.
* Now looks for any module name no matter what the file extension is, i.e.
*.ko.gz not just *.ko on the filesystem.
* Reported by Arch Linux user "Johannes Dewender" <arch@jonnyjd.net>
diff --git a/rtslib/utils.py b/rtslib/utils.py
index 17156fb..5c778f5 100644
--- a/rtslib/utils.py
+++ b/rtslib/utils.py
@@ -604,8 +604,14 @@ def list_available_kernel_modules():
'''
kver = os.uname()[2]
depfile = "/lib/modules/%s/modules.dep" % kver
- return [module.split(".")[0] for module in
- re.findall(r"[a-zA-Z0-9_-]+\.ko:", fread(depfile))]
+ handle = open(depfile)
+ try:
+ lines = handle.readlines()
+ finally:
+ handle.close()
+
+ return [os.path.basename(line.partition(":")[0]).partition(".")[0]
+ for line in lines]
def list_loaded_kernel_modules():
'''