summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create_buildsys.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/recipetool/create_buildsys.py')
-rw-r--r--scripts/lib/recipetool/create_buildsys.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index e08ad277d7..f784f9468a 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -173,7 +173,7 @@ class CmakeRecipeHandler(RecipeHandler):
173 def parse_cmake_file(fn, paths=None): 173 def parse_cmake_file(fn, paths=None):
174 searchpaths = (paths or []) + [os.path.dirname(fn)] 174 searchpaths = (paths or []) + [os.path.dirname(fn)]
175 logger.debug('Parsing file %s' % fn) 175 logger.debug('Parsing file %s' % fn)
176 with open(fn, 'r') as f: 176 with open(fn, 'r', errors='surrogateescape') as f:
177 for line in f: 177 for line in f:
178 line = line.strip() 178 line = line.strip()
179 for handler in handlers: 179 for handler in handlers:
@@ -354,7 +354,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
354 conffile = RecipeHandler.checkfiles(srctree, ['configure']) 354 conffile = RecipeHandler.checkfiles(srctree, ['configure'])
355 if conffile: 355 if conffile:
356 # Check if this is just a pre-generated autoconf configure script 356 # Check if this is just a pre-generated autoconf configure script
357 with open(conffile[0], 'r') as f: 357 with open(conffile[0], 'r', errors='surrogateescape') as f:
358 for i in range(1, 10): 358 for i in range(1, 10):
359 if 'Generated by GNU Autoconf' in f.readline(): 359 if 'Generated by GNU Autoconf' in f.readline():
360 autoconf = True 360 autoconf = True
@@ -364,7 +364,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
364 # Last resort 364 # Last resort
365 conffile = RecipeHandler.checkfiles(srctree, ['configure']) 365 conffile = RecipeHandler.checkfiles(srctree, ['configure'])
366 if conffile: 366 if conffile:
367 with open(conffile[0], 'r') as f: 367 with open(conffile[0], 'r', errors='surrogateescape') as f:
368 for line in f: 368 for line in f:
369 line = line.strip() 369 line = line.strip()
370 if line.startswith('VERSION=') or line.startswith('PACKAGE_VERSION='): 370 if line.startswith('VERSION=') or line.startswith('PACKAGE_VERSION='):
@@ -654,7 +654,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
654 nesting = 0 654 nesting = 0
655 in_keyword = '' 655 in_keyword = ''
656 partial = '' 656 partial = ''
657 with open(srcfile, 'r') as f: 657 with open(srcfile, 'r', errors='surrogateescape') as f:
658 for line in f: 658 for line in f:
659 if in_keyword: 659 if in_keyword:
660 partial += ' ' + line.strip() 660 partial += ' ' + line.strip()
@@ -780,7 +780,7 @@ class MakefileRecipeHandler(RecipeHandler):
780 if installtarget: 780 if installtarget:
781 func.append('# This is a guess; additional arguments may be required') 781 func.append('# This is a guess; additional arguments may be required')
782 makeargs = '' 782 makeargs = ''
783 with open(makefile[0], 'r') as f: 783 with open(makefile[0], 'r', errors='surrogateescape') as f:
784 for i in range(1, 100): 784 for i in range(1, 100):
785 if 'DESTDIR' in f.readline(): 785 if 'DESTDIR' in f.readline():
786 makeargs += " 'DESTDIR=${D}'" 786 makeargs += " 'DESTDIR=${D}'"
@@ -809,7 +809,7 @@ class VersionFileRecipeHandler(RecipeHandler):
809 version = None 809 version = None
810 for fileitem in filelist: 810 for fileitem in filelist:
811 linecount = 0 811 linecount = 0
812 with open(fileitem, 'r') as f: 812 with open(fileitem, 'r', errors='surrogateescape') as f:
813 for line in f: 813 for line in f:
814 line = line.rstrip().strip('"\'') 814 line = line.rstrip().strip('"\'')
815 linecount += 1 815 linecount += 1
@@ -838,7 +838,7 @@ class SpecFileRecipeHandler(RecipeHandler):
838 foundvalues = {} 838 foundvalues = {}
839 for fileitem in filelist: 839 for fileitem in filelist:
840 linecount = 0 840 linecount = 0
841 with open(fileitem, 'r') as f: 841 with open(fileitem, 'r', errors='surrogateescape') as f:
842 for line in f: 842 for line in f:
843 for value, varname in valuemap.items(): 843 for value, varname in valuemap.items():
844 if line.startswith(value + ':') and not varname in foundvalues: 844 if line.startswith(value + ':') and not varname in foundvalues: