- file_list = "%s %s" % (file_list, poolname);
- file_list = "%s %s" % (file_list, string.join(map(os.path.abspath, arguments)));
- return file_list;
-
-################################################################################
-
-def join_with_commas_and(list):
- if len(list) == 0: return "nothing";
- if len(list) == 1: return list[0];
- return string.join(list[:-1], ", ") + " and " + list[-1];
+ file_list.append(poolname);
+ orig_component = files[file].get("original component", files[file]["component"]);
+ components[orig_component] = "";
+ file_list.append(changes_file);
+ # Determine the upload uri for this .changes file
+ for component in components.keys():
+ upload_uri = component_mapping.get(component);
+ if upload_uri:
+ upload_uris[upload_uri] = "";
+ num_upload_uris = len(upload_uris.keys());
+ if num_upload_uris == 0:
+ utils.fubar("%s: No valid upload URI found from components (%s)."
+ % (changes_file, ", ".join(components.keys())));
+ elif num_upload_uris > 1:
+ utils.fubar("%s: more than one upload URI (%s) from components (%s)."
+ % (changes_file, ", ".join(upload_uris.keys()),
+ ", ".join(components.keys())));
+ upload_uri = upload_uris.keys()[0];
+ # Update the file list for the upload uri
+ if not uploads.has_key(upload_uri):
+ uploads[upload_uri] = [];
+ uploads[upload_uri].extend(file_list);
+ # Remember the suites and source name/version
+ for suite in changes["distribution"].keys():
+ suites[suite] = "";
+ # Remember the source name and version
+ if changes["architecture"].has_key("source") and \
+ changes["distribution"].has_key("testing"):
+ if not package_list.has_key(dsc["source"]):
+ package_list[dsc["source"]] = {};
+ package_list[dsc["source"]][dsc["version"]] = "";
+
+ if len(suites.keys()) == 1 and suites.has_key("oldstable"):
+ print "Advisory only for 'oldstable'; not uploading elsewhere.";
+ return;
+
+ if not Options["No-Action"]:
+ answer = yes_no("Upload to files to main archive (Y/n)?");
+ if answer != "y":
+ return;
+
+ for uri in uploads.keys():
+ (host, path) = uri.split(":");
+ file_list = " ".join(uploads[uri]);
+ print "Uploading files to %s..." % (host);
+ spawn("lftp -c 'open %s; cd %s; put %s'" % (host, path, file_list));
+
+ if not Options["No-Action"]:
+ filename = "%s/testing-processed" % (Cnf["Dir::Log"]);
+ file = utils.open_file(filename, 'a');
+ for source in package_list.keys():
+ for version in package_list[source].keys():
+ file.write(" ".join([source, version])+'\n');
+ file.close();