mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 13:07:58 -05: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:
parent
acfdad6db3
commit
afdcf7552c
@ -121,11 +121,15 @@ if __name__ == "__main__":
|
|||||||
print args[0], ':', "%.2f" % serverToTime
|
print args[0], ':', "%.2f" % serverToTime
|
||||||
sys.exit(0)
|
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.'
|
print >>sys.stderr, 'rankmirrors: file', args[0], 'does not exist.'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if args[0] == "-":
|
||||||
|
fl = sys.stdin
|
||||||
|
else:
|
||||||
fl = open(args[0], 'r')
|
fl = open(args[0], 'r')
|
||||||
|
|
||||||
serverToTime = {}
|
serverToTime = {}
|
||||||
if options.times:
|
if options.times:
|
||||||
print 'Querying servers, this may take some time...'
|
print 'Querying servers, this may take some time...'
|
||||||
|
Loading…
Reference in New Issue
Block a user