]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_accepted.py
move logic into a function
[dak.git] / dak / process_accepted.py
index 07d611d5f0bac72c2d88f48de6f7288bc94c599b..e53a969f48c1f35a88d292c3cb94d3ce86b3d855 100755 (executable)
@@ -183,13 +183,7 @@ def init():
         if len(changes_files) > 0:
             utils.warn("Directory provided so ignoring files given on command line")
 
-        dir = Cnf["Dinstall::Options::Directory"]
-        try:
-            # Much of the rest of p-a depends on being in the right place
-            os.chdir(dir)
-            changes_files = [x for x in os.listdir(dir) if x.endswith('.changes')]
-        except OSError, e:
-            utils.fubar("Failed to read list from directory %s (%s)" % (dir, e))
+        changes_files = utils.get_changes_files(Cnf["Dinstall::Options::Directory"])
 
     Upload = queue.Upload(Cnf)
     projectB = Upload.projectB