/usr/share/doc/python-apt/examples/update-print-uris.py is in python-apt-doc 0.9.3.12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/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()
|