]> git.pld-linux.org Git - packages/framewave.git/blob - framewave-python-update.patch
- updated patches set for python 3/scons 4
[packages/framewave.git] / framewave-python-update.patch
1 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuild.py.orig 2023-03-14 17:30:38.005654913 +0100
2 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuild.py      2023-03-14 17:36:21.356773452 +0100
3 @@ -7,7 +7,6 @@
4  \r
5  import glob\r
6  import os\r
7 -from string import replace\r
8  from os.path import *\r
9  from stat import *\r
10  import sys\r
11 @@ -56,7 +56,7 @@ class fwBuildRoot:
12          if self.dctFwVars['toolset'] == '---':\r
13              if   sys.platform=='win32':\r
14                  self.dctFwVars['toolset'] = 'msvc'\r
15 -            elif sys.platform=='linux2':\r
16 +            elif sys.platform.startswith('linux'):\r
17                  self.dctFwVars['toolset'] = 'gcc'\r
18              elif sys.platform=='sunos5':\r
19                  self.dctFwVars['toolset'] = 'suncc'\r
20 @@ -127,7 +127,7 @@ class fwProject():
21          self.dctFwVars                  = self.oEnv['FWVARS']\r
22  \r
23          # First check for a libtype override before any other setup calls\r
24 -        if self.dctFwVars.has_key('libtypeOverride'+sProjectName):\r
25 +        if 'libtypeOverride'+sProjectName in self.dctFwVars:\r
26              self.dctFwVars['libtype'] = self.dctFwVars['libtypeOverride'+sProjectName]\r
27  \r
28          self.dctFwVars['sProjectName']  = sProjectName\r
29 @@ -343,7 +343,7 @@ def createDefFile ( pthDevLabRoot, pthPr
30      if   sys.platform=='win32':\r
31          exe_name = 'FwHeaderConvert_win.exe'\r
32          win_sys = 1\r
33 -    elif sys.platform=='linux2':\r
34 +    elif sys.platform.startswith('linux'):\r
35          exe_name = 'FwHeaderConvert_lin'\r
36      elif sys.platform=='sunos5':\r
37          exe_name = 'FwHeaderConvert_sol'\r
38 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwutil.py.orig  2023-03-14 17:45:45.647654147 +0100
39 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwutil.py       2023-03-14 17:48:18.679535747 +0100
40 @@ -9,7 +9,6 @@ from __future__ import with_statement
41  \r
42  import glob\r
43  import os\r
44 -from string import replace\r
45  from os.path import *\r
46  \r
47  import sys\r
48 @@ -99,7 +98,7 @@ def fixLinuxSharedLib( target = None, so
49  \r
50  def fixMacSharedLib( target = None, source = None, env = None ):\r
51      if target:\r
52 -        for t in target: os.rename(t.path, replace(t.path,'.dylib','-1.3.1.dylib'))\r
53 +        for t in target: os.rename(t.path, t.path.replace('.dylib','-1.3.1.dylib'))\r
54  \r
55  def AddObjsFromLibs( oEnv, LIBS, LIBPATH ):\r
56      # If no libs exist, nothing needs ot be added\r
57 @@ -127,8 +127,8 @@ def AddObjsFromLibs( oEnv, LIBS, LIBPATH
58              if 'EXTRALIBOBJS' in oEnv['FWVARS']: oEnv['FWVARS']['EXTRALIBOBJS'] += oExtraObjs\r
59              else: oEnv['FWVARS']['EXTRALIBOBJS'] = oExtraObjs\r
60          else:\r
61 -            print "Could not find library " + l + ".."\r
62 -            print LIBPATH\r
63 +            print("Could not find library " + l + "..")\r
64 +            print(LIBPATH)\r
65              sys.exit(0)\r
66  \r
67  def removeD( s, isD ):\r
68 @@ -164,7 +164,7 @@ def readFile ( sInFile ):
69          with open(sInFile, 'r') as f:\r
70              data = f.read()\r
71      except IOError:\r
72 -        print "Could not open " + sInFile  + "!\n"\r
73 +        print("Could not open " + sInFile  + "!\n")\r
74          return None\r
75      return data\r
76  \r
77 @@ -174,7 +174,7 @@ def writeFile ( sOutFile, lstData ):
78              for d in lstData:\r
79                  f.write( d )\r
80      except IOError:\r
81 -        print "Could not open " + sOutFile + "!\n"\r
82 +        print("Could not open " + sOutFile + "!\n")\r
83  \r
84  def writeLinesToFile ( sOutFile, lstData ):\r
85      try:\r
86 @@ -182,7 +182,7 @@ def writeLinesToFile ( sOutFile, lstData
87              for d in lstData:\r
88                  f.write( d + '\n')\r
89      except IOError:\r
90 -        print "Could not open " + sOutFile + "!\n"\r
91 +        print("Could not open " + sOutFile + "!\n")\r
92  \r
93  def getPaths( sInFile ):\r
94      try:\r
95 @@ -185,11 +185,12 @@ def writeLinesToFile ( sOutFile, lstData
96  \r
97  def getPaths( sInFile ):\r
98      try:\r
99 -        with open(sInFile, 'r') as f:\r
100 +        with open(sInFile, 'rb') as f:\r
101              f.seek(-200, os.SEEK_END)\r
102              lines = f.readlines()\r
103 +            lines = [line.decode("utf-8") for line in lines]\r
104      except IOError:\r
105 -        print "Could not open " + sInFile  + "!\n"\r
106 +        print("Could not open " + sInFile  + "!\n")\r
107          return None\r
108  \r
109      lstLines = []\r
110 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwparse.py.orig 2009-07-09 11:14:21.000000000 +0200
111 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwparse.py      2023-03-14 17:32:26.508376552 +0100
112 @@ -13,7 +13,6 @@ import re
113  import fileinput\r
114  \r
115  from os.path import *\r
116 -from string import replace\r
117  from fwutil import *\r
118  \r
119  \r
120 @@ -89,13 +88,13 @@ def createStub ( sFunctionName, sDecorat
121  def constructMultipassCPP ( pthProjectDir, sProjectName, pthInHeaderFile, pthOutCPPFile, pthVerifyHeader = None ):\r
122      sHeaderData = readFile( join(pthProjectDir, pthInHeaderFile) )\r
123      if not sHeaderData:\r
124 -        print "Cannot open " + pthInHeaderFile + "! Exiting.."\r
125 +        print("Cannot open " + pthInHeaderFile + "! Exiting..")\r
126          return None\r
127  \r
128      if pthVerifyHeader:\r
129          sVerifyData = readFile( pthVerifyHeader )\r
130          if not pthVerifyHeader:\r
131 -            print "Cannot open " + pthVerifyHeader + "! Exiting.."\r
132 +            print("Cannot open " + pthVerifyHeader + "! Exiting..")\r
133              return None\r
134  \r
135      lstMPFunctions = getMPFuncNames( sHeaderData )\r
136 @@ -140,7 +139,7 @@ def findREinFile ( pthInFile, fname ):
137              if line.find(fname) != -1:\r
138                  return 1\r
139      except IOError:\r
140 -        print "Could not open " + pthInFile  + "!\n"\r
141 +        print("5,Could not open " + pthInFile  + "!\n")\r
142          return None\r
143      return None\r
144  \r
145 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwObject.py.orig        2009-07-09 11:14:21.000000000 +0200
146 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwObject.py     2023-03-14 17:34:22.361075427 +0100
147 @@ -7,7 +7,6 @@
148  \r
149  import glob\r
150  import os\r
151 -from string import replace\r
152  from os.path import *\r
153  \r
154  import sys\r
155 @@ -51,7 +51,7 @@ class fwObject:
156          # Since there is no cross building yet\r
157          # we can assume that the platform we're\r
158          # building on is also the target platform\r
159 -        platform = sys.platform\r
160 +        platform = sys.platform.replace('linux2', 'linux')\r
161   \r
162          # Get toolset name\r
163          toolset = oFWVARS['toolset']\r
164 @@ -73,7 +73,7 @@ class fwObject:
165          oExceptFlags = None\r
166          toolset = oEnv['FWVARS']['toolset']\r
167          # Check if there is any special handling for this object\r
168 -        if dctGlobalExceptionsList.has_key(toolset):\r
169 +        if toolset in dctGlobalExceptionsList:\r
170              for r in dctGlobalExceptionsList[toolset]:\r
171                  if allInList(r[0], lstBuildFactors):\r
172                      oExceptFlags = r[1]\r
173 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuildexceptions.py.orig       2009-07-09 11:14:21.000000000 +0200
174 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuildexceptions.py    2023-03-14 17:38:25.859760232 +0100
175 @@ -5,7 +5,6 @@
176  \r
177  # Exceptions list module for Framewave's SCons scripts\r
178  import os\r
179 -from string import replace\r
180  from os.path import *\r
181  \r
182  import sys\r
183 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuildexceptionshandlers.py.orig       2009-07-09 11:14:21.000000000 +0200
184 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwbuildexceptionshandlers.py    2023-03-14 17:40:14.403567057 +0100
185 @@ -52,7 +52,7 @@ class fwFlags_gcc_AddSubFix(fwFlagsBase)
186          # Select flags to setup based on what kind of\r
187          # build object are we setting up flags for\r
188          if sObjectType=='library':\r
189 -            raise exception, "Error: This rule is meant to apply only on object files!"\r
190 +            raise Exception("Error: This rule is meant to apply only on object files!")\r
191          else:\r
192              self.lstCCFlags = self.determineFlags(lstBuildFactors, dctCCFlags)\r
193              self.lstCCFlags = self.translateFlags(self.lstCCFlags)\r
194 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwLibrary.py.orig       2009-07-09 11:14:21.000000000 +0200
195 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwLibrary.py    2023-03-14 17:49:41.047343791 +0100
196 @@ -7,7 +7,6 @@
197  \r
198  import glob\r
199  import os\r
200 -from string import replace\r
201  from os.path import *\r
202  \r
203  import sys\r
204 @@ -45,7 +45,7 @@ class fwLibrary:
205          # Since there is no cross building yet\r
206          # we can assume that the platform we're\r
207          # building on is also the target platform\r
208 -        platform = sys.platform\r
209 +        platform = sys.platform.replace('linux2', 'linux')\r
210   \r
211          # Get toolset name\r
212          toolset = oFWVARS['toolset']\r
213 @@ -62,7 +62,7 @@ class fwLibrary:
214          oExceptFlags = None\r
215          toolset = oEnv['FWVARS']['toolset']\r
216          # Check if there is any special handling for this object\r
217 -        if dctGlobalExceptionsList.has_key(toolset):\r
218 +        if toolset in dctGlobalExceptionsList:\r
219              for r in dctGlobalExceptionsList[toolset]:\r
220                  if allInList(r[0], lstBuildFactors):\r
221                      oExceptFlags = r[1]\r
222 --- FRAMEWAVE_1.3.1_SRC/BuildTools/util/FwHeaderConvert/FwHeaderConvert.sconscript.orig 2009-07-09 11:14:25.000000000 +0200
223 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/util/FwHeaderConvert/FwHeaderConvert.sconscript      2023-03-14 19:52:26.932017149 +0100
224 @@ -17,7 +17,7 @@ from fwbuild import *
225  \r
226  if   sys.platform=='win32':\r
227         exe_name = 'FwHeaderConvert_win'\r
228 -elif sys.platform=='linux2':\r
229 +elif sys.platform.startswith('linux'):\r
230         exe_name = 'FwHeaderConvert_lin'\r
231  elif sys.platform=='sunos5':\r
232         exe_name = 'FwHeaderConvert_sol'\r
233 --- FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwflagsbase.py.orig     2009-07-09 11:14:21.000000000 +0200
234 +++ FRAMEWAVE_1.3.1_SRC/BuildTools/buildscripts/fwflagsbase.py  2023-03-14 20:02:03.352227746 +0100
235 @@ -23,7 +23,7 @@ shr = 'shared'
236  stc = 'static'\r
237  exe = 'exe'\r
238  \r
239 -lin = 'linux2'\r
240 +lin = 'linux'\r
241  win = 'win32'\r
242  sol = 'sunos5'\r
243  mac = 'darwin'\r
244 --- FRAMEWAVE_1.3.1_SRC/Framewave/SConstruct.orig       2009-07-09 11:15:44.000000000 +0200
245 +++ FRAMEWAVE_1.3.1_SRC/Framewave/SConstruct    2023-03-14 21:34:55.725372945 +0100
246 @@ -39,7 +39,7 @@ if (str(COMMAND_LINE_TARGETS)=='') or \
247     (COMMAND_LINE_TARGETS==[]) or      \\r
248     (COMMAND_LINE_TARGETS==['']): chkCommandLine = 1\r
249  \r
250 -if ( (sys.platform == 'linux2' or sys.platform == 'sunos5') and ARGUMENTS.get('libtype', 'shared')=='shared'):\r
251 +if ( (sys.platform.startswith('linux') or sys.platform == 'sunos5') and ARGUMENTS.get('libtype', 'shared')=='shared'):\r
252      postAction = fixLinuxSharedLib\r
253  elif ((sys.platform == 'darwin') and ARGUMENTS.get('libtype', 'shared')=='shared'):\r
254      postAction = fixMacSharedLib\r
This page took 0.084465 seconds and 3 git commands to generate.