X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=module-tools.py;h=6a2b77c70da57c6244d790009fe8ff935ece0438;hb=727b020549cc3fa5c997b56607249d03b55bdb59;hp=09c124abe551029412b73caf12f093a3acb55e80;hpb=7218d980cce4a39c2c1d12e6a6927f873244a851;p=build.git diff --git a/module-tools.py b/module-tools.py index 09c124ab..6a2b77c7 100755 --- a/module-tools.py +++ b/module-tools.py @@ -446,7 +446,7 @@ class Module: # for parsing module spec name:branch matcher_branch_spec=re.compile("\A(?P[\w\.-]+):(?P[\w\.-]+)\Z") # special form for tagged module - for Build - matcher_tag_spec=re.compile("\A(?P[\w-]+)@(?P[\w\.-]+)\Z") + matcher_tag_spec=re.compile("\A(?P[\w\.-]+)@(?P[\w\.-]+)\Z") # parsing specfiles matcher_rpm_define=re.compile("%(define|global)\s+(\S+)\s+(\S*)\s*") @@ -643,7 +643,6 @@ that for other purposes than tagging""" % options.workdir 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) @@ -1249,8 +1248,17 @@ def modules_diff(first, second): 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) @@ -1258,42 +1266,49 @@ def release_changelog(options, buildtag_old, buildtag_new, tagfile): 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() if m.repository.type == "svn": - print '* from', first, m.repository.url() + print ' * from', first, m.repository.url() else: - print '* from', first, m.repository.gitweb() + 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() if m.repository.type == "svn": - print '* to', second, m.repository.url() + print ' * to', second, m.repository.url() else: - print '* to', second, m.repository.gitweb() + print ' * to', second, m.repository.gitweb() print '{{{' os.system("diff -u %s %s" % (tmpfile, specfile))