- add ftp support for source.
authorRonan Le Martret <ronan@fridu.net>
Tue, 2 Apr 2013 15:04:16 +0000 (17:04 +0200)
committerRonan Le Martret <ronan@fridu.net>
Tue, 2 Apr 2013 15:04:16 +0000 (17:04 +0200)
Tizen_TZ_package/spec2yocto.py

index dab1abf..053ff96 100755 (executable)
@@ -260,13 +260,13 @@ class specParser:
         if pkgName in [ "glibc"]:
             command += " --define='_sbindir /usr/sbin'"
             
-        if pkgName in ["libelf0","freetype2","help2man","acl","libcap","popt","pcre","which"]:
+        if pkgName in ["libelf0","freetype2","help2man","acl","libcap","popt","pcre","which","findutils","pkgconfig"]:
             oe_runconf2='''oe_runconf2'''
             
             command += " --define='%%_configure %s'" % oe_runconf2
 
 
-        patternUrlSourceFile = r'Source[\d]*[\s]*:[\s]*(http.*/)(.*)'
+        patternUrlSourceFile = r'Source[\d]*[\s]*:[\s]*([http,ftp].*/)(.*)'
         
         with open(tmp_package_spec_path,'r') as currentSpecFile:
             currentSpecString=currentSpecFile.read()
@@ -351,7 +351,7 @@ class specParser:
                 command += " --define='%s #%s' " % (p,p)
                     
         command += " --parse %s " % tmp_package_spec_path
-        #print "command :",command        
+       print "command :",command        
                 
         if not os.path.isdir(os.path.join("/tmp","parsed_spec")):
             os.mkdir(os.path.join("/tmp","parsed_spec"))
@@ -493,6 +493,9 @@ class specParser:
                         
                     filesName=patternPatchDico[id]
                     
+                    if "-p" not in command:
+                       command+=" -p0"
+                    
                     if filesName.endswith(".bz2"):
                         res+="bzcat ${S}/packaging/%s | patch %s --fuzz=2\n" %  (filesName,command.replace("-b","-b --suffix") )
                     else: