]> git.decadent.org.uk Git - dak.git/blobdiff - dak/import_archive.py
Move regexes into a module so we can keep track
[dak.git] / dak / import_archive.py
index 4432ff1ac602c6b8008a2efcff154cbd9e9a3d23..8728158e8fe9e30b7eba5470b51121ba310ec362 100755 (executable)
 
 ###############################################################################
 
-import commands, os, pg, re, sys, time
+import commands, os, pg, sys, time
 import apt_pkg
 from daklib import database
 from daklib import utils
 from daklib.dak_exceptions import *
-
-###############################################################################
-
-re_arch_from_filename = re.compile(r"binary-[^/]+")
+from daklib.regexes import re_arch_from_filename
 
 ###############################################################################
 
@@ -477,7 +474,7 @@ def process_packages (filename, suite, component, archive):
 ###############################################################################
 
 def do_sources(sources, suite, component, server):
-    temp_filename = utils.temp_filename()
+    (fd, temp_filename) = utils.temp_filename()
     (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (sources, temp_filename))
     if (result != 0):
         utils.fubar("Gunzip invocation failed!\n%s" % (output), result)