From e530af5b63ece12a90e51ee818455351eef72a89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 3 Jan 2011 15:55:59 +0100 Subject: [PATCH] handle empty tagname --- module-tools.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/module-tools.py b/module-tools.py index 10ce4284..ec7e1be2 100755 --- a/module-tools.py +++ b/module-tools.py @@ -1268,13 +1268,21 @@ def release_changelog(options, buildtag_old, buildtag_new, tagfile): diff, new_modules, removed_modules = modules_diff(first, second) - for module in diff: + def get_module(name, tag): + print 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": @@ -1286,7 +1294,7 @@ def release_changelog(options, buildtag_old, buildtag_new, tagfile): (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() -- 2.47.0