Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Website scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gruppo Web
Website scripts
Commits
60a3ef8d
Commit
60a3ef8d
authored
Apr 21, 2014
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for trusty italian release and verbose mode
parent
004aaf35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
md5s.py
md5s.py
+11
-1
No files found.
md5s.py
View file @
60a3ef8d
...
@@ -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
':
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment