From 6df3fbaf2976aa0882f9b19fab7246a1453c4f27 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Mon, 3 Dec 2012 15:54:27 +0800 Subject: [PATCH] fix local repo metadata override issue Signed-off-by: Gui Chen --- mic/utils/rpmmisc.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mic/utils/rpmmisc.py b/mic/utils/rpmmisc.py index d762061..c9c2ba7 100644 --- a/mic/utils/rpmmisc.py +++ b/mic/utils/rpmmisc.py @@ -35,9 +35,15 @@ def myurlgrab(url, filename, proxies, progress_obj = None): progress_obj = TextProgress() if url.startswith("file:/"): - filename = "/%s" % url.replace("file:", "").lstrip('/') - if not os.path.exists(filename): - raise CreatorError("URLGrabber error: can't find file %s" % file) + filepath = "/%s" % url.replace("file:", "").lstrip('/') + if not os.path.exists(filepath): + raise CreatorError("URLGrabber error: can't find file %s" % url) + if url.endswith('.rpm'): + return filepath + else: + # untouch repometadata in source path + runner.show(['cp', '-f', filepath, filename]) + else: try: filename = g.urlgrab(url = url, filename = filename, -- 2.7.4