- # Ensure there is a target distribution
- if changes["distribution"].keys() == []:
- reject("huh? Distribution field is empty in changes file.");
-
- # Map frozen to unstable if frozen doesn't exist
- if changes["distribution"].has_key("frozen") and not Cnf.has_key("Suite::Frozen"):
- del changes["distribution"]["frozen"]
- changes["distribution"]["unstable"] = 1;
- reject("Mapping frozen to unstable.","");
-
- # Map testing to unstable
- if changes["distribution"].has_key("testing"):
- if len(changes["distribution"].keys()) > 1:
- del changes["distribution"]["testing"];
- reject("Ignoring testing as a target suite.", "Warning: ");
- else:
- reject("invalid distribution 'testing'.");
-
- # Ensure target distributions exist
- for i in changes["distribution"].keys():
- if not Cnf.has_key("Suite::%s" % (i)):
- reject("Unknown distribution `%s'." % (i));
-
- # Map unreleased arches from stable to unstable
- if changes["distribution"].has_key("stable"):
- for i in changes["architecture"].keys():
- if not Cnf.has_key("Suite::Stable::Architectures::%s" % (i)):
- reject("Mapping stable to unstable for unreleased arch %s." % (i),"");
- del changes["distribution"]["stable"];
- changes["distribution"]["unstable"] = 1;
- break;
-
- # Map arches not being released from frozen to unstable
- if changes["distribution"].has_key("frozen"):
- for i in changes["architecture"].keys():
- if not Cnf.has_key("Suite::Frozen::Architectures::%s" % (i)):
- reject("Mapping frozen to unstable for non-releasing arch `%s'." % (i),"");
- del changes["distribution"]["frozen"]
- changes["distribution"]["unstable"] = 1;
-
- # Map stable uploads to proposed-updates
- if changes["distribution"].has_key("stable"):
- reject("Mapping stable to updates.","");
- del changes["distribution"]["stable"];
- changes["distribution"]["proposed-updates"] = 1;