]> git.ipfire.org Git - pakfire.git/commitdiff
Fix truncated paths in package database.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Feb 2011 16:13:04 +0000 (17:13 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Feb 2011 16:13:04 +0000 (17:13 +0100)
pakfire/database.py

index aacd1e7c7b429ae11f2c5f59f814fce8230ad540..3c054d998210588ea51cba2d27a0b222fe47d2b2 100644 (file)
@@ -133,7 +133,11 @@ class RemotePackageDatabase(PackageDatabase):
 
                filename = ""
                if pkg.repo.local:
-                       filename = pkg.filename[len(pkg.repo.path) + 1:]
+                       # Get the path relatively to the repository.
+                       filename = pkg.filename[len(pkg.repo.path):]
+                       # Strip leading / if any.
+                       if filename.startswith("/"):
+                               filename = filename[1:]
 
                c = self.cursor()
                c.execute("""