From 76926159194e180003aa78de97e5f287bf4325a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 20:07:41 +0200 Subject: Adding upstream version 2.7.6. Signed-off-by: Daniel Baumann --- doc/source/examples/update-print-uris.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 doc/source/examples/update-print-uris.py (limited to 'doc/source/examples/update-print-uris.py') diff --git a/doc/source/examples/update-print-uris.py b/doc/source/examples/update-print-uris.py new file mode 100755 index 0000000..02981f8 --- /dev/null +++ b/doc/source/examples/update-print-uris.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3 +"""Print out the URIs of all indexes files. + +This behaves somewhat like apt-get --print-uris update.""" +import apt_pkg + + +def main(): + apt_pkg.init_config() + apt_pkg.init_system() + acquire = apt_pkg.Acquire() + slist = apt_pkg.SourceList() + # Read the list + slist.read_main_list() + # Add all indexes to the fetcher. + slist.get_indexes(acquire, True) + + # Now print the URI of every item. + for item in acquire.items: + print(item.desc_uri) + + +if __name__ == "__main__": + main() -- cgit v1.2.3