- suite_id = db_access.get_suite_id(suite);
- projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id));
-
- # If the .orig.tar.gz is in a legacy directory we need to poolify
- # it, so that apt-get source (and anything else that goes by the
- # "Directory:" field in the Sources.gz file) works.
- orig_tar_id = Katie.pkg.orig_tar_id;
- orig_tar_location = Katie.pkg.orig_tar_location;
- legacy_source_untouchable = Katie.pkg.legacy_source_untouchable;
- if orig_tar_id and orig_tar_location == "legacy":
- q = projectB.query("SELECT DISTINCT ON (f.id) l.path, f.filename, f.id as files_id, df.source, df.id as dsc_files_id, f.size, f.md5sum FROM files f, dsc_files df, location l WHERE df.source IN (SELECT source FROM dsc_files WHERE file = %s) AND f.id = df.file AND l.id = f.location AND (l.type = 'legacy' OR l.type = 'legacy-mixed')" % (orig_tar_id));
- qd = q.dictresult();
- for qid in qd:
- # Is this an old upload superseded by a newer -sa upload? (See check_dsc() for details)
- if legacy_source_untouchable.has_key(qid["files_id"]):
- continue;
- # First move the files to the new location
- legacy_filename = qid["path"] + qid["filename"];
- pool_location = utils.poolify (changes["source"], files[file]["component"]);
- pool_filename = pool_location + os.path.basename(qid["filename"]);
- destination = Cnf["Dir::Pool"] + pool_location
- utils.move(legacy_filename, destination);
- # Then Update the DB's files table
- q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, dsc_location_id, qid["files_id"]));
-
- # If this is a sourceful diff only upload that is moving non-legacy
+ suite_id = database.get_suite_id(suite)
+ projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id))
+
+ if not database.copy_temporary_contents(package, version, architecture, newfile, reject):
+ print "REJECT\n" + reject_message,
+ projectB.query("ROLLBACK")
+ raise MissingContents, "No contents stored for package %s, and couldn't determine contents of %s" % (package, newfile )
+
+
+ orig_tar_id = Upload.pkg.orig_tar_id
+ orig_tar_location = Upload.pkg.orig_tar_location
+
+ # If this is a sourceful diff only upload that is moving