- def do_changelog (buildtag_new,buildtag_old,options):
- print "----"
- print "----"
- print "----"
- (build_new,build_old) = (Build (buildtag_new,options), Build (buildtag_old,options))
- print "= build tag %s to %s = #build-%s"%(build_old.display,build_new.display,build_new.display)
- for b in (build_new,build_old):
- b.init_module_dir()
- b.init_edge_dir()
- b.update_edge_dir()
- # find out the tags files that are common, unless option was specified
- if options.distrotags:
- distrotags=options.distrotags
- else:
- distrotags_new=build_new.get_distrotags()
- distrotags_old=build_old.get_distrotags()
- distrotags = list(set(distrotags_new).intersection(set(distrotags_old)))
- distrotags.sort()
- if options.verbose: print "Found distrotags",distrotags
- first_distrotag=True
- diffcache = DiffCache()
- for distrotag in distrotags:
- distro=Build.get_distro_from_distrotag(distrotag)
- if not distro:
- continue
- if first_distrotag:
- first_distrotag=False
- else:
- print '----'
- print '== distro %s (%s to %s) == #distro-%s-%s'%(distrotag,build_old.display,build_new.display,distro,build_new.display)
- print ' * from %s/%s'%(build_old.svnpath,distrotag)
- print ' * to %s/%s'%(build_new.svnpath,distrotag)
-
- # parse make packages
- packages_new=build_new.get_packages(distrotag)
- pnames_new=set(packages_new.keys())
- packages_old=build_old.get_packages(distrotag)
- pnames_old=set(packages_old.keys())
-
- # get names of created, deprecated, and preserved modules
- pnames_created = list(pnames_new-pnames_old)
- pnames_deprecated = list(pnames_old-pnames_new)
- pnames = list(pnames_new.intersection(pnames_old))
-
- pnames_created.sort()
- pnames_deprecated.sort()
- pnames.sort()
-
- if options.verbose:
- print '--------------------'
- print 'got packages for ',build_new.display
- print pnames_new
- print '--------------------'
- print 'got packages for ',build_old.display
- print pnames_old
- print '--------------------'
- print "Found new modules",pnames_created
- print '--------------------'
- print "Found deprecated modules",pnames_deprecated
- print '--------------------'
- print "Found preserved modules",pnames
- print '--------------------'
-
- # display created and deprecated
- for name in pnames_created:
- print '=== %s : new package %s -- appeared in %s === #package-%s-%s-%s'%(
- distrotag,name,build_new.display,name,distro,build_new.display)
- pobj=packages_new[name]
- print ' * %s'%pobj.details()
- for name in pnames_deprecated:
- print '=== %s : package %s -- deprecated, last occurrence in %s === #package-%s-%s-%s'%(
- distrotag,name,build_old.display,name,distro,build_new.display)
- pobj=packages_old[name]
- if not pobj.svnpath:
- print ' * codebase stored in CVS, specfile is %s'%pobj.spec
- else:
- print ' * %s'%pobj.details()
-
- # display other packages
- for name in pnames:
- (pobj_new,pobj_old)=(packages_new[name],packages_old[name])
- if options.verbose: print "Dealing with package",name
- if pobj_old.specpath == pobj_new.specpath:
- continue
- specdiff = diffcache.fetch(pobj_old.specpath,pobj_new.specpath)
- if specdiff is None:
- command="svn diff %s %s"%(pobj_old.specpath,pobj_new.specpath)
- specdiff=Command(command,options).output_of()
- diffcache.store(pobj_old.specpath,pobj_new.specpath,specdiff)
- else:
- if options.verbose: print 'got diff from cache'
- if not specdiff:
- continue
- print '=== %s - %s to %s : package %s === #package-%s-%s-%s'%(
- distrotag,build_old.display,build_new.display,name,name,distro,build_new.display)
- print ' * from %s to %s'%(pobj_old.details(),pobj_new.details())
- if options.inline_diff:
- pobj_old.inline_full_diff(pobj_new)
- else:
- trac_diff_url=pobj_old.trac_full_diff(pobj_new)
- if trac_diff_url:
- print ' * [%s View full diff]'%trac_diff_url
- else:
- print ' * No full diff available'
- print '{{{'
- for line in specdiff.split('\n'):
- if not line:
- continue
- if Release.discard_matcher.match(line):
- continue
- if line[0] in ['@']:
- print '----------'
- elif line[0] in ['+','-']:
- print_fold(line)
- print '}}}'
+ def html_dump_header(title):
+ nowdate=time.strftime("%Y-%m-%d")
+ nowtime=time.strftime("%H:%M (%Z)")
+ print """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title> %s </title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+body { font-family:georgia, serif; }
+h1 {font-size: large; }
+p.title {font-size: x-large; }
+span.error {text-weight:bold; color: red; }
+</style>
+</head>
+<body>
+<p class='title'> %s - status on %s at %s</p>
+<ul>
+"""%(title,title,nowdate,nowtime)
+
+ @staticmethod
+ def html_dump_middle():
+ print "</ul>"
+
+ @staticmethod
+ def html_dump_footer():
+ print "</body></html"
+
+ def html_dump_toc(self):
+ if hasattr(self,'titles'):
+ for title in self.titles:
+ print '<li>',self.html_href ('#'+self.friendly_name(),title),'</li>'
+
+ def html_dump_body(self):
+ if hasattr(self,'titles'):
+ for title in self.titles:
+ print '<hr /><h1>',self.html_anchor(self.friendly_name(),title),'</h1>'
+ if hasattr(self,'body'):
+ print self.body
+ print '<p class="top">',self.html_href('#','Back to top'),'</p>'
+