()) if issue.should_fix(): # If only a single mangle is used for all releases # that have signatures, set that. if len(active_common_mangles) == 1: new_mangle = active_common_mangles.pop() entry.set_option('pgpsigurlmangle', new_mangle) # If all releases are signed, mandate it. if len(found_common_mangles) == 1: entry.set_option('pgpmode', 'mangle') description = "Check upstream PGP signatures." else: # Otherwise, fall back to auto. entry.set_option('pgpmode', 'auto') description = "Opportunistically check upstream PGP signatures." issue.report_fixed() if not has_keys and needed_keys: issue = LintianIssue('source', 'debian-watch-file-pubkey-file-is-missing', ()) if issue.should_fix(): if not os.path.isdir('debian/upstream'): os.mkdir('debian/upstream') with open('debian/upstream/signing-key.asc', 'wb') as f: missing_keys = [] for fpr in needed_keys: key = c.key_export_minimal(fpr) if not key: missing_keys.append(fpr) f.write(key) if missing_keys:
OLD_PATH = 'debian/tests/control.autodep8' NEW_PATH = 'debian/tests/control' if not os.path.exists(OLD_PATH): sys.exit(0) issue = LintianIssue('source', 'debian-tests-control-autodep8-is-obsolete', info=OLD_PATH) if not issue.should_fix(): sys.exit(0) if not os.path.exists(NEW_PATH): os.rename(OLD_PATH, 'debian/tests/control') issue.report_fixed() report_result("Rename obsolete path %s to %s." % (OLD_PATH, NEW_PATH)) else: merge_issue = LintianIssue('source', 'debian-tests-control-and-control-autodep8', info='%s %s' % (OLD_PATH, NEW_PATH)) if not merge_issue.should_fix(): sys.exit(0) merge_issue.report_fixed() issue.report_fixed() with open(NEW_PATH, 'ab') as outf: outf.write(b'\n') with open(OLD_PATH, 'rb') as inf: outf.writelines(inf.readlines()) os.unlink(OLD_PATH) report_result("Merge %s into %s." % (OLD_PATH, NEW_PATH))
if not changed: sys.exit(0) filter_by_tag(editor.code, changed, ['Repository', 'Repository-Browse'], 'upstream-metadata-missing-repository') filter_by_tag(editor.code, changed, ['Bug-Database', 'Bug-Submit'], 'upstream-metadata-missing-bug-tracking') # A change that just says the "Name" field is a bit silly if set(changed.keys()) - set(ADDON_ONLY_FIELDS) == set(['Name']): sys.exit(0) if not os.path.exists('debian/upstream/metadata'): missing_file_issue.report_fixed() update_ordered_dict(editor.code, [(k, v.value) for (k, v) in changed.items()], key=upstream_metadata_sort_key) # If there are only add-on-only fields, then just remove the file. if not (set(editor.code.keys()) - set(ADDON_ONLY_FIELDS)): editor.code.clear() if editor.code and not os.path.isdir('debian/upstream'): os.makedirs('debian/upstream', exist_ok=True) # TODO(jelmer): Add note about other origin fields? fields = [('%s (from %s)' % (v.field, v.origin)) if v.origin == './configure' else v.field
import os import sys if is_debcargo_package(): sys.exit(0) description = None if not os.path.exists('debian/source/format'): orig_format = None format = '1.0' missing_source_format_issue = LintianIssue('source', 'missing-debian-source-format') if not missing_source_format_issue.should_fix(): sys.exit(0) missing_source_format_issue.report_fixed() description = "Explicitly specify source format." else: with open('debian/source/format', 'r') as f: format = orig_format = f.read().strip() if orig_format not in (None, '1.0'): sys.exit(0) older_source_format_issue = LintianIssue('source', 'older-source-format', info=(orig_format or '1.0')) if older_source_format_issue.should_fix(): if package_is_native(): format = '3.0 (native)'