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
1=== modified file 'dl-ubuntu-test-iso/dl-ubuntu-test-iso'
2--- dl-ubuntu-test-iso/dl-ubuntu-test-iso 2010-04-13 06:08:12 +0000
3+++ dl-ubuntu-test-iso/dl-ubuntu-test-iso 2010-04-13 12:40:36 +0000
4@@ -456,14 +456,13 @@
5 return None
6
7 shell_vars = ['ISOROOT', 'RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE',
8- 'OPTS', 'QUIET', 'NO_ACT', 'VERIFY', 'BUILD', 'BASEURL',
9- 'ARCHS', 'USERNAME', 'PASSWORD', 'HOST']
10+ 'OPTS', 'QUIET', 'NO_ACT', 'VERIFY', 'BUILD','ARCHS',
11+ 'DLUSERNAME', 'DLPASSWORD', 'HOST']
12 command = ". %s; " %(pathname)
13 for var in shell_vars:
14 command += 'if [ ! -z "$%s" ] ; then echo %s=$%s; fi ; ' %(var, var, var)
15 p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
16 out, err = p.communicate()
17-
18 config = dict()
19 for line in re.split('\n', out):
20 l = re.split('=', line)
21@@ -472,11 +471,11 @@
22 if l[0] in ['RELEASES', 'FLAVORS', 'VARIANTS', 'EXCLUDE']:
23 l[1] = l[1].lower()
24 config[str.lower(l[0])] = re.split(' ', l[1])
25- elif l[0] in ['BASEURL', 'HOST']:
26- # XXX convert rsync:// to host
27+ elif l[0] in ['HOST']:
28 config['host'] = l[1]
29 else:
30 config[str.lower(l[0])] = l[1]
31+
32 return config
33
34 def merge_config(cval, file, default, value):
35@@ -575,11 +574,11 @@
36 if config.host == default['host'] and file_cfg != None and 'host' in file_cfg.keys():
37 config.host = file_cfg['host']
38
39- if not config.username and file_cfg != None and 'username' in file_cfg.keys():
40- config.username = file_cfg['username']
41+ if not config.username and file_cfg != None and 'dlusername' in file_cfg.keys():
42+ config.username = file_cfg['dlusername']
43
44- if not config.password and file_cfg != None and 'password' in file_cfg.keys():
45- config.password = file_cfg['password']
46+ if not config.password and file_cfg != None and 'dlpassword' in file_cfg.keys():
47+ config.password = file_cfg['dlpassword']
48
49 if (config.username or config.password):
50 if (config.username and config.password):
51
52=== modified file 'doc/dl-ubuntu-test-iso.1'
53--- doc/dl-ubuntu-test-iso.1 2009-01-29 10:54:38 +0000
54+++ doc/dl-ubuntu-test-iso.1 2010-04-13 12:40:36 +0000
55@@ -20,7 +20,6 @@
56
57 You can put a configuration file (~/.dl\-ubuntu\-test\-iso) and set some variables
58 to limit what will be downloaded.
59-See sample values below.
60
61 * ARCHS: what architectures to download
62 * FLAVORS: what flavors of Ubuntu? Ubuntu itself, Kubuntu, etc
63@@ -30,6 +29,9 @@
64
65 You can get sample configuration files at /usr/share/doc/ubuntu\-qa\-tools/examples/
66
67+The script should honor http_proxy settings, with the exception of
68+rsync if the rsync mechanism is used.
69+
70 .SH OPTIONS
71 Listed below are the command line options for \fBdl\-ubuntu\-test\-iso\fR:
72 .TP
73@@ -63,6 +65,77 @@
74 Only download a specific release target of Ubuntu. Only the last
75 \-\-release option applies. (You can also set RELEASES in the
76 configuration file.) "hardy" is the earliest release target
77+.TP
78+.B \-\-variant variant
79+Only download a specific variant of Ubuntu (e.g. dekstop,
80+alternate, server, dvd). The \-\-variant option can be given
81+multiple times to specify than one variant.
82+.TP
83+.B \-\-arch arch
84+Only download a specific architecture of Ubuntu (e.g. i386,
85+amd64). The \-\-arch option can be given multiple times to request
86+more than one arch.
87+.TP
88+.B \-\-bwlimit=KBPS
89+This option allows you to specify a maximum transfer rate in
90+kilobytes per second; equivalent to adding the same argument to
91+the OPTS variable to be passed on to rsync(1). Note that zsync
92+does not support bandwidth limiting.
93+.TP
94+.B \-\-no-verify
95+This option tells the script to skip the hash comparison check
96+against the MD5SUMS file that is normally done by default.
97+.TP
98+.B \-\-no-zsync
99+By default, the script will attempt to use zsync if it is
100+available as it uses fewer resources on the cdimage server.
101+However, because it does not do rate-limiting and has other
102+limitations, using only rsync may be preferred.
103+.TP
104+.B \-\-isoroot directory
105+The local path underneath which the downloaded isos should be
106+stored. The default is ${HOME}/iso.
107+.TP
108+.B \-\-config config
109+Specify an alternate location for the config file; the default
110+is ${HOME}/.dl-ubuntu-test-iso.
111+.TP
112+.B \-\-host hostname
113+The mirror to pull the cdimages from. The default is
114+cdimages.ubuntu.com.
115+.TP
116+.B \-\-user username
117+If http_auth is used on the cdimage server, specify the username
118+with the \-\-user argument. You can also set USERNAME in the
119+config file.
120+.TP
121+.B \-\-pass password
122+If http_auth is used on the cdimage server, specify the password
123+with the \-\-pass argument. You can also set PASSWORD in the
124+config file; note however that zsync does not support reading
125+from a configuration file and thus any specified password will
126+appear on zsync's command line and be visible in process
127+listings.
128+.TP
129+.B \-\-mirror
130+If set, the script will attempt to mimic the layout of the
131+cdimage server. This is useful for republishing the isos in an
132+alternate mirror.
133+.TP
134+.B \-\-no-release-check
135+By default, the script will query launchpad.net to see if the
136+development version of ubuntu has changed (e.g. lucid ->
137+maverick) and attempt to take the change into account. Adding
138+this argument disables the check.
139+.TP
140+.B \-\-build builddate
141+Tell the script to downoad a specific build date rather than the
142+current iso; default is "current"
143+.TP
144+.B \-\-versions
145+Report the version information contained within all of the isos
146+in the ${HOME}/iso/ subdirectories, including the build number.
147+(requires the isoinfo binary to be installed)
148
149 .SH AUTHORS
150 \fBdl\-ubuntu\-test\-iso\fR was written by Dave Morlay <davmor2@ubuntu.com>,
151@@ -72,4 +145,4 @@
152 This is released under the terms of the GNU General Public License, version 3.
153
154 .SH SEE ALSO
155-.B rsync(1)
156+.B rsync(1), zsync(1)
157
158=== modified file 'examples/dl-ubuntu-test-iso.sample-cfg'
159--- examples/dl-ubuntu-test-iso.sample-cfg 2010-04-13 06:47:11 +0000
160+++ examples/dl-ubuntu-test-iso.sample-cfg 2010-04-13 12:40:36 +0000
161@@ -1,9 +1,6 @@
162 # Sample .dl-ubuntu-test-iso.cfg file. The included settings are the
163 # default for the script
164 #
165-# BASEURL The server from which to download. This is the cdimage
166-# server that Canonical operates for Ubuntu development.
167-BASEURL="rsync://cdimage.ubuntu.com/cdimage"
168
169 # RELEASES
170 # Which releases of Ubuntu to target. Hardy and Lucid are the
171@@ -61,17 +58,17 @@
172 # default
173 HOST="cdimages.ubuntu.com"
174
175-# USERNAME
176+# DLUSERNAME
177 # If http_auth is used on the cdimage server, specify the username
178 #
179 # Example
180-# USERNAME="ubuntu"
181+# DLUSERNAME="ubuntu"
182
183-# PASSWORD
184+# DLPASSWORD
185 # If http_auth is used on the cdimage server, specify the
186 # password. Note that zsync does not support a configuration file,
187 # and so the script must pass this password on the command line,
188 # exposing it to anything that views process listings.
189 #
190 # Example
191-# PASSWORD="ubuntu"
192+# DLPASSWORD="ubuntu"