mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-29 01:31:29 +00:00
Improve ubuntuiso to handle multiple images in a single invocation
This commit is contained in:
parent
d79713708c
commit
1335efde6f
22
ubuntu-iso
22
ubuntu-iso
@ -34,10 +34,26 @@ def extract(iso, path):
|
|||||||
return stdout
|
return stdout
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
iso = sys.argv[1]
|
isos = sys.argv[1:]
|
||||||
|
err = False
|
||||||
|
|
||||||
version = extract(iso, '/.disk/info')
|
for iso in isos:
|
||||||
print version
|
if len(isos) > 1:
|
||||||
|
prefix = '%s:' % iso
|
||||||
|
else:
|
||||||
|
prefix = ''
|
||||||
|
|
||||||
|
version = extract(iso, '/.disk/info')
|
||||||
|
|
||||||
|
if len(version) == 0:
|
||||||
|
print >>sys.stderr, '%s does not appear to be an Ubuntu ISO' % iso
|
||||||
|
err = True
|
||||||
|
continue
|
||||||
|
|
||||||
|
print prefix + version
|
||||||
|
|
||||||
|
if err:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user