mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-08 12:28:00 -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
|
||||
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...'
|
||||
|
Loading…
Reference in New Issue
Block a user