/usr/bin/ubuntu-iso is in ubuntu-dev-tools 0.155.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #!/usr/bin/python
# ubuntuiso - tool to examine Ubuntu CD (ISO) installation media
# Copyright (C) 2008 Canonical Ltd.
# Author: Matt Zimmerman <mdz@ubuntu.com>
#
# ##################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# See file /usr/share/common-licenses/GPL-2 for more details.
#
# ##################################################################
import optparse
import sys
from ubuntutools import subprocess
def extract(iso, path):
command = ['isoinfo', '-R', '-i', iso, '-x', path]
pipe = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = pipe.communicate()
if pipe.returncode != 0:
sys.stderr.write(stderr)
sys.exit(pipe.returncode)
return stdout
def main():
desc = 'Given an ISO, %prog will display the Ubuntu version information'
parser = optparse.OptionParser(usage='%prog [options] iso...',
description=desc)
isos = parser.parse_args()[1]
err = False
for iso in isos:
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__':
main()
sys.exit(0)
|