import stat
import sys
import time
-import tempfile
import traceback
import tarfile
import apt_inst
################################################################################
-def create_tmpdir():
- """
- Create a temporary directory that can be used for unpacking files into for
- checking
- """
- tmpdir = tempfile.mkdtemp()
- return tmpdir
-
-################################################################################
-
def copy_to_holding(filename):
global in_holding
cursor = DBConn().cursor()
# Check for packages that have moved from one component to another
# STU: this should probably be changed to not join on architecture, suite tables but instead to used their cached name->id mappings from DBConn
- cursor.execute("""PREPARE moved_pkg_q(text,text,text) AS
+ DBConn().prepare("moved_pkg_q", """
+ PREPARE moved_pkg_q(text,text,text) AS
SELECT c.name FROM binaries b, bin_associations ba, suite s, location l,
component c, architecture a, files f
WHERE b.package = $1 AND s.suite_name = $2
or pkg.orig_tar_gz == -1:
return
- tmpdir = create_tmpdir()
+ tmpdir = utils.temp_dirname()
# Move into the temporary directory
cwd = os.getcwd()
AND sa.suite = %(suite)d""",
{'source' : changes['source'],
'version' : changes['version'],
- 'suite' : pasuite})
+ 'suite' : pusuite})
if cursor.fetchone():
# source is already in proposed-updates so no need to hold
AND sa.suite = %d""",
{'source' : changes['source'],
'version' : changes['version'],
- 'suite' : pasuite})
+ 'suite' : pusuite})
if cursor.fetchone():
return 0