+ # If this is a sourceful diff only upload that is moving non-legacy
+ # cross-component we need to copy the .orig.tar.gz into the new
+ # component too for the same reasons as above.
+ #
+ if changes["architecture"].has_key("source") and orig_tar_id != None and \
+ orig_tar_location != "legacy" and orig_tar_location != dsc_location_id:
+ q = projectB.query("SELECT l.path, f.filename, f.size, f.md5sum FROM files f, location l WHERE f.id = %s AND f.location = l.id" % (orig_tar_id));
+ ql = q.getresult()[0];
+ old_filename = ql[0] + ql[1];
+ file_size = ql[2];
+ file_md5sum = ql[3];
+ new_filename = utils.poolify (changes["source"], dsc_component) + os.path.basename(old_filename);
+ new_files_id = db_access.get_files_id(new_filename, file_size, file_md5sum, dsc_location_id);
+ if new_files_id == None:
+ utils.copy(old_filename, Cnf["Dir::PoolDir"] + new_filename);
+ new_files_id = db_access.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id);
+ projectB.query("UPDATE dsc_files SET file = %s WHERE source = %s AND file = %s" % (new_files_id, source_id, orig_tar_id));
+