]> git.ipfire.org Git - pakfire.git/commitdiff
Skip files with wrong extension when walking through a directory with packages.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Feb 2011 01:47:20 +0000 (02:47 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Feb 2011 01:47:20 +0000 (02:47 +0100)
pakfire/index.py

index 4cc2d21b32829b29389c714e713ef5b7c44cce41..bb6b43c7a3b0806158d2908942f828b0fb01635e 100644 (file)
@@ -5,6 +5,8 @@ import os
 
 import packages
 
+from constants import *
+
 class Index(object):
        def __init__(self, pakfire, repo):
                self.pakfire = pakfire
@@ -64,6 +66,10 @@ class DirectoryIndex(Index):
 
                for dir, subdirs, files in os.walk(self.path):
                        for file in files:
+                               # Skip files that do not have the right extension
+                               if not file.endswith(".%s" % PACKAGE_EXTENSION):
+                                       continue
+
                                file = os.path.join(dir, file)
 
                                package = packages.BinaryPackage(self.pakfire, self.repo, file)