- remove url for patvh file.
authorRonan Le Martret <ronan@fridu.net>
Tue, 9 Apr 2013 08:38:03 +0000 (10:38 +0200)
committerRonan Le Martret <ronan@fridu.net>
Tue, 9 Apr 2013 08:38:03 +0000 (10:38 +0200)
Tizen_TZ_package/spec2yocto.py

index fd28e28..dd310e3 100755 (executable)
@@ -294,6 +294,26 @@ class specParser:
                             delete=False) as  tmpSpecFile:
                 tmpSpecFile.write(currentSpecString)
                 tmp_package_spec_path=tmpSpecFile.name
+                
+        patternUrlPatchFile = r'Patch[\d]*[\s]*:[\s]*([http,ftp].*/)(.*)'
+        
+        with open(tmp_package_spec_path,'r') as currentSpecFile:
+            currentSpecString=currentSpecFile.read()
+            
+            resUrlPatchFile=re.findall(patternUrlPatchFile,currentSpecString)
+            
+        if len(resUrlPatchFile)>0:
+            for r in resUrlPatchFile:
+                currentSpecString=currentSpecString.replace(r[0]+r[1],r[1])
+        
+            with tempfile.NamedTemporaryFile(mode='w',
+                            suffix='tmp',
+                            prefix=os.path.basename(tmp_package_spec_path),
+                            delete=False) as  tmpSpecFile:
+                tmpSpecFile.write(currentSpecString)
+                tmp_package_spec_path=tmpSpecFile.name
+                
+                
                  
         if pkgName in ["attr","acl"]:
             currentSpecString=currentSpecString.replace('make configure','%configure')