diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-06-06 19:12:07 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-06-06 19:12:07 +0200 |
commit | bf89c9121ff88ebfa57b997c247b2fd505dcb9ab (patch) | |
tree | 355841a4ffbfe18cd22205383e1d08e578b1d4e9 /cerbero | |
parent | a4055ecee7f3b7176f61de8d156724a0ba0718f1 (diff) |
tag: don't fail when a tag fails, show a warning instead
Diffstat (limited to 'cerbero')
-rw-r--r-- | cerbero/commands/tag.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/cerbero/commands/tag.py b/cerbero/commands/tag.py index cbe2918..5c241b7 100644 --- a/cerbero/commands/tag.py +++ b/cerbero/commands/tag.py @@ -53,26 +53,29 @@ class Tag(Command): tagdescription = args.tagdescription force = args.force for recipe in recipes: - if recipe.stype != SourceType.GIT and \ - recipe.stype != SourceType.GIT_TARBALL: - m.message(_("Recipe '%s' has a custom source repository, " - "skipping") % recipe.name) - continue + try: + if recipe.stype != SourceType.GIT and \ + recipe.stype != SourceType.GIT_TARBALL: + m.message(_("Recipe '%s' has a custom source repository, " + "skipping") % recipe.name) + continue - recipe.fetch(checkout=False) + recipe.fetch(checkout=False) - tags = git.list_tags(recipe.repo_dir) - exists = (tagname in tags) - if exists: - if not force: - m.warning(_("Recipe '%s' tag '%s' already exists, " - "not updating" % (recipe.name, tagname))) - continue - git.delete_tag(recipe.repo_dir, tagname) + tags = git.list_tags(recipe.repo_dir) + exists = (tagname in tags) + if exists: + if not force: + m.warning(_("Recipe '%s' tag '%s' already exists, " + "not updating" % (recipe.name, tagname))) + continue + git.delete_tag(recipe.repo_dir, tagname) - commit = 'origin/sdk-%s' % recipe.version - git.create_tag(recipe.repo_dir, tagname, tagdescription, - commit) + commit = 'origin/sdk-%s' % recipe.version + git.create_tag(recipe.repo_dir, tagname, tagdescription, + commit) + except: + m.warning(_("Error tagging recipe %s" % recipe.name)) register_command(Tag) |