#!/bin/sh

# take output of:
# apt-get ... --print-uris
# and convert URIs/URLs, to just the filename portions

sed -ne '
	/^'\''/!d
	s/^.*\///
	s/ [0-9][0-9]* \(MD5Sum:[0-9a-f]\{32\}\)\{0,1\}$//
	s/'\'' / /
	s/^\([^ ][^ ]*\) \1$/\1/
	s/ /\n/
	p
' |
sort -u
