import threading
import glob
import apt_pkg
-from daklib.dbconn import DBConn, get_dbchange, get_policy_queue, session_wrapper, ChangePendingFile
+from daklib.dbconn import DBConn, get_dbchange, get_policy_queue, session_wrapper, ChangePendingFile, get_location, check_poolfile
from daklib.config import Config
from daklib.queue import Upload
+from daklib.utils import poolify
# where in dak.conf all of our configuration will be stowed
options_prefix = "NewFiles"
f.close()
except IOError:
# Can't find the file, try to look it up in the pool
- poolname = utils.poolify(u.pkg.changes["source"], u.pkg.files[chg_fn]["component"])
+ poolname = poolify(u.pkg.changes["source"], u.pkg.files[chg_fn]["component"])
l = get_location(cnf["Dir::Pool"], u.pkg.files[chg_fn]["component"], session=session)
if not l:
log.critical("ERROR: Can't find location for %s (component %s)" % (chg_fn, u.pkg.files[chg_fn]["component"]))
found, poolfile = check_poolfile(os.path.join(poolname, chg_fn),
u.pkg.files[chg_fn]['size'],
u.pkg.files[chg_fn]["md5sum"],
- l,
+ l.location_id,
session=session)
if found is None:
log.critical("ERROR: Could not find %s in pool" % chg_fn)
sys.exit(1)
else:
- chg.changeslinks.append(poolfile)
+ chg.poolfiles.append(poolfile)
chg.files = files
session.commit()
-
+
except KeyboardInterrupt:
print("Caught C-c; terminating.")
utils.warn("Caught C-c; terminating.")