[gnome-ostree] build: Fix multiple regressions in ostree-build-compile-one



commit 7c5002a99113073e4a0abbe96de60ac5f7f14fbd
Author: Colin Walters <walters verbum org>
Date:   Wed Jan 23 17:14:52 2013 -0500

    build: Fix multiple regressions in ostree-build-compile-one
    
    * A previous patch left a stale "libdirname" reference.
    * os.path.islink() won't work on broken symlinks, we need to os.lstat()
      This puts .so links back in -devel.

 src/ostbuild/ostree-build-compile-one |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/src/ostbuild/ostree-build-compile-one b/src/ostbuild/ostree-build-compile-one
index 816921b..7651171 100755
--- a/src/ostbuild/ostree-build-compile-one
+++ b/src/ostbuild/ostree-build-compile-one
@@ -238,21 +238,27 @@ def main(args):
     if os.path.isdir(varpath):
         shutil.rmtree(varpath)
 
-    # Move symbolic links for shared libraries as well
-    # as static libraries.  And delete all .la files.
+    # Delete all .la files.  See:
+    # https://bugzilla.gnome.org/show_bug.cgi?id=654013
     libdir = os.path.join(tempdir, 'usr/lib')
     for dirpath, subdirs, files in os.walk(libdir):
         for filename in files:
-            subpath = os.path.join(dirpath, filename)
+            path = os.path.join(dirpath, filename)
             if filename.endswith('.la'):
-                os.unlink(subpath)
-                continue
+                os.unlink(path)
+
+    # Move symbolic links for shared libraries as well
+    # as static libraries into /devel.
+    if os.path.exists(libdir):
+        for filename in os.listdir(libdir):
+            path = os.path.join(libdir, filename)
+            stbuf = os.lstat(path)
             if not ((filename.endswith('.so')
-                     and os.path.islink(filename))
+                     and stat.S_ISLNK(stbuf.st_mode))
                     or filename.endswith('.a')):
                     continue
-            dest = os.path.join(devel_path, libdirname, filename)
-            _install_and_unlink(subpath, dest)
+            dest = os.path.join(devel_path, 'usr/lib', filename)
+            _install_and_unlink(path, dest)
 
     for dirname in _DEVEL_DIRS:
         dirpath = os.path.join(tempdir, dirname)



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