Hi,

I upgraded to catalyst-3.0.1, and saw that files were being left
behind by it. On closer inspection, all the wildcards specified under
livecd/rm were being ignored. The attached patch solves the problem
for me.

Best regards,
Albert
From 801476222e5b82c720d2fade717ed4b6b915dd5d Mon Sep 17 00:00:00 2001
From: Albert Diserholt <albert@diserholt.com>
Date: Thu, 1 Mar 2018 17:12:27 +0900
Subject: [PATCH] Fixed glob in <target>/rm*
To: gentoo-catalyst@lists.gentoo.org

In 2.X, remove() used os.system(), but a regression seems
to have been introduced in 3.0.
---
 catalyst/base/stagebase.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index e98a289f..a37c05a7 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1,5 +1,6 @@
 
 import os
+import glob
 import imp
 import shutil
 import sys
@@ -1274,10 +1275,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		else:
 			if self.settings["spec_prefix"] + "/rm" in self.settings:
 				for x in self.settings[self.settings["spec_prefix"] + "/rm"]:
-					# We're going to shell out for all these cleaning
-					# operations, so we get easy glob handling.
-					log.notice('livecd: removing %s', x)
-					clear_path(self.settings["chroot_path"] + x)
+					for y in glob.iglob(self.settings["chroot_path"] + x):
+						log.notice('livecd: removing %s', y)
+						clear_path(y)
 				try:
 					if os.path.exists(self.settings["controller_file"]):
 						cmd([self.settings['controller_file'], 'clean'],
-- 
2.16.1

Reply via email to