1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Allow rankmirrors to read from stdin

Feature Request #8043 and provided patch. Thanks!

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Peter Johnson 2007-09-17 19:48:57 -05:00 committed by Dan McGee
parent acfdad6db3
commit afdcf7552c

View File

@ -121,11 +121,15 @@ if __name__ == "__main__":
print args[0], ':', "%.2f" % serverToTime
sys.exit(0)
if not os.path.isfile(args[0]):
if not os.path.isfile(args[0]) and args[0] != "-":
print >>sys.stderr, 'rankmirrors: file', args[0], 'does not exist.'
sys.exit(1)
fl = open(args[0], 'r')
if args[0] == "-":
fl = sys.stdin
else:
fl = open(args[0], 'r')
serverToTime = {}
if options.times:
print 'Querying servers, this may take some time...'