+# What a mess. FIXME
+def extract_component_from_section(section):
+ component = "";
+
+ if string.find(section, '/') != -1:
+ component = string.split(section, '/')[0];
+ if string.lower(component) == "non-us" and string.count(section, '/') > 0:
+ s = string.split(section, '/')[1];
+ if s == "main" or s == "non-free" or s == "contrib": # Avoid e.g. non-US/libs
+ component = string.split(section, '/')[0]+ '/' + string.split(section, '/')[1];
+
+ if string.lower(section) == "non-us":
+ component = "non-US/main";
+
+ if component == "":
+ component = "main";
+ elif string.lower(component) == "non-us":
+ component = "non-US/main";
+
+ return (section, component);
+
+######################################################################################
+
+# dsc_whitespace_rules turns on strict format checking to avoid
+# allowing in source packages which are unextracable by the
+# inappropriately fragile dpkg-source.
+#
+# The rules are:
+#
+#
+# o The PGP header consists of "-----BEGIN PGP SIGNED MESSAGE-----"
+# followed by any PGP header data and must end with a blank line.
+#
+# o The data section must end with a blank line and must be followed by
+# "-----BEGIN PGP SIGNATURE-----".
+
+def parse_changes(filename, dsc_whitespace_rules):