Merge ~jslarraz/ubuntu-security-tools:fix-umt-changelog-increment-version into ubuntu-security-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: 3dbc2e826b3a765671b4b7c6c0e2e6f53d25421e
Proposed branch: ~jslarraz/ubuntu-security-tools:fix-umt-changelog-increment-version
Merge into: ubuntu-security-tools:master
Diff against target: 26 lines (+3/-1)
2 files modified
build-tools/umt (+2/-0)
package-tools/increment_version.py (+1/-1)
Reviewer Review Type Date Requested Status
Eduardo Barretto Approve
Review via email: mp+458463@code.launchpad.net

Commit message

Add local madison as fallback to get package versions information for umt changelog.

Description of the change

When using rmadison (lpmad) to obtain version information for a package that is not in the archive (only on a ppa or locally), the umt changelog crashed because of https://code.launchpad.net/~jslarraz/ubuntu-security-tools/+git/ubuntu-security-tools/+merge/450145. This MR fixes this issue.

To post a comment you must log in.
Revision history for this message
Eduardo Barretto (ebarretto) wrote :

thanks for taking care of this!
lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/build-tools/umt b/build-tools/umt
index cf08dc7..8ccfb79 100755
--- a/build-tools/umt
+++ b/build-tools/umt
@@ -420,6 +420,8 @@ def cmd_changelog():
420 note = "No-change re-build upload."420 note = "No-change re-build upload."
421 else:421 else:
422 pkg_list = search_packages(details['package'], use_rmadison=True) # Avoid dependencies on local installation422 pkg_list = search_packages(details['package'], use_rmadison=True) # Avoid dependencies on local installation
423 if pkg_list in [None, []]:
424 pkg_list = search_packages(details['package'], use_rmadison=False) # Use local madison as fallback
423 new_ver = increment_version_security(details['version'], opt.esm, details=details, pkg_list=pkg_list, devel_release=ust['release_devel'])425 new_ver = increment_version_security(details['version'], opt.esm, details=details, pkg_list=pkg_list, devel_release=ust['release_devel'])
424426
425 if opt.repeat:427 if opt.repeat:
diff --git a/package-tools/increment_version.py b/package-tools/increment_version.py
index 0cfc3d2..100a7a5 100644
--- a/package-tools/increment_version.py
+++ b/package-tools/increment_version.py
@@ -23,7 +23,7 @@ def get_suffix(devel, details, pkg_list, devel_release=""):
23 suffix = "ubuntu1"23 suffix = "ubuntu1"
24 else:24 else:
25 suffix = "ubuntu0.1"25 suffix = "ubuntu0.1"
26 if (details is not None) and (pkg_list is not None):26 if (details is not None) and (pkg_list not in [None, []]):
27 release_id = get_release_id(details, pkg_list, devel_release)27 release_id = get_release_id(details, pkg_list, devel_release)
28 if release_id is not None:28 if release_id is not None:
29 suffix = "ubuntu0." + release_id + ".1"29 suffix = "ubuntu0." + release_id + ".1"

Subscribers

People subscribed via source and target branches