• Bug#1033837: marked as done (unblock: devscripts/2.23.3) (2/3)

    From Debian Bug Tracking System@21:1/5 to All on Sun Apr 2 20:10:01 2023
    [continued from previous message]

    - return parser.parse_args()
    + return parser.parse_args(args)


    def query_metasnap(pkgsleft, archive, nativearch):
    @@ -612,8 +624,8 @@
    shutil.move(tmpdir2 + "/" + debs[0], tmpdirname + "/cache")


    -def main():
    - args = parse_args()
    +def main(arguments: list[str]) -> None:
    + args = parse_args(arguments)
    if args.packages:
    pkgs = [v for sublist in args.packages for v in sublist]
    if args.architecture is None:
    @@ -646,6 +658,17 @@
    if a != nativearch:
    foreignarches.add(a)

    + for tool in [
    + "equivs-build",
    + "apt-ftparchive",
    + "mmdebstrap",
    + "apt-get",
    + "dpkg-name",
    + ]:
    + if shutil.which(tool) is None:
    + print(f"{tool} is required but not installed", file=sys.stderr)
    + sys.exit(1)
    +
    sources = compute_sources(pkgs, nativearch, args.ignore_notfound)

    if args.sources_list_only:
    @@ -668,4 +691,4 @@


    if __name__ == "__main__":
    - main()
    + main(sys.argv[1:])
    diff -Nru devscripts-2.23.2/scripts/debootsnap.py devscripts-2.23.3/scripts/debootsnap.py
    --- devscripts-2.23.2/scripts/debootsnap.py 1970-01-01 01:00:00.000000000 +0100
    +++ devscripts-2.23.3/scripts/debootsnap.py 2023-03-15 23:35:37.000000000 +0100
    @@ -0,0 +1,694 @@
    +#!/usr/bin/env python3
    +#
    +# Copyright 2021 Johannes Schauer Marin Rodrigues <josch@debian.org>
    +#
    +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal
    +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +# copies of the Software, and to permit persons to whom the Software is
    +# furnished to do so, subject to the following conditions:
    +#
    +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software.
    +
    +# This tool is similar to debootstrap but is able to recreate a chroot
    +# containing precisely the given package and version selection. Th