104
def process(suite, components, arch):
109
def process(options, arch):
110
suite = options.suite
111
components = options.component.split(',')
105
113
archive = os.path.expanduser('~/mirror/ubuntu/')
107
115
if suite in ("warty", "hoary"):
197
205
for pkg in changed[oldprio][newprio]:
198
206
print("%s" % pkg)
208
if options.html_output is not None:
209
print("<h3>%s</h3>" % escape(header), file=options.html_output)
210
print("<ul>", file=options.html_output)
211
for pkg in changed[oldprio][newprio]:
213
"<li>%s</li>" % escape(pkg), file=options.html_output)
214
print("</ul>", file=options.html_output)
205
220
parser.add_option(
206
221
"-l", "--launchpad", dest="launchpad_instance", default="production")
207
222
parser.add_option('-o', '--output-file', help='output to this file')
223
parser.add_option('--html-output-file', help='output HTML to this file')
208
224
parser.add_option('-a', '--architecture',
209
225
help='look at germinate output for this architecture')
210
226
parser.add_option('-c', '--component',
221
237
if options.output_file is not None:
222
238
sys.stdout = open('%s.new' % options.output_file, 'w')
239
if options.html_output_file is not None:
240
options.html_output = open('%s.new' % options.html_output_file, 'w')
242
options.html_output = None
224
print('Generated: %s' % time.strftime('%a %b %e %H:%M:%S %Z %Y'))
244
options.timestamp = time.strftime('%a %b %e %H:%M:%S %Z %Y')
245
print('Generated: %s' % options.timestamp)
248
if options.html_output is not None:
250
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
251
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
252
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
254
<meta http-equiv="Content-Type"
255
content="text/html; charset=utf-8" />
256
<title>Priority mismatches for %s</title>
257
<style type="text/css">
258
body { background: #CCCCB0; color: black; }
262
<h1>Priority mismatches for %s</h1>
263
""") % (escape(options.suite), escape(options.suite)),
264
file=options.html_output)
227
266
if options.architecture is None:
228
267
for arch in ('amd64', 'arm64', 'armhf', 'i386', 'powerpc', 'ppc64el'):
230
269
print('=' * len(arch))
232
process(options.suite, options.component.split(','), arch)
271
if options.html_output is not None:
272
print("<h2>%s</h2>" % escape(arch), file=options.html_output)
273
process(options, arch)
234
process(options.suite, options.component.split(','),
235
options.architecture)
275
process(options, options.architecture)
277
if options.html_output_file is not None:
279
"<p><small>Generated: %s</small></p>" % escape(options.timestamp),
280
file=options.html_output)
281
print("</body></html>", file=options.html_output)
282
options.html_output.close()
284
'%s.new' % options.html_output_file, options.html_output_file)
237
285
if options.output_file is not None:
238
286
sys.stdout.close()
239
287
os.rename('%s.new' % options.output_file, options.output_file)