[TIC-CORE] support local repository
[archive/20170607/tools/tic-core.git] / tic / utils / grabber.py
index 037f95d..d0af5e8 100644 (file)
@@ -34,12 +34,11 @@ def myurlgrab2(url, filename):
     if url.startswith("file:/"):
         filepath = "/%s" % url.replace("file:", "").lstrip('/')
         if not os.path.exists(filepath):
-            logger.info('URLGrabber error: cannot find file %s'  % url)
-            raise TICError("URLGrabber error: can't find file %s" % url)
+            raise TICError(configmgr.message['repo_not_found'] % url)
         if url.endswith('.rpm'):
             return filepath
         else:
-            copyfile(filepath, filename)
+            copyfile(filepath, os.path.dirname(filename))
             logger.info('copy file ' + filepath)
     else:
         try: