From 2ccb7545bb8c869f5f6192569a47a7522b6fbc83 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 25 Oct 2009 14:57:38 +0100 Subject: Add a tutorial on how to do things which are possible with apt-get, like apt-get --print-uris update (cf. #551164). --- doc/source/examples/update-print-uris.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/source/examples/update-print-uris.py (limited to 'doc/source/examples') diff --git a/doc/source/examples/update-print-uris.py b/doc/source/examples/update-print-uris.py new file mode 100644 index 00000000..f078cdc5 --- /dev/null +++ b/doc/source/examples/update-print-uris.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +"""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