Compare commits

..

No commits in common. "main" and "0.204" have entirely different histories.
main ... 0.204

10 changed files with 83 additions and 165 deletions

1
debian/.gitignore vendored
View File

@ -1 +0,0 @@
files

37
debian/changelog vendored
View File

@ -1,40 +1,3 @@
ubuntu-dev-tools (0.206) unstable; urgency=medium
[ Dan Bungert ]
* mk-sbuild: enable pkgmaintainermangler
[ Shengjing Zhu ]
* import-bug-from-debian: package option is overridden and not used
[ Fernando Bravo Hernández ]
* Parsing arch parameter to getBinaryPackage() (LP: #2081861)
[ Simon Quigley ]
* Read ~/.devscripts in a more robust way, to ideally pick up multi-line
variables (Closes: #725418).
* mk-sbuild: default to using UTC for schroots (LP: #2097159).
* syncpackage: s/syncblacklist/syncblocklist/g
* syncpackage: Cache the sync blocklist in-memory, so it's not fetched
multiple times when syncing more than one package.
* syncpackage: Catch exceptions cleanly, simply skipping to the next
package (erring on the side of caution) if there is an error doing the
download (LP: #1943286).
-- Simon Quigley <tsimonq2@debian.org> Tue, 04 Mar 2025 13:43:15 -0600
ubuntu-dev-tools (0.205) unstable; urgency=medium
* [syncpackage] When syncing multiple packages, if one of the packages is in
the sync blocklist, do not exit, simply continue.
* [syncpackage] Do not use exit(1) on an error or exception unless it
applies to all packages, instead return None so we can continue to the
next package.
* [syncpackage] Add support for -y or --yes, noted that it should be used
with care.
* Update Standards-Version to 4.7.2, no changes needed.
-- Simon Quigley <tsimonq2@debian.org> Sat, 01 Mar 2025 11:29:54 -0600
ubuntu-dev-tools (0.204) unstable; urgency=medium ubuntu-dev-tools (0.204) unstable; urgency=medium
[ Simon Quigley ] [ Simon Quigley ]

2
debian/control vendored
View File

@ -31,7 +31,7 @@ Build-Depends:
python3-requests <!nocheck>, python3-requests <!nocheck>,
python3-setuptools, python3-setuptools,
python3-yaml <!nocheck>, python3-yaml <!nocheck>,
Standards-Version: 4.7.2 Standards-Version: 4.7.1
Rules-Requires-Root: no Rules-Requires-Root: no
Vcs-Git: https://git.launchpad.net/ubuntu-dev-tools Vcs-Git: https://git.launchpad.net/ubuntu-dev-tools
Vcs-Browser: https://git.launchpad.net/ubuntu-dev-tools Vcs-Browser: https://git.launchpad.net/ubuntu-dev-tools

View File

@ -58,7 +58,7 @@ Display more progress information.
\fB\-F\fR, \fB\-\-fakesync\fR \fB\-F\fR, \fB\-\-fakesync\fR
Perform a fakesync, to work around a tarball mismatch between Debian and Perform a fakesync, to work around a tarball mismatch between Debian and
Ubuntu. Ubuntu.
This option ignores blocklisting, and performs a local sync. This option ignores blacklisting, and performs a local sync.
It implies \fB\-\-no\-lp\fR, and will leave a signed \fB.changes\fR file It implies \fB\-\-no\-lp\fR, and will leave a signed \fB.changes\fR file
for you to upload. for you to upload.
.TP .TP

View File

@ -150,7 +150,7 @@ def process_bugs(
err = False err = False
for bug in bugs: for bug in bugs:
ubupackage = bug.source ubupackage = package = bug.source
if package: if package:
ubupackage = package ubupackage = package
bug_num = bug.bug_num bug_num = bug.bug_num

View File

@ -155,7 +155,6 @@ proxy="_unset_"
DEBOOTSTRAP_NO_CHECK_GPG=0 DEBOOTSTRAP_NO_CHECK_GPG=0
EATMYDATA=1 EATMYDATA=1
CCACHE=0 CCACHE=0
USE_PKGBINARYMANGLER=0
while :; do while :; do
case "$1" in case "$1" in
@ -668,7 +667,6 @@ ubuntu)
if ubuntu_dist_ge "$RELEASE" "edgy"; then if ubuntu_dist_ge "$RELEASE" "edgy"; then
# Add pkgbinarymangler (edgy and later) # Add pkgbinarymangler (edgy and later)
BUILD_PKGS="$BUILD_PKGS pkgbinarymangler" BUILD_PKGS="$BUILD_PKGS pkgbinarymangler"
USE_PKGBINARYMANGLER=1
# Disable recommends for a smaller chroot (gutsy and later only) # Disable recommends for a smaller chroot (gutsy and later only)
if ubuntu_dist_ge "$RELEASE" "gutsy"; then if ubuntu_dist_ge "$RELEASE" "gutsy"; then
BUILD_PKGS="--no-install-recommends $BUILD_PKGS" BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
@ -928,8 +926,8 @@ if [ -n "$TEMP_PREFERENCES" ]; then
sudo mv "$TEMP_PREFERENCES" $MNT/etc/apt/preferences.d/proposed.pref sudo mv "$TEMP_PREFERENCES" $MNT/etc/apt/preferences.d/proposed.pref
fi fi
# Copy the timezone (uncomment this if you want to use your local time zone) # Copy the timezone (comment this out if you want to leave the chroot at UTC)
#sudo cp -P --remove-destination /etc/localtime /etc/timezone "$MNT"/etc/ sudo cp -P --remove-destination /etc/localtime /etc/timezone "$MNT"/etc/
# Create a schroot entry for this chroot # Create a schroot entry for this chroot
TEMP_SCHROOTCONF=`mktemp -t schrootconf-XXXXXX` TEMP_SCHROOTCONF=`mktemp -t schrootconf-XXXXXX`
TEMPLATE_SCHROOTCONF=~/.mk-sbuild.schroot.conf TEMPLATE_SCHROOTCONF=~/.mk-sbuild.schroot.conf
@ -1048,25 +1046,6 @@ EOF
EOM EOM
fi fi
if [ "$USE_PKGBINARYMANGLER" = 1 ]; then
sudo bash -c "cat >> $MNT/finish.sh" <<EOM
mkdir -p /etc/pkgbinarymangler/
cat > /etc/pkgbinarymangler/maintainermangler.conf <<EOF
# pkgmaintainermangler configuration file
# pkgmaintainermangler will do nothing unless enable is set to "true"
enable: true
# Configure what happens if /CurrentlyBuilding is present, but invalid
# (i. e. it does not contain a Package: field). If "ignore" (default),
# the file is ignored (i. e. the Maintainer field is mangled) and a
# warning is printed. If "fail" (or any other value), pkgmaintainermangler
# exits with an error, which causes a package build to fail.
invalid_currentlybuilding: ignore
EOF
EOM
fi
if [ -n "$TARGET_ARCH" ]; then if [ -n "$TARGET_ARCH" ]; then
sudo bash -c "cat >> $MNT/finish.sh" <<EOM sudo bash -c "cat >> $MNT/finish.sh" <<EOM
# Configure target architecture # Configure target architecture
@ -1085,7 +1064,7 @@ apt-get update || true
echo set debconf/frontend Noninteractive | debconf-communicate echo set debconf/frontend Noninteractive | debconf-communicate
echo set debconf/priority critical | debconf-communicate echo set debconf/priority critical | debconf-communicate
# Install basic build tool set, trying to match buildd # Install basic build tool set, trying to match buildd
apt-get -y --force-yes -o Dpkg::Options::="--force-confold" install $BUILD_PKGS apt-get -y --force-yes install $BUILD_PKGS
# Set up expected /dev entries # Set up expected /dev entries
if [ ! -r /dev/stdin ]; then ln -s /proc/self/fd/0 /dev/stdin; fi if [ ! -r /dev/stdin ]; then ln -s /proc/self/fd/0 /dev/stdin; fi
if [ ! -r /dev/stdout ]; then ln -s /proc/self/fd/1 /dev/stdout; fi if [ ! -r /dev/stdout ]; then ln -s /proc/self/fd/1 /dev/stdout; fi

View File

@ -49,7 +49,6 @@ from ubuntutools.requestsync.mail import get_debian_srcpkg as requestsync_mail_g
from ubuntutools.version import Version from ubuntutools.version import Version
Logger = getLogger() Logger = getLogger()
cached_sync_blocklist = None
def remove_signature(dscname): def remove_signature(dscname):
@ -144,7 +143,7 @@ def sync_dsc(
if ubuntu_ver.is_modified_in_ubuntu(): if ubuntu_ver.is_modified_in_ubuntu():
if not force: if not force:
Logger.error("--force is required to discard Ubuntu changes.") Logger.error("--force is required to discard Ubuntu changes.")
return None sys.exit(1)
Logger.warning( Logger.warning(
"Overwriting modified Ubuntu version %s, setting current version to %s", "Overwriting modified Ubuntu version %s, setting current version to %s",
@ -158,7 +157,7 @@ def sync_dsc(
src_pkg.pull() src_pkg.pull()
except DownloadError as e: except DownloadError as e:
Logger.error("Failed to download: %s", str(e)) Logger.error("Failed to download: %s", str(e))
return None sys.exit(1)
src_pkg.unpack() src_pkg.unpack()
needs_fakesync = not (need_orig or ubu_pkg.verify_orig()) needs_fakesync = not (need_orig or ubu_pkg.verify_orig())
@ -167,13 +166,13 @@ def sync_dsc(
Logger.warning("Performing a fakesync") Logger.warning("Performing a fakesync")
elif not needs_fakesync and fakesync: elif not needs_fakesync and fakesync:
Logger.error("Fakesync not required, aborting.") Logger.error("Fakesync not required, aborting.")
return None sys.exit(1)
elif needs_fakesync and not fakesync: elif needs_fakesync and not fakesync:
Logger.error( Logger.error(
"The checksums of the Debian and Ubuntu packages " "The checksums of the Debian and Ubuntu packages "
"mismatch. A fake sync using --fakesync is required." "mismatch. A fake sync using --fakesync is required."
) )
return None sys.exit(1)
if fakesync: if fakesync:
# Download Ubuntu files (override Debian source tarballs) # Download Ubuntu files (override Debian source tarballs)
@ -181,7 +180,7 @@ def sync_dsc(
ubu_pkg.pull() ubu_pkg.pull()
except DownloadError as e: except DownloadError as e:
Logger.error("Failed to download: %s", str(e)) Logger.error("Failed to download: %s", str(e))
return None sys.exit(1)
# change into package directory # change into package directory
directory = src_pkg.source + "-" + new_ver.upstream_version directory = src_pkg.source + "-" + new_ver.upstream_version
@ -266,7 +265,7 @@ def sync_dsc(
returncode = subprocess.call(cmd) returncode = subprocess.call(cmd)
if returncode != 0: if returncode != 0:
Logger.error("Source-only build with debuild failed. Please check build log above.") Logger.error("Source-only build with debuild failed. Please check build log above.")
return None sys.exit(1)
def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror): def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
@ -296,7 +295,7 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
udtexceptions.SeriesNotFoundException, udtexceptions.SeriesNotFoundException,
) as e: ) as e:
Logger.error(str(e)) Logger.error(str(e))
return None sys.exit(1)
if version is None: if version is None:
version = Version(debian_srcpkg.getVersion()) version = Version(debian_srcpkg.getVersion())
try: try:
@ -307,7 +306,7 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
ubuntu_version = Version("~") ubuntu_version = Version("~")
except udtexceptions.SeriesNotFoundException as e: except udtexceptions.SeriesNotFoundException as e:
Logger.error(str(e)) Logger.error(str(e))
return None sys.exit(1)
if ubuntu_version >= version: if ubuntu_version >= version:
# The LP importer is maybe out of date # The LP importer is maybe out of date
debian_srcpkg = requestsync_mail_get_debian_srcpkg(package, dist) debian_srcpkg = requestsync_mail_get_debian_srcpkg(package, dist)
@ -321,7 +320,7 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
ubuntu_version, ubuntu_version,
ubuntu_release, ubuntu_release,
) )
return None sys.exit(1)
if component is None: if component is None:
component = debian_srcpkg.getComponent() component = debian_srcpkg.getComponent()
@ -330,7 +329,7 @@ def fetch_source_pkg(package, dist, version, component, ubuntu_release, mirror):
return DebianSourcePackage(package, version.full_version, component, mirrors=mirrors) return DebianSourcePackage(package, version.full_version, component, mirrors=mirrors)
def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, yes=False): def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False):
"""Copy a source package from Debian to Ubuntu using the Launchpad API.""" """Copy a source package from Debian to Ubuntu using the Launchpad API."""
ubuntu = Distribution("ubuntu") ubuntu = Distribution("ubuntu")
debian_archive = Distribution("debian").getArchive() debian_archive = Distribution("debian").getArchive()
@ -353,7 +352,7 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
"Debian version %s has not been picked up by LP yet. Please try again later.", "Debian version %s has not been picked up by LP yet. Please try again later.",
src_pkg.version, src_pkg.version,
) )
return None sys.exit(1)
try: try:
ubuntu_spph = get_ubuntu_srcpkg(src_pkg.source, ubuntu_series, ubuntu_pocket) ubuntu_spph = get_ubuntu_srcpkg(src_pkg.source, ubuntu_series, ubuntu_pocket)
@ -374,7 +373,7 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
base_version = ubuntu_version.get_related_debian_version() base_version = ubuntu_version.get_related_debian_version()
if not force and ubuntu_version.is_modified_in_ubuntu(): if not force and ubuntu_version.is_modified_in_ubuntu():
Logger.error("--force is required to discard Ubuntu changes.") Logger.error("--force is required to discard Ubuntu changes.")
return None sys.exit(1)
# Check whether a fakesync would be required. # Check whether a fakesync would be required.
if not src_pkg.dsc.compare_dsc(ubuntu_pkg.dsc): if not src_pkg.dsc.compare_dsc(ubuntu_pkg.dsc):
@ -382,7 +381,7 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
"The checksums of the Debian and Ubuntu packages " "The checksums of the Debian and Ubuntu packages "
"mismatch. A fake sync using --fakesync is required." "mismatch. A fake sync using --fakesync is required."
) )
return None sys.exit(1)
except udtexceptions.PackageNotFoundException: except udtexceptions.PackageNotFoundException:
base_version = Version("~") base_version = Version("~")
Logger.info( Logger.info(
@ -403,10 +402,9 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
if sponsoree: if sponsoree:
Logger.info("Sponsoring this sync for %s (%s)", sponsoree.display_name, sponsoree.name) Logger.info("Sponsoring this sync for %s (%s)", sponsoree.display_name, sponsoree.name)
if not yes: answer = YesNoQuestion().ask("Sync this package", "no")
answer = YesNoQuestion().ask("Sync this package", "no") if answer != "yes":
if answer != "yes": return
return
try: try:
ubuntu_archive.copyPackage( ubuntu_archive.copyPackage(
@ -421,29 +419,26 @@ def copy(src_pkg, release, bugs, sponsoree=None, simulate=False, force=False, ye
except HTTPError as error: except HTTPError as error:
Logger.error("HTTP Error %s: %s", error.response.status, error.response.reason) Logger.error("HTTP Error %s: %s", error.response.status, error.response.reason)
Logger.error(error.content) Logger.error(error.content)
return None sys.exit(1)
Logger.info("Request succeeded; you should get an e-mail once it is processed.") Logger.info("Request succeeded; you should get an e-mail once it is processed.")
bugs = sorted(set(bugs)) bugs = sorted(set(bugs))
if bugs: if bugs:
Logger.info("Launchpad bugs to be closed: %s", ", ".join(str(bug) for bug in bugs)) Logger.info("Launchpad bugs to be closed: %s", ", ".join(str(bug) for bug in bugs))
Logger.info("Please wait for the sync to be successful before closing bugs.") Logger.info("Please wait for the sync to be successful before closing bugs.")
if yes: answer = YesNoQuestion().ask("Close bugs", "yes")
if answer == "yes":
close_bugs(bugs, src_pkg.source, src_pkg.version.full_version, changes, sponsoree) close_bugs(bugs, src_pkg.source, src_pkg.version.full_version, changes, sponsoree)
else:
answer = YesNoQuestion().ask("Close bugs", "yes")
if answer == "yes":
close_bugs(bugs, src_pkg.source, src_pkg.version.full_version, changes, sponsoree)
def is_blocklisted(query): def is_blacklisted(query):
"""Determine if package "query" is in the sync blocklist """Determine if package "query" is in the sync blacklist
Returns tuple of (blocklisted, comments) Returns tuple of (blacklisted, comments)
blocklisted is one of False, 'CURRENT', 'ALWAYS' blacklisted is one of False, 'CURRENT', 'ALWAYS'
""" """
series = Launchpad.distributions["ubuntu"].current_series series = Launchpad.distributions["ubuntu"].current_series
lp_comments = series.getDifferenceComments(source_package_name=query) lp_comments = series.getDifferenceComments(source_package_name=query)
blocklisted = False blacklisted = False
comments = [ comments = [
f"{c.body_text}\n -- {c.comment_author.name}" f"{c.body_text}\n -- {c.comment_author.name}"
f" {c.comment_date.strftime('%a, %d %b %Y %H:%M:%S +0000')}" f" {c.comment_date.strftime('%a, %d %b %Y %H:%M:%S +0000')}"
@ -451,38 +446,32 @@ def is_blocklisted(query):
] ]
for diff in series.getDifferencesTo(source_package_name_filter=query): for diff in series.getDifferencesTo(source_package_name_filter=query):
if diff.status == "Blacklisted current version" and blocklisted != "ALWAYS": if diff.status == "Blacklisted current version" and blacklisted != "ALWAYS":
blocklisted = "CURRENT" blacklisted = "CURRENT"
if diff.status == "Blacklisted always": if diff.status == "Blacklisted always":
blocklisted = "ALWAYS" blacklisted = "ALWAYS"
global cached_sync_blocklist # Old blacklist:
if not cached_sync_blocklist: url = "https://ubuntu-archive-team.ubuntu.com/sync-blacklist.txt"
url = "https://ubuntu-archive-team.ubuntu.com/sync-blocklist.txt" with urllib.request.urlopen(url) as f:
try: applicable_lines = []
with urllib.request.urlopen(url) as f: for line in f:
cached_sync_blocklist = f.read().decode("utf-8") line = line.decode("utf-8")
except: if not line.strip():
print("WARNING: unable to download the sync blocklist. Erring on the side of caution.") applicable_lines = []
return ("ALWAYS", "INTERNAL ERROR: Unable to fetch sync blocklist") continue
applicable_lines.append(line)
try:
line = line[: line.index("#")]
except ValueError:
pass
source = line.strip()
if source and fnmatch.fnmatch(query, source):
comments += ["From sync-blacklist.txt:"] + applicable_lines
blacklisted = "ALWAYS"
break
applicable_lines = [] return (blacklisted, comments)
for line in cached_sync_blocklist.splitlines():
if not line.strip():
applicable_lines = []
continue
applicable_lines.append(line)
try:
line = line[:line.index("#")]
except ValueError:
pass
source = line.strip()
if source and fnmatch.fnmatch(query, source):
comments += ["From sync-blocklist.txt:"] + applicable_lines
blocklisted = "ALWAYS"
break
return (blocklisted, comments)
def close_bugs(bugs, package, version, changes, sponsoree): def close_bugs(bugs, package, version, changes, sponsoree):
@ -519,12 +508,6 @@ def parse():
epilog = f"See {os.path.basename(sys.argv[0])}(1) for more info." epilog = f"See {os.path.basename(sys.argv[0])}(1) for more info."
parser = argparse.ArgumentParser(usage=usage, epilog=epilog) parser = argparse.ArgumentParser(usage=usage, epilog=epilog)
parser.add_argument(
"-y",
"--yes",
action="store_true",
help="Automatically sync without prompting. Use with caution and care."
)
parser.add_argument("-d", "--distribution", help="Debian distribution to sync from.") parser.add_argument("-d", "--distribution", help="Debian distribution to sync from.")
parser.add_argument("-r", "--release", help="Specify target Ubuntu release.") parser.add_argument("-r", "--release", help="Specify target Ubuntu release.")
parser.add_argument("-V", "--debian-version", help="Specify the version to sync from.") parser.add_argument("-V", "--debian-version", help="Specify the version to sync from.")
@ -729,38 +712,36 @@ def main():
args.release, args.release,
args.debian_mirror, args.debian_mirror,
) )
if not src_pkg:
continue
blocklisted, comments = is_blocklisted(src_pkg.source) blacklisted, comments = is_blacklisted(src_pkg.source)
blocklist_fail = False blacklist_fail = False
if blocklisted: if blacklisted:
messages = [] messages = []
if blocklisted == "CURRENT": if blacklisted == "CURRENT":
Logger.debug( Logger.debug(
"Source package %s is temporarily blocklisted " "Source package %s is temporarily blacklisted "
"(blocklisted_current). " "(blacklisted_current). "
"Ubuntu ignores these for now. " "Ubuntu ignores these for now. "
"See also LP: #841372", "See also LP: #841372",
src_pkg.source, src_pkg.source,
) )
else: else:
if args.fakesync: if args.fakesync:
messages += ["Doing a fakesync, overriding blocklist."] messages += ["Doing a fakesync, overriding blacklist."]
else: else:
blocklist_fail = True blacklist_fail = True
messages += [ messages += [
"If this package needs a fakesync, use --fakesync", "If this package needs a fakesync, use --fakesync",
"If you think this package shouldn't be " "If you think this package shouldn't be "
"blocklisted, please file a bug explaining your " "blacklisted, please file a bug explaining your "
"reasoning and subscribe ~ubuntu-archive.", "reasoning and subscribe ~ubuntu-archive.",
] ]
if blocklist_fail: if blacklist_fail:
Logger.error("Source package %s is blocklisted.", src_pkg.source) Logger.error("Source package %s is blacklisted.", src_pkg.source)
elif blocklisted == "ALWAYS": elif blacklisted == "ALWAYS":
Logger.info("Source package %s is blocklisted.", src_pkg.source) Logger.info("Source package %s is blacklisted.", src_pkg.source)
if messages: if messages:
for message in messages: for message in messages:
for line in textwrap.wrap(message): for line in textwrap.wrap(message):
@ -772,15 +753,14 @@ def main():
for line in textwrap.wrap(comment): for line in textwrap.wrap(comment):
Logger.info(" %s", line) Logger.info(" %s", line)
if blocklist_fail: if blacklist_fail:
continue sys.exit(1)
if args.lp: if args.lp:
if not copy(src_pkg, args.release, args.bugs, sponsoree, args.simulate, args.force, args.yes): copy(src_pkg, args.release, args.bugs, sponsoree, args.simulate, args.force)
continue
else: else:
os.environ["DEB_VENDOR"] = "Ubuntu" os.environ["DEB_VENDOR"] = "Ubuntu"
if not sync_dsc( sync_dsc(
src_pkg, src_pkg,
args.distribution, args.distribution,
args.release, args.release,
@ -792,8 +772,7 @@ def main():
args.simulate, args.simulate,
args.force, args.force,
args.fakesync, args.fakesync,
): )
continue
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -165,7 +165,6 @@ class SourcePackage(ABC):
series = kwargs.get("series") series = kwargs.get("series")
pocket = kwargs.get("pocket") pocket = kwargs.get("pocket")
status = kwargs.get("status") status = kwargs.get("status")
arch = kwargs.get("arch")
verify_signature = kwargs.get("verify_signature", False) verify_signature = kwargs.get("verify_signature", False)
try_binary = kwargs.get("try_binary", True) try_binary = kwargs.get("try_binary", True)
@ -185,7 +184,6 @@ class SourcePackage(ABC):
self._series = series self._series = series
self._pocket = pocket self._pocket = pocket
self._status = status self._status = status
self._arch = arch
# dscfile can be either a path or an URL. misc.py's download() will # dscfile can be either a path or an URL. misc.py's download() will
# later fiture it out # later fiture it out
self._dsc_source = dscfile self._dsc_source = dscfile
@ -254,7 +252,6 @@ class SourcePackage(ABC):
) )
try: try:
params["archtag"] = self._arch
bpph = archive.getBinaryPackage(self.source, **params) bpph = archive.getBinaryPackage(self.source, **params)
except PackageNotFoundException as bpnfe: except PackageNotFoundException as bpnfe:
# log binary lookup failure, in case it provides hints # log binary lookup failure, in case it provides hints

View File

@ -68,19 +68,21 @@ class UDTConfig:
config = {} config = {}
for filename in ("/etc/devscripts.conf", "~/.devscripts"): for filename in ("/etc/devscripts.conf", "~/.devscripts"):
try: try:
with open(os.path.expanduser(filename), "r", encoding="utf-8") as f: f = open(os.path.expanduser(filename), "r", encoding="utf-8")
content = f.read()
except IOError: except IOError:
continue continue
try: for line in f:
tokens = shlex.split(content, comments=True) parsed = shlex.split(line, comments=True)
except ValueError as e: if len(parsed) > 1:
Logger.error("Error parsing %s: %s", filename, e) Logger.warning(
continue "Cannot parse variable assignment in %s: %s",
for token in tokens: getattr(f, "name", "<config>"),
if "=" in token: line,
key, value = token.split("=", 1) )
if len(parsed) >= 1 and "=" in parsed[0]:
key, value = parsed[0].split("=", 1)
config[key] = value config[key] = value
f.close()
return config return config
def get_value(self, key, default=None, boolean=False, compat_keys=()): def get_value(self, key, default=None, boolean=False, compat_keys=()):

View File

@ -340,7 +340,6 @@ class PullPkg:
params = {} params = {}
params["package"] = options["package"] params["package"] = options["package"]
params["arch"] = options["arch"]
if options["release"]: if options["release"]:
(release, version, pocket) = self.parse_release_and_version( (release, version, pocket) = self.parse_release_and_version(