From 6b9bb998889e7451f54c1bb4db3fdc7003937ff1 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Mon, 26 Nov 2012 16:04:03 +0800 Subject: [PATCH] return filename directly if local repo specified Signed-off-by: Gui Chen --- mic/utils/rpmmisc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mic/utils/rpmmisc.py b/mic/utils/rpmmisc.py index 581fd2c..7cb1069 100644 --- a/mic/utils/rpmmisc.py +++ b/mic/utils/rpmmisc.py @@ -35,10 +35,9 @@ def myurlgrab(url, filename, proxies, progress_obj = None): progress_obj = TextProgress() if url.startswith("file:/"): - file = url.replace("file:", "") - if not os.path.exists(file): + filename = "/%s" % url.replace("file:", "").lstrip('/') + if not os.path.exists(filename): raise CreatorError("URLGrabber error: can't find file %s" % file) - runner.show(['cp', "-f", file, filename]) else: try: filename = g.urlgrab(url = url, filename = filename, -- 2.7.4