- # Build-Depends: ARRAY(<hex>) is not good ...
- if (dsc.get("build-depends","").find("ARRAY") == 0 or
- dsc.get("build-depends-indep","").find("ARRAY") == 0):
- reject("%s: invalid Build-Depends field produced by a broken version of dpkg-dev (1.10.11)" % (file));
+ # Validate the build-depends field(s)
+ for field_name in [ "build-depends", "build-depends-indep" ]:
+ field = dsc.get(field_name);
+ if field:
+ # Check for broken dpkg-dev lossage...
+ if field.find("ARRAY") == 0:
+ reject("%s: invalid %s field produced by a broken version of dpkg-dev (1.10.11)" % (file, field_name.title()));
+
+ # Have apt try to parse them...
+ try:
+ apt_pkg.ParseSrcDepends(field);
+ except:
+ reject("%s: invalid %s field (can not be parsed by apt)." % (file, field_name.title()));
+ pass;