From 749a1f76c902f4d595067310e27e3bd92d611757 Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Fri, 2 Jun 2006 14:00:58 +0000 Subject: [PATCH] - make 'resolved' more robust - add 'repourls' subcommand --- osc/commandline.py | 20 ++++++++++++++++++++ osc/core.py | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index b62d5a7b..fc8f901f 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -166,6 +166,25 @@ def diff(args): +def repourls(args): + """repourls: shows URLs on which to access the .repos files + +usage: 1. repourls + 2. repourls [dir1] [dir2] ... + + """ + + args = parseargs(args) + pacs = findpacs(args) + + url_tmpl = 'http://software.opensuse.org/download/%s/%s/%s.repo' + for p in pacs: + platforms = get_platforms_of_project(p.prjname) + for platform in platforms: + print url_tmpl % (p.prjname.replace(':', ':/'), platform, p.prjname) + + + def checkout(args): """checkout (co): Check out content from the server. @@ -591,6 +610,7 @@ cmd_dict = { 'meta': meta, 'platforms': platforms, 'delete': delete, + 'repourls': repourls, 'resolved': resolved, 'results': results, 'results_meta': results_meta, diff --git a/osc/core.py b/osc/core.py index 49a5d7bb..71dd7f13 100755 --- a/osc/core.py +++ b/osc/core.py @@ -179,7 +179,8 @@ class Package: myfilename = os.path.join(self.dir, n + '.mine') upfilename = os.path.join(self.dir, n + '.r' + self.rev) - os.unlink(myfilename) + try: os.unlink(myfilename) + except: pass os.rename(upfilename, storefilename) self.in_conflict.remove(n)