[4suite-checkins] In 4Suite/Ft/Lib/DistExt, files BuildExt.py

Jeremy Kloth jkloth at 4suite.org
Sat Aug 12 11:45:30 MDT 2006


Update of /var/local/cvsroot/4Suite/Ft/Lib/DistExt
In directory dollar:/tmp/cvs-serv5924/Ft/Lib/DistExt

Modified Files:
	BuildExt.py 
Log Message:
Fixed timestamp checking


ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/BuildExt.py.diff?r1=1.18&r2=1.19
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/BuildExt.py?rev=1.19&content-type=text/vnd.viewcvs-markup

Index: BuildExt.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/Ft/Lib/DistExt/BuildExt.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -U2 -r1.18 -r1.19
--- BuildExt.py	12 Aug 2006 15:56:24 -0000	1.18
+++ BuildExt.py	12 Aug 2006 17:45:30 -0000	1.19
@@ -160,8 +160,17 @@
                                     self.get_ext_filename(fullname))
 
+        # Changes to the command indicate that compilation options may have
+        # changed so rebuild/link everything
+        command_mtime = ImportUtil.GetLastModified(__name__)
+        try:
+            force = command_mtime > os.stat(ext_filename).st_mtime
+        except OSError:
+            force = True
+        force = self.force or force
+
         depends = sources + ext.depends
         for includes in ext.includes.values():
             depends.extend(includes)
-        if not (self.force or newer_group(depends, ext_filename, 'newer')):
+        if not (force or newer_group(depends, ext_filename, 'newer')):
             self.announce("skipping '%s' extension (up-to-date)" % ext.name)
             return
@@ -182,12 +191,8 @@
                                                  self.build_temp)
 
-        command_mtime = ImportUtil.GetLastModified(__name__)
+        self.compiler.force = force
         if sys.version >= '2.3':
             # Python 2.3 added dependency checking to the compiler, use that
             for object, source in zip(objects, sources):
-                if command_mtime > os.stat(object).st_mtime:
-                    self.compiler.force = True
-                else:
-                    self.compiler.force = self.force
                 depends = ext.depends + ext.includes[source]
                 self.compiler.compile([source],
@@ -199,5 +204,5 @@
                                       depends=depends)
         else:
-            if not self.force:
+            if not force:
                 # Determine those sources that require rebuilding
                 new_sources = []
@@ -222,7 +227,4 @@
                                       extra_postargs=extra_args)
 
-        # Reset the force flag on the compilier
-        self.compiler.force = self.force
-
         # Now link the object files together into a "shared object" --
         # of course, first we have to figure out all the other things
@@ -286,4 +288,7 @@
             subst = {'exports' : expfile, 'extension' : filename}
             self.spawn([ x % subst for x in self.strip_command.split(' ') ])
+
+        # Reset the force flag on the compilier
+        self.compiler.force = self.force
         return
 



More information about the 4suite-checkins mailing list