[PATCH] Consider compilable changed also if some .py file in the same dir changed

Vratislav Podzimek vpodzime at redhat.com
Wed Jan 30 10:44:09 UTC 2013


If some .py file changed in the directory where the compilable lives
we need to build the compilable and include it to the updates image
because it may be relatively imported to the .py file and thus needs
to exist in the same directory in updates tree.

>From the same reason we need to include isys/__init__.py also in cases
where only the _isys.so file changed.

Also create the directory for isys if it is needed and is missing.

THIS IS SUPPOSED TO BE SQUASHED WITH THE PREVIOUS PATCH

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 scripts/makeupdates | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/makeupdates b/scripts/makeupdates
index 5591dc1..21b25ec 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -201,7 +201,7 @@ def _compilableChanged(tag, compilable):
             continue
 
         if file.startswith('Makefile') or file.endswith('.h') or \
-           file.endswith('.c'):
+           file.endswith('.c') or file.endswith('.py'):
             return True
 
     return False
@@ -229,9 +229,16 @@ def copyUpdatedIsys(updates, cwd):
     if not tmpupdates.endswith("/run/install/updates/pyanaconda"):
         tmpupdates = os.path.join(tmpupdates, "run/install/updates/pyanaconda/isys")
 
+    if not os.path.isdir(tmpupdates):
+        os.makedirs(tmpupdates)
+
     isysmodule = os.path.realpath(cwd + '/pyanaconda/isys/.libs/_isys.so')
+    isysinit = os.path.realpath(cwd + '/pyanaconda/isys/__init__.py')
+
     if os.path.isfile(isysmodule):
         shutil.copy2(isysmodule, tmpupdates)
+    if os.path.isfile(isysinit):
+        shutil.copy2(isysinit, tmpupdates)
 
 def copyUpdatedWidgets(updates, cwd):
     os.chdir(cwd)
-- 
1.7.11.7



More information about the anaconda-patches mailing list