diff -Nru reportbug-11.6.0ubuntu1/debian/changelog reportbug-11.6.0ubuntu2/debian/changelog --- reportbug-11.6.0ubuntu1/debian/changelog 2023-01-22 03:03:11.000000000 +0000 +++ reportbug-11.6.0ubuntu2/debian/changelog 2023-02-01 10:03:46.000000000 +0000 @@ -1,3 +1,9 @@ +reportbug (11.6.0ubuntu2) lunar; urgency=medium + + * Make Python version PEP440 compliant (LP: #1991606) + + -- Benjamin Drung Wed, 01 Feb 2023 11:03:46 +0100 + reportbug (11.6.0ubuntu1) lunar; urgency=medium * Merge from Debian unstable. Remaining changes: @@ -1110,7 +1116,7 @@ refer user to "ubuntu-bug" instead. - reportbug/__init__.py: Match reportbug version with package version. - debian/control: Add prominent note to package description. - - debian/{rules,dirs}: Do not install .desktop file. + - debian/{rules,dirs}: Do not install .desktop file. -- Logan Rosen Sat, 07 Jan 2017 05:20:13 -0500 @@ -1792,7 +1798,7 @@ - debian/control: Add prominent note to package description. - debian/rules: Do not install .desktop file. * debian/dirs: As we don't install the desktop file, we don't - need usr/share/applications. + need usr/share/applications. -- Andrew Starr-Bochicchio Fri, 04 Nov 2011 16:30:49 -0400 @@ -2426,14 +2432,14 @@ reportbug (4.10.1ubuntu3) lucid; urgency=low * reportbug/__init__.py: Update version string to match the one from - debian/changelog (fixes FTBFS). + debian/changelog (fixes FTBFS). -- Michael Bienia Sat, 06 Feb 2010 11:44:50 +0100 reportbug (4.10.1ubuntu2) lucid; urgency=low * debian/rules: do not install .desktop file, so it won't show up in the - desktop menu anymore (LP: #395126) + desktop menu anymore (LP: #395126) -- Daniel Hahler Thu, 04 Feb 2010 02:07:22 +0100 @@ -2771,7 +2777,7 @@ * Merge from debian unstable (LP: #401925), remaining changes: - bin/reportbug - + Make reportbug stop working for bts=ubuntu and refer to "ubuntu-bug" + + Make reportbug stop working for bts=ubuntu and refer to "ubuntu-bug" instead. + exit with an error, if bts=ubuntu (or unconfigured). - reportbug/__init__.py: Match reportbug version with package version. @@ -6796,4 +6802,3 @@ * Initial Release. -- Chris Lawrence Fri, 14 May 1999 05:38:23 -0500 - diff -Nru reportbug-11.6.0ubuntu1/debian/make_pep440_compliant reportbug-11.6.0ubuntu2/debian/make_pep440_compliant --- reportbug-11.6.0ubuntu1/debian/make_pep440_compliant 1970-01-01 00:00:00.000000000 +0000 +++ reportbug-11.6.0ubuntu2/debian/make_pep440_compliant 2023-02-01 10:02:19.000000000 +0000 @@ -0,0 +1,24 @@ +#!/usr/bin/python3 + +import re +import sys + + +def make_pep440_compliant(version: str) -> str: + """Convert the version into a PEP440 compliant version.""" + public_version_re = re.compile( + r"^([0-9][0-9.]*(?:(?:a|b|rc|.post|.dev)[0-9]+)*)\+?" + ) + _, public, local = public_version_re.split(version, maxsplit=1) + if not local: + return version + sanitized_local = re.sub("[+~]+", ".", local).strip(".") + pep440_version = f"{public}+{sanitized_local}" + assert re.match( + "^[a-zA-Z0-9.]+$", sanitized_local + ), f"'{pep440_version}' not PEP440 compliant" + return pep440_version + + +if __name__ == "__main__": + print(make_pep440_compliant(sys.argv[1])) diff -Nru reportbug-11.6.0ubuntu1/debian/rules reportbug-11.6.0ubuntu2/debian/rules --- reportbug-11.6.0ubuntu1/debian/rules 2022-12-04 22:34:32.000000000 +0000 +++ reportbug-11.6.0ubuntu2/debian/rules 2023-02-01 10:02:19.000000000 +0000 @@ -3,15 +3,16 @@ include /usr/share/dpkg/pkg-info.mk REPORTBUG_VERSION := $(shell python3 -c "import reportbug; print(reportbug.VERSION_NUMBER)") +PEP440_DEB_VERSION := $(shell debian/make_pep440_compliant "$(DEB_VERSION)") %: dh $@ --with=python3 override_dh_auto_build: # Test if versions are synchronized (only if releasing); this will bomb if not synced - if [ "$(DEB_DISTRIBUTION)" != "UNRELEASED" -a "$(REPORTBUG_VERSION)" != "$(DEB_VERSION)" ] ; \ + if [ "$(DEB_DISTRIBUTION)" != "UNRELEASED" -a "$(REPORTBUG_VERSION)" != "$(PEP440_DEB_VERSION)" ] ; \ then \ - echo 'Please update VERSION_NUMBER variable in reportbug/__init__.py'; exit 1 ; \ + echo 'Please update VERSION_NUMBER variable in reportbug/__init__.py to $(PEP440_DEB_VERSION)'; exit 1 ; \ fi python3 setup.py build diff -Nru reportbug-11.6.0ubuntu1/reportbug/__init__.py reportbug-11.6.0ubuntu2/reportbug/__init__.py --- reportbug-11.6.0ubuntu1/reportbug/__init__.py 2023-01-22 03:03:04.000000000 +0000 +++ reportbug-11.6.0ubuntu2/reportbug/__init__.py 2023-02-01 10:03:46.000000000 +0000 @@ -25,7 +25,7 @@ __all__ = ['bugreport', 'utils', 'urlutils', 'checkbuildd', 'checkversions', 'debbugs', 'exceptions', 'submit', 'tempfile', 'mailer'] -VERSION_NUMBER = "11.6.0ubuntu1" +VERSION_NUMBER = "11.6.0+ubuntu2" VERSION = "reportbug " + VERSION_NUMBER COPYRIGHT = VERSION + '\nCopyright (C) 1999-2008 Chris Lawrence ' + \