[jhbuild] Only _clean_la_files if directory exists (GNOME bug 654592)



commit 041be453c01bf00a6a025b01611e5920e35c8a4f
Author: Craig Keogh <cskeogh adam com au>
Date:   Thu Jul 14 21:27:54 2011 +0930

    Only _clean_la_files if directory exists (GNOME bug 654592)

 jhbuild/modtypes/__init__.py |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 98073f6..ecec9b2 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -165,19 +165,19 @@ class Package:
         assert os.path.isabs(installroot)
         assert os.path.isabs(self.config.prefix)
         prefixdir = os.path.join(installroot, self.config.prefix[1:])
-        assert os.path.isdir(prefixdir)
-        for name in os.listdir(prefixdir):
-            namepath = os.path.join(prefixdir, name)
-            if not (name.startswith('lib') and os.path.isdir(namepath)):
-                continue
-            for subname in os.listdir(namepath):
-                subpath = os.path.join(namepath, subname)
-                if subname.endswith('.la'):
-                    try:
-                        logging.info(_('Deleting toplevel .la file: %r') % (subpath, ))
-                        os.unlink(subpath)
-                    except OSError:
-                        pass
+        if os.path.isdir(prefixdir):
+            for name in os.listdir(prefixdir):
+                namepath = os.path.join(prefixdir, name)
+                if not (name.startswith('lib') and os.path.isdir(namepath)):
+                    continue
+                for subname in os.listdir(namepath):
+                    subpath = os.path.join(namepath, subname)
+                    if subname.endswith('.la'):
+                        try:
+                            logging.info(_('Deleting toplevel .la file: %r') % (subpath, ))
+                            os.unlink(subpath)
+                        except OSError:
+                            pass
 
     def _process_install_files(self, installroot, curdir, prefix):
         """Strip the prefix from all files in the install root, and move



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]