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
1diff --git a/build-tools/umt b/build-tools/umt
2index cf08dc7..8ccfb79 100755
3--- a/build-tools/umt
4+++ b/build-tools/umt
5@@ -420,6 +420,8 @@ def cmd_changelog():
6 note = "No-change re-build upload."
7 else:
8 pkg_list = search_packages(details['package'], use_rmadison=True) # Avoid dependencies on local installation
9+ if pkg_list in [None, []]:
10+ pkg_list = search_packages(details['package'], use_rmadison=False) # Use local madison as fallback
11 new_ver = increment_version_security(details['version'], opt.esm, details=details, pkg_list=pkg_list, devel_release=ust['release_devel'])
12
13 if opt.repeat:
14diff --git a/package-tools/increment_version.py b/package-tools/increment_version.py
15index 0cfc3d2..100a7a5 100644
16--- a/package-tools/increment_version.py
17+++ b/package-tools/increment_version.py
18@@ -23,7 +23,7 @@ def get_suffix(devel, details, pkg_list, devel_release=""):
19 suffix = "ubuntu1"
20 else:
21 suffix = "ubuntu0.1"
22- if (details is not None) and (pkg_list is not None):
23+ if (details is not None) and (pkg_list not in [None, []]):
24 release_id = get_release_id(details, pkg_list, devel_release)
25 if release_id is not None:
26 suffix = "ubuntu0." + release_id + ".1"

Subscribers

People subscribed via source and target branches