When using pull-*-source to grab a package which already has a defined Vcs- field, display the exact same warning message apt source does.

This commit is contained in:
Simon Quigley 2023-10-03 14:01:19 -05:00
parent 5bda35f6b4
commit 2f396fe549
2 changed files with 33 additions and 0 deletions

2
debian/changelog vendored
View File

@ -3,6 +3,8 @@ ubuntu-dev-tools (0.197) UNRELEASED; urgency=medium
[ Simon Quigley ] [ Simon Quigley ]
* Update the manpage for syncpackage to reflect the ability to sync * Update the manpage for syncpackage to reflect the ability to sync
multiple packages at once. multiple packages at once.
* When using pull-*-source to grab a package which already has a defined
Vcs- field, display the exact same warning message `apt source` does.
-- Ubuntu Tooling Warriors <ubuntu-devel@lists.ubuntu.com> Thu, 10 Aug 2023 14:37:54 -0500 -- Ubuntu Tooling Warriors <ubuntu-devel@lists.ubuntu.com> Thu, 10 Aug 2023 14:37:54 -0500

View File

@ -445,6 +445,37 @@ class PullPkg:
Logger.info("Found %s", spph.display_name) Logger.info("Found %s", spph.display_name)
# The VCS detection logic was modeled after `apt source`
for key in srcpkg.dsc.keys():
original_key = key
key = key.lower()
if key.startswith("vcs-"):
if key == "vcs-browser":
continue
elif key == "vcs-git":
vcs = "Git"
elif key == "vcs-bzr":
vcs = "Bazaar"
else:
continue
uri = srcpkg.dsc[original_key]
Logger.warning("\nNOTICE: '%s' packaging is maintained in "
"the '%s' version control system at:\n"
" %s\n" % (package, vcs, uri))
if vcs == "Bazaar":
vcscmd = " $ bzr branch " + uri
elif vcs == "Git":
vcscmd = " $ git clone " + uri
if vcscmd:
Logger.info(f"Please use:\n{vcscmd}\n"
"to retrieve the latest (possibly unreleased) "
"updates to the package.\n")
if pull == PULL_LIST: if pull == PULL_LIST:
Logger.info("Source files:") Logger.info("Source files:")
for f in srcpkg.dsc["Files"]: for f in srcpkg.dsc["Files"]: