Commit 60a3ef8d authored by Pietro Albini's avatar Pietro Albini

Added support for trusty italian release and verbose mode

parent 004aaf35
...@@ -40,6 +40,8 @@ def get_base_md5_dict(releases, archs): ...@@ -40,6 +40,8 @@ def get_base_md5_dict(releases, archs):
return result return result
def official_md5_list(distro, version, releases, archs): def official_md5_list(distro, version, releases, archs):
if args.verbose:
print('Fetching "http://releases.ubuntu.com/'+version+'/MD5SUMS"...')
web = urllib.request.urlopen('http://releases.ubuntu.com/'+version+'/MD5SUMS') web = urllib.request.urlopen('http://releases.ubuntu.com/'+version+'/MD5SUMS')
lines = web.read().decode('utf-8').split('\n') lines = web.read().decode('utf-8').split('\n')
md5s = get_base_md5_dict(releases, archs) md5s = get_base_md5_dict(releases, archs)
...@@ -53,6 +55,8 @@ def official_md5_list(distro, version, releases, archs): ...@@ -53,6 +55,8 @@ def official_md5_list(distro, version, releases, archs):
return md5s return md5s
def derivatives_md5_list(distro, version, releases, archs): def derivatives_md5_list(distro, version, releases, archs):
if args.verbose:
print('Fetching "http://cdimage.ubuntu.com/'+distro+'/releases/'+version+'/release/MD5SUMS"...')
web = urllib.request.urlopen('http://cdimage.ubuntu.com/'+distro+'/releases/'+version+'/release/MD5SUMS') web = urllib.request.urlopen('http://cdimage.ubuntu.com/'+distro+'/releases/'+version+'/release/MD5SUMS')
lines = web.read().decode('utf-8').split('\n') lines = web.read().decode('utf-8').split('\n')
md5s = get_base_md5_dict(releases, archs) md5s = get_base_md5_dict(releases, archs)
...@@ -69,7 +73,9 @@ def italian_md5_list(distro, version, releases, archs): ...@@ -69,7 +73,9 @@ def italian_md5_list(distro, version, releases, archs):
md5s = get_base_md5_dict(releases, archs) md5s = get_base_md5_dict(releases, archs)
for arch in archs: for arch in archs:
for release in releases: for release in releases:
web = urllib.request.urlopen('http://release.ubuntu-it.org/'+version+'-it-'+arch+'/'+version+'-'+release+'-'+arch+'.iso.md5') if args.verbose:
print('Fetching "http://release.ubuntu-it.org/'+version+'/'+arch+'/'+version+'-'+release+'-'+arch+'.iso.md5"...')
web = urllib.request.urlopen('http://release.ubuntu-it.org/'+version+'/'+arch+'/'+version+'-'+release+'-'+arch+'.iso.md5')
lines = web.read().decode('utf-8').split('\n') lines = web.read().decode('utf-8').split('\n')
for line in lines: for line in lines:
try: try:
...@@ -125,6 +131,7 @@ if __name__ == '__main__': ...@@ -125,6 +131,7 @@ if __name__ == '__main__':
parser.add_argument("--derivatives", help="Choose if include derivatives", action="store_true") parser.add_argument("--derivatives", help="Choose if include derivatives", action="store_true")
parser.add_argument("--two-lts", help="If latest is an lts", action="store_true", dest="two_lts") parser.add_argument("--two-lts", help="If latest is an lts", action="store_true", dest="two_lts")
parser.add_argument("--render-as", help="Set how render the result", default='php', choices=('php', 'moin')) parser.add_argument("--render-as", help="Set how render the result", default='php', choices=('php', 'moin'))
parser.add_argument("-v", "--verbose", help="Verbose mode", action="store_true", dest="verbose")
args = parser.parse_args() # Get arguments args = parser.parse_args() # Get arguments
# Get available versions # Get available versions
...@@ -144,6 +151,9 @@ if __name__ == '__main__': ...@@ -144,6 +151,9 @@ if __name__ == '__main__':
for which in DERIVATIVES: for which in DERIVATIVES:
total[which] = get(which, DERIVATIVES[which]) total[which] = get(which, DERIVATIVES[which])
if args.verbose:
print('---')
if args.render_as == 'php': if args.render_as == 'php':
render_php(total) render_php(total)
elif args.render_as == 'moin': elif args.render_as == 'moin':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment