]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Fri, 20 Jul 2001 18:20:55 +0000 (18:20 +0000)
committercas <cas@opencascade.com>
Fri, 20 Jul 2001 18:20:55 +0000 (18:20 +0000)
src/WOKStep/WOKStep_Include.cxx

index 684a8ed7d749e4d1c9a8f3a7c50e1d9495ea1e0b..aa3097fb7d68980c87fd37d8569a862675c486b1 100755 (executable)
@@ -161,57 +161,61 @@ void WOKStep_Include::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuil
                  !pubincfile -> Path () -> IsSameFile (  infile -> File () -> Path ()  )) &&
               ( infile -> File () -> Path ()  -> Exists () )
             ) {
-           OSD_Path pSrc (  infile -> File () -> Path () -> Name () -> String ()  );
-           OSD_File fSrc (  pSrc                                                  );
-           OSD_Path pDst (  pubincfile -> Path () -> Name () -> String ()         );
+           OSD_Path pSrc (  infile -> File () -> Path () -> Name () -> String ()  );
+           OSD_File fSrc (  pSrc                                                  );
+           OSD_Path pDst (  pubincfile -> Path () -> Name () -> String ()         );
 
-           OSD_File fDst ( pDst ) ;
+           OSD_File fDst ( pDst ) ;
 #ifdef DEB
-          cout << " pubinclude publication : before Chmod  " << endl;
+           cout << " pubinclude publication : before Chmod  " << endl;
 #endif
-          if ( fDst.IsWriteable()) { 
-            chmod (  pubincfile -> Path () -> Name () -> ToCString (), 00644  );
-          }
+           if ( fDst.IsReadable() &&  !fDst.IsWriteable()) { 
+             if (  fDst.UserId() == fSrc.UserId() ) {
+              chmod (  pubincfile -> Path () -> Name () -> ToCString (), 00644  );
+             }
+           }
 #ifdef DEB
-          cout << " pubinclude publication : before copy  " << endl;
+           cout << " pubinclude publication : before copy  " << endl;
 #endif
-           fSrc.Copy ( pDst );
-
-           if (  fSrc.Failed ()  ) {
-
-            ErrorMsg << "WOKStep_Include :: Execute"
-                     << "failed to copy '" << infile -> File () -> Path () -> Name ()
-                     << "' to '"           << pubincfile        -> Path () -> Name ()
-                     << "'" << endm;
-
-            SetFailed ();
-
-            return;
-
-          } else {
-
-            InfoMsg << "WOKStep_Include :: Execute"
-                     << "Copied : '" << infile->File()->Path()->Name()
-                     << "' to '" << pubincfile->Path()->Name()
-                     << "'" << endm;
-           }  // end if
-
-           struct utimbuf times;
-           struct stat    buf;
-
-           stat (  infile -> File () -> Path () -> Name () -> ToCString (), &buf  );
-
-           times.actime  = buf.st_atime;
-           times.modtime = buf.st_mtime; 
-
-           utime (  pubincfile -> Path () -> Name () -> ToCString (), &times  ); 
-
-          } else {
-
-           InfoMsg << "WOKStep_Include :: Execute"
-                     << "failed to copy '" << infile -> File () -> Path () -> Name ()
-                     << "' to '"           << pubincfile        -> Path () -> Name ()
-                     << "'" << endm;
+           fSrc.Copy ( pDst );
+
+           if (  fSrc.Failed ()  ) {
+             
+             ErrorMsg << "WOKStep_Include :: Execute"
+                      << "failed to copy '" << infile -> File () -> Path () -> Name ()
+                      << "' to '"           << pubincfile        -> Path () -> Name ()
+                      << "'" << endm;
+             
+             SetFailed ();
+
+             return;
+
+           } else {
+
+             InfoMsg << "WOKStep_Include :: Execute"
+                     << "Copied : '" << infile->File()->Path()->Name()
+                     << "' to '" << pubincfile->Path()->Name()
+                     << "'" << endm;
+           }  // end if
+           
+           struct utimbuf times;
+           struct stat    buf;
+           
+           stat (  infile -> File () -> Path () -> Name () -> ToCString (), &buf  );
+           
+           times.actime  = buf.st_atime;
+           times.modtime = buf.st_mtime; 
+           
+           utime (  pubincfile -> Path () -> Name () -> ToCString (), &times  ); 
+           
+         } else {
+
+           if ( !(infile -> File () -> Path ()  -> Exists () )) {
+             InfoMsg << "WOKStep_Include :: Execute"
+               << "failed to copy '" << infile -> File () -> Path () -> Name ()
+                 << "' to '"           << pubincfile        -> Path () -> Name ()
+                   << "'" << endm;
+           }
 
           }  // end if
 # endif  // WOKStep_Incluse_SYMLINK