]> git.ipfire.org Git - pakfire.git/commitdiff
Fix packaging of unresolvable symlinks.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2011 12:49:17 +0000 (14:49 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2011 12:49:17 +0000 (14:49 +0200)
python/pakfire/packages/packager.py

index 16ed55fe864b27608b65e5775143e7ddfd49148b..4e913cbd29de2d1068771878044f1f65250a2b60 100644 (file)
@@ -351,9 +351,6 @@ class BinaryPackager(Packager):
 
                # Remove all packaged files.
                for file in reversed(files):
-                       if not os.path.exists(file):
-                               continue
-
                        # It's okay if we cannot remove directories,
                        # when they are not empty.
                        if os.path.isdir(file):
@@ -362,7 +359,10 @@ class BinaryPackager(Packager):
                                except OSError:
                                        continue
                        else:
-                               os.unlink(file)
+                               try:
+                                       os.unlink(file)
+                               except OSError:
+                                       pass
 
                        while True:
                                file = os.path.dirname(file)