]> git.ipfire.org Git - pakfire.git/commitdiff
Fix reading filelists from new package format.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Aug 2011 17:11:56 +0000 (19:11 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Aug 2011 17:11:56 +0000 (19:11 +0200)
pakfire/packages/file.py
pakfire/packages/packager.py
po/pakfire.pot

index 8cdc8fb4b257b260123b0b723efc13fe91ac68d4..3a3deaff4b0c1ef342929e76b9b0bb8428f27369 100644 (file)
@@ -332,13 +332,23 @@ class FilePackage(Package):
 
                return inst_size
 
-       def __filelist_from_metadata(self):
+       @property
+       def filelist(self):
+               """
+                       Return a list of the files that are contained in the package
+                       payload.
+               """
                a = self.open_archive()
                f = a.extractfile("filelist")
 
                ret = []
                for line in f.readlines():
                        line = line.strip()
+
+                       if self.format >= 1:
+                               line = line.split()
+                               line = line[0]
+
                        if not line.startswith("/"):
                                line = "/%s" % line
 
@@ -349,42 +359,6 @@ class FilePackage(Package):
 
                return ret
 
-       def __filelist_from_payload(self):
-               # XXX expect uncompressed payload for now
-               # this is very simple and very slow
-
-               a = self.open_archive()
-               f = a.extractfile("data.img")
-               t = tarfile.open(fileobj=f)
-
-               ret = ["/%s" % n for n in t.getnames()]
-
-               t.close()
-               f.close()
-               a.close()
-
-               return ret
-
-       @property
-       def filelist(self):
-               """
-                       Return a list of the files that are contained in the package
-                       payload.
-
-                       At first, we try to get them from the metadata (which is the
-                       'filelist' file).
-                       If the file is not existant, we will open the payload and
-                       read it instead. The latter is a very slow procedure and
-                       should not be used anyway.
-               """
-               if not hasattr(self, "__filelist"):
-                       try:
-                               self.__filelist = self.__filelist_from_metadata()
-                       except KeyError:
-                               self.__filelist = self.__filelist_from_payload()
-
-               return self.__filelist
-
        @property
        def configfiles(self):
                a = self.open_archive()
index b97bac678c040c7fbcb7887350b52f2ba3aeab5f..dd45c8ff4b726195ebc1326a0e02da6c50d124d6 100644 (file)
@@ -164,7 +164,7 @@ class Packager(object):
                        # For other files, just finish the line.
                        else:
                                f.write(" -\n")
-                               
+
                logging.info("")
 
                datafile.close()
index ada58f328d37f528fc3b49501a496ef4e83ba17c..ac979b9d53dac5a7e7716aa54a5eda7924f7bf75 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-08-30 16:41+0200\n"
+"POT-Creation-Date: 2011-08-30 19:09+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -334,7 +334,7 @@ msgstr ""
 msgid "Do not verify build dependencies."
 msgstr ""
 
-#: ../pakfire/compress.py:133 ../pakfire/packages/packager.py:489
+#: ../pakfire/compress.py:133 ../pakfire/packages/packager.py:491
 #, python-format
 msgid "Compressing %s"
 msgstr ""
@@ -465,11 +465,11 @@ msgid "Package version is undefined."
 msgstr ""
 
 #. Load progressbar.
-#: ../pakfire/packages/packager.py:315
+#: ../pakfire/packages/packager.py:317
 msgid "Packaging"
 msgstr ""
 
-#: ../pakfire/packages/packager.py:606
+#: ../pakfire/packages/packager.py:608
 #, python-format
 msgid "Building source package %s:"
 msgstr ""