Merge lp:~ara/ubuntu-qa-tools/fix_dl_ubuntu_test_iso into lp:ubuntu-qa-tools

Proposed by Ara Pulido
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ara/ubuntu-qa-tools/fix_dl_ubuntu_test_iso
Merge into: lp:ubuntu-qa-tools
Diff against target: 192 lines (+87/-18)
3 files modified
dl-ubuntu-test-iso/dl-ubuntu-test-iso (+8/-9)
doc/dl-ubuntu-test-iso.1 (+75/-2)
examples/dl-ubuntu-test-iso.sample-cfg (+4/-7)
To merge this branch: bzr merge lp:~ara/ubuntu-qa-tools/fix_dl_ubuntu_test_iso
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Review via email: mp+23313@code.launchpad.net

Description of the change

Steve,

Some of your changes didn't work for me. I have made some changes to it. Can you review them ASAP, please?

 * BASEURL was not working, as it includes rsync://, but, as it is not used anymore, it is ignored now.
 * USERNAME/PASSWORD were interfering with USERNAME shell variable, and, therefore, always failing. Changed those to DLUSERNAME/DLPASSWORD
 * The man page needed an update

To post a comment you must log in.
Revision history for this message
Steve Beattie (sbeattie) wrote :

Thanks, Ara, merged. I did modify it slightly to warn when BASEURL is specified, so that people setting it would know that it's not going to be honored.

Revision history for this message
Steve Beattie (sbeattie) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dl-ubuntu-test-iso/dl-ubuntu-test-iso'
--- dl-ubuntu-test-iso/dl-ubuntu-test-iso 2010-04-13 06:08:12 +0000
+++ dl-ubuntu-test-iso/dl-ubuntu-test-iso 2010-04-13 12:40:36 +0000
@@ -456,14 +456,13 @@
456 return None456 return None
457457
458 shell_vars = ['ISOROOT', 'RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE',458 shell_vars = ['ISOROOT', 'RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE',
459 'OPTS', 'QUIET', 'NO_ACT', 'VERIFY', 'BUILD', 'BASEURL',459 'OPTS', 'QUIET', 'NO_ACT', 'VERIFY', 'BUILD','ARCHS',
460 'ARCHS', 'USERNAME', 'PASSWORD', 'HOST']460 'DLUSERNAME', 'DLPASSWORD', 'HOST']
461 command = ". %s; " %(pathname)461 command = ". %s; " %(pathname)
462 for var in shell_vars:462 for var in shell_vars:
463 command += 'if [ ! -z "$%s" ] ; then echo %s=$%s; fi ; ' %(var, var, var)463 command += 'if [ ! -z "$%s" ] ; then echo %s=$%s; fi ; ' %(var, var, var)
464 p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)464 p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
465 out, err = p.communicate()465 out, err = p.communicate()
466
467 config = dict()466 config = dict()
468 for line in re.split('\n', out):467 for line in re.split('\n', out):
469 l = re.split('=', line)468 l = re.split('=', line)
@@ -472,11 +471,11 @@
472 if l[0] in ['RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE']:471 if l[0] in ['RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE']:
473 l[1] = l[1].lower()472 l[1] = l[1].lower()
474 config[str.lower(l[0])] = re.split(' ', l[1])473 config[str.lower(l[0])] = re.split(' ', l[1])
475 elif l[0] in ['BASEURL', 'HOST']:474 elif l[0] in ['HOST']:
476 # XXX convert rsync:// to host
477 config['host'] = l[1]475 config['host'] = l[1]
478 else:476 else:
479 config[str.lower(l[0])] = l[1]477 config[str.lower(l[0])] = l[1]
478
480 return config479 return config
481480
482def merge_config(cval, file, default, value):481def merge_config(cval, file, default, value):
@@ -575,11 +574,11 @@
575 if config.host == default['host'] and file_cfg != None and 'host' in file_cfg.keys():574 if config.host == default['host'] and file_cfg != None and 'host' in file_cfg.keys():
576 config.host = file_cfg['host']575 config.host = file_cfg['host']
577576
578 if not config.username and file_cfg != None and 'username' in file_cfg.keys():577 if not config.username and file_cfg != None and 'dlusername' in file_cfg.keys():
579 config.username = file_cfg['username']578 config.username = file_cfg['dlusername']
580579
581 if not config.password and file_cfg != None and 'password' in file_cfg.keys():580 if not config.password and file_cfg != None and 'dlpassword' in file_cfg.keys():
582 config.password = file_cfg['password']581 config.password = file_cfg['dlpassword']
583582
584 if (config.username or config.password):583 if (config.username or config.password):
585 if (config.username and config.password):584 if (config.username and config.password):
586585
=== modified file 'doc/dl-ubuntu-test-iso.1'
--- doc/dl-ubuntu-test-iso.1 2009-01-29 10:54:38 +0000
+++ doc/dl-ubuntu-test-iso.1 2010-04-13 12:40:36 +0000
@@ -20,7 +20,6 @@
2020
21You can put a configuration file (~/.dl\-ubuntu\-test\-iso) and set some variables21You can put a configuration file (~/.dl\-ubuntu\-test\-iso) and set some variables
22to limit what will be downloaded.22to limit what will be downloaded.
23See sample values below.
2423
25 * ARCHS: what architectures to download24 * ARCHS: what architectures to download
26 * FLAVORS: what flavors of Ubuntu? Ubuntu itself, Kubuntu, etc25 * FLAVORS: what flavors of Ubuntu? Ubuntu itself, Kubuntu, etc
@@ -30,6 +29,9 @@
3029
31You can get sample configuration files at /usr/share/doc/ubuntu\-qa\-tools/examples/30You can get sample configuration files at /usr/share/doc/ubuntu\-qa\-tools/examples/
3231
32The script should honor http_proxy settings, with the exception of
33rsync if the rsync mechanism is used.
34
33.SH OPTIONS35.SH OPTIONS
34Listed below are the command line options for \fBdl\-ubuntu\-test\-iso\fR:36Listed below are the command line options for \fBdl\-ubuntu\-test\-iso\fR:
35.TP37.TP
@@ -63,6 +65,77 @@
63Only download a specific release target of Ubuntu. Only the last65Only download a specific release target of Ubuntu. Only the last
64\-\-release option applies. (You can also set RELEASES in the66\-\-release option applies. (You can also set RELEASES in the
65configuration file.) "hardy" is the earliest release target67configuration file.) "hardy" is the earliest release target
68.TP
69.B \-\-variant variant
70Only download a specific variant of Ubuntu (e.g. dekstop,
71alternate, server, dvd). The \-\-variant option can be given
72multiple times to specify than one variant.
73.TP
74.B \-\-arch arch
75Only download a specific architecture of Ubuntu (e.g. i386,
76amd64). The \-\-arch option can be given multiple times to request
77more than one arch.
78.TP
79.B \-\-bwlimit=KBPS
80This option allows you to specify a maximum transfer rate in
81kilobytes per second; equivalent to adding the same argument to
82the OPTS variable to be passed on to rsync(1). Note that zsync
83does not support bandwidth limiting.
84.TP
85.B \-\-no-verify
86This option tells the script to skip the hash comparison check
87against the MD5SUMS file that is normally done by default.
88.TP
89.B \-\-no-zsync
90By default, the script will attempt to use zsync if it is
91available as it uses fewer resources on the cdimage server.
92However, because it does not do rate-limiting and has other
93limitations, using only rsync may be preferred.
94.TP
95.B \-\-isoroot directory
96The local path underneath which the downloaded isos should be
97stored. The default is ${HOME}/iso.
98.TP
99.B \-\-config config
100Specify an alternate location for the config file; the default
101is ${HOME}/.dl-ubuntu-test-iso.
102.TP
103.B \-\-host hostname
104The mirror to pull the cdimages from. The default is
105cdimages.ubuntu.com.
106.TP
107.B \-\-user username
108If http_auth is used on the cdimage server, specify the username
109with the \-\-user argument. You can also set USERNAME in the
110config file.
111.TP
112.B \-\-pass password
113If http_auth is used on the cdimage server, specify the password
114with the \-\-pass argument. You can also set PASSWORD in the
115config file; note however that zsync does not support reading
116from a configuration file and thus any specified password will
117appear on zsync's command line and be visible in process
118listings.
119.TP
120.B \-\-mirror
121If set, the script will attempt to mimic the layout of the
122cdimage server. This is useful for republishing the isos in an
123alternate mirror.
124.TP
125.B \-\-no-release-check
126By default, the script will query launchpad.net to see if the
127development version of ubuntu has changed (e.g. lucid ->
128maverick) and attempt to take the change into account. Adding
129this argument disables the check.
130.TP
131.B \-\-build builddate
132Tell the script to downoad a specific build date rather than the
133current iso; default is "current"
134.TP
135.B \-\-versions
136Report the version information contained within all of the isos
137in the ${HOME}/iso/ subdirectories, including the build number.
138(requires the isoinfo binary to be installed)
66139
67.SH AUTHORS140.SH AUTHORS
68\fBdl\-ubuntu\-test\-iso\fR was written by Dave Morlay <davmor2@ubuntu.com>,141\fBdl\-ubuntu\-test\-iso\fR was written by Dave Morlay <davmor2@ubuntu.com>,
@@ -72,4 +145,4 @@
72This is released under the terms of the GNU General Public License, version 3.145This is released under the terms of the GNU General Public License, version 3.
73146
74.SH SEE ALSO 147.SH SEE ALSO
75.B rsync(1)148.B rsync(1), zsync(1)
76149
=== modified file 'examples/dl-ubuntu-test-iso.sample-cfg'
--- examples/dl-ubuntu-test-iso.sample-cfg 2010-04-13 06:47:11 +0000
+++ examples/dl-ubuntu-test-iso.sample-cfg 2010-04-13 12:40:36 +0000
@@ -1,9 +1,6 @@
1# Sample .dl-ubuntu-test-iso.cfg file. The included settings are the1# Sample .dl-ubuntu-test-iso.cfg file. The included settings are the
2# default for the script2# default for the script
3#3#
4# BASEURL The server from which to download. This is the cdimage
5# server that Canonical operates for Ubuntu development.
6BASEURL="rsync://cdimage.ubuntu.com/cdimage"
74
8# RELEASES5# RELEASES
9# Which releases of Ubuntu to target. Hardy and Lucid are the6# Which releases of Ubuntu to target. Hardy and Lucid are the
@@ -61,17 +58,17 @@
61# default58# default
62HOST="cdimages.ubuntu.com"59HOST="cdimages.ubuntu.com"
6360
64# USERNAME61# DLUSERNAME
65# If http_auth is used on the cdimage server, specify the username62# If http_auth is used on the cdimage server, specify the username
66#63#
67# Example64# Example
68# USERNAME="ubuntu"65# DLUSERNAME="ubuntu"
6966
70# PASSWORD67# DLPASSWORD
71# If http_auth is used on the cdimage server, specify the68# If http_auth is used on the cdimage server, specify the
72# password. Note that zsync does not support a configuration file,69# password. Note that zsync does not support a configuration file,
73# and so the script must pass this password on the command line,70# and so the script must pass this password on the command line,
74# exposing it to anything that views process listings.71# exposing it to anything that views process listings.
75#72#
76# Example73# Example
77# PASSWORD="ubuntu"74# DLPASSWORD="ubuntu"