Commits

Michał Górny committed a0feac2

Check moduledir use using realpath().

The moduledir in paths is stored as the real path, so we need to
dereference the found moduledirs as well before matching it.

Fixes: https://github.com/mgorny/eclean-kernel/issues/4

  • Participants
  • Parent commits a01d34b

Comments (0)

Files changed (1)

ecleankernel/kernel.py

 	for cat, g in globs:
 		for m in glob('%s*' % g):
 			kv = m[len(g):]
-			if cat == 'modules' and m in paths:
-				continue
-			elif cat == 'initramfs' and kv.endswith('.img'):
+			if cat == 'initramfs' and kv.endswith('.img'):
 				kv = kv[:-4]
 
 			path = paths[m]
+			if cat == 'modules' and path in paths:
+				continue
+
 			newk = kernels[kv]
 			try:
 				setattr(newk, cat, path)