[PATCH] Replace removed python modules with stubs in makeupdates
Vratislav Podzimek
vpodzime at redhat.com
Fri Sep 20 13:28:58 UTC 2013
If some python module is removed in a patch, running installation with an
updates.img may not reveal the issues with overlooked imports of the remove
module. By using a stub raising an error when the removed module is imported
it's easy to detect such issues.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
scripts/makeupdates | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/makeupdates b/scripts/makeupdates
index b49cac6..8b0634b 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -227,6 +227,12 @@ def copyUpdatedFiles(tag, updates, cwd):
file = fields[1]
if status == "D":
+ if file.startswith('pyanaconda/'):
+ # deleted python module, write out a stub raising ImportError
+ file_path = os.path.join(tmpupdates, file)
+ with open(file_path, "w") as fobj:
+ fobj.write('raise ImportError("This module no longer exists!")')
+
continue
if file.endswith('.spec.in') or (file.find('Makefile') != -1) or \
--
1.7.11.7
More information about the anaconda-patches
mailing list