# for parsing module spec name:branch
matcher_branch_spec=re.compile("\A(?P<name>[\w\.-]+):(?P<branch>[\w\.-]+)\Z")
# special form for tagged module - for Build
- matcher_tag_spec=re.compile("\A(?P<name>[\w-]+)@(?P<tagname>[\w\.-]+)\Z")
+ matcher_tag_spec=re.compile("\A(?P<name>[\w\.-]+)@(?P<tagname>[\w\.-]+)\Z")
# parsing specfiles
matcher_rpm_define=re.compile("%(define|global)\s+(\S+)\s+(\S*)\s*")
elif self.repository.type == "git":
if hasattr(self,'branch'):
- print "to branch", self.branch
self.repository.to_branch(self.branch)
elif hasattr(self,'tagname'):
self.repository.to_tag(self.tagname)
return diff, new_modules, removed_modules
-def release_changelog(options, buildtag_old, buildtag_new, tagfile):
+def release_changelog(options, buildtag_old, buildtag_new):
+
+ tagfile = options.distrotags[0]
+ if not tagfile:
+ print "ERROR: provide a tagfile name (eg. onelab, onelab-k27, planetlab)"
+ return
+ tagfile = "%s-tags.mk" % tagfile
+ print '----'
+ print '----'
+ print '----'
print '= build tag %s to %s =' % (buildtag_old, buildtag_new)
print '== distro %s (%s to %s) ==' % (tagfile, buildtag_old, buildtag_new)
build.init_module_dir()
first = build.get_modules(tagfile)
- print '* from', buildtag_old, build.repository.gitweb()
+ print ' * from', buildtag_old, build.repository.gitweb()
build = Build("build@%s" % buildtag_new, options)
build.init_module_dir()
second = build.get_modules(tagfile)
- print '* to', buildtag_new, build.repository.gitweb()
+ print ' * to', buildtag_new, build.repository.gitweb()
diff, new_modules, removed_modules = modules_diff(first, second)
- for module in diff:
+ def get_module(name, tag):
+ if not tag or tag == "trunk":
+ return Module("%s" % (module), options)
+ else:
+ return Module("%s@%s" % (module, tag), options)
+
+
+ for module in diff:
print '=== %s - %s to %s : package %s ===' % (tagfile, buildtag_old, buildtag_new, module)
first, second = diff[module]
- m = Module("%s@%s" % (module, first), options)
- os.system('rm -rf %s' % m.module_dir)
+ m = get_module(module, first)
+ os.system('rm -rf %s' % m.module_dir) # cleanup module dir
m.init_module_dir()
- print '* from', first, m.repository.gitweb()
+ if m.repository.type == "svn":
+ print ' * from', first, m.repository.url()
+ else:
+ print ' * from', first, m.repository.gitweb()
specfile = m.main_specname()
(tmpfd, tmpfile) = tempfile.mkstemp()
os.system("cp -f /%s %s" % (specfile, tmpfile))
- m = Module("%s@%s" % (module, second), options)
+ m = get_module(module, second)
m.init_module_dir()
specfile = m.main_specname()
- print '* to', second, m.repository.gitweb()
+ if m.repository.type == "svn":
+ print ' * to', second, m.repository.url()
+ else:
+ print ' * to', second, m.repository.gitweb()
print '{{{'
os.system("diff -u %s %s" % (tmpfile, specfile))