Hello community,

here is the log from the commit of package shake for openSUSE:Factory checked 
in at 2016-06-25 02:21:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/shake (Old)
 and      /work/SRC/openSUSE:Factory/.shake.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "shake"

Changes:
--------
--- /work/SRC/openSUSE:Factory/shake/shake.changes      2016-06-14 
23:08:39.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.shake.new/shake.changes 2016-06-25 
02:21:56.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jun 15 09:23:40 UTC 2016 - [email protected]
+
+- update to 0.15.10
+* fix phony names which clash with directories
+
+-------------------------------------------------------------------

Old:
----
  shake-0.15.9.tar.gz

New:
----
  shake-0.15.10.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ shake.spec ++++++
--- /var/tmp/diff_new_pack.LQcEGB/_old  2016-06-25 02:21:57.000000000 +0200
+++ /var/tmp/diff_new_pack.LQcEGB/_new  2016-06-25 02:21:57.000000000 +0200
@@ -19,7 +19,7 @@
 %global pkg_name shake
 %bcond_with tests
 Name:           shake
-Version:        0.15.9
+Version:        0.15.10
 Release:        0
 Summary:        Build system library, like Make, but more accurate dependencies
 Group:          Development/Languages/Other

++++++ shake-0.15.9.tar.gz -> shake-0.15.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shake-0.15.9/CHANGES.txt 
new/shake-0.15.10/CHANGES.txt
--- old/shake-0.15.9/CHANGES.txt        2016-06-12 14:05:32.000000000 +0200
+++ new/shake-0.15.10/CHANGES.txt       2016-06-14 21:09:43.000000000 +0200
@@ -1,5 +1,7 @@
 Changelog for Shake
 
+0.15.10
+    #465, fix phony names which clash with directories
 0.15.9
     Documentation tweaks
     Optimise the thread pool
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shake-0.15.9/shake.cabal 
new/shake-0.15.10/shake.cabal
--- old/shake-0.15.9/shake.cabal        2016-06-12 14:05:32.000000000 +0200
+++ new/shake-0.15.10/shake.cabal       2016-06-14 21:09:43.000000000 +0200
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.10
 build-type:         Simple
 name:               shake
-version:            0.15.9
+version:            0.15.10
 license:            BSD3
 license-file:       LICENSE
 category:           Development, Shake
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shake-0.15.9/src/Development/Shake/FileInfo.hs 
new/shake-0.15.10/src/Development/Shake/FileInfo.hs
--- old/shake-0.15.9/src/Development/Shake/FileInfo.hs  2016-06-12 
14:05:32.000000000 +0200
+++ new/shake-0.15.10/src/Development/Shake/FileInfo.hs 2016-06-14 
21:09:43.000000000 +0200
@@ -3,7 +3,7 @@
 module Development.Shake.FileInfo(
     FileInfo, fileInfoEq, fileInfoNeq,
     FileSize, ModTime, FileHash,
-    getFileHash, getFileInfo
+    getFileHash, getFileInfo, getFileInfoNoDirErr
     ) where
 
 import Control.Exception.Extra
@@ -83,10 +83,17 @@
 
 
 getFileInfo :: BSU -> IO (Maybe (ModTime, FileSize))
+getFileInfo = getFileInfoEx True
+
+getFileInfoNoDirErr :: BSU -> IO (Maybe (ModTime, FileSize))
+getFileInfoNoDirErr = getFileInfoEx False
+
+
+getFileInfoEx :: Bool -> BSU -> IO (Maybe (ModTime, FileSize))
 
 #if defined(PORTABLE)
 -- Portable fallback
-getFileInfo x = handleBool isDoesNotExistError (const $ return Nothing) $ do
+getFileInfoEx direrr x = handleBool isDoesNotExistError (const $ return 
Nothing) $ do
     let file = unpackU x
     time <- getModificationTime file
     size <- withFile file ReadMode hFileSize
@@ -102,14 +109,14 @@
 
 #elif defined(mingw32_HOST_OS)
 -- Directly against the Win32 API, twice as fast as the portable version
-getFileInfo x = BS.useAsCString (unpackU_ x) $ \file ->
+getFileInfoEx direrr x = BS.useAsCString (unpackU_ x) $ \file ->
     alloca_WIN32_FILE_ATTRIBUTE_DATA $ \fad -> do
         res <- c_GetFileAttributesExA file 0 fad
         code <- peekFileAttributes fad
         let peek = do
                 code <- peekFileAttributes fad
                 if testBit code 4 then
-                    errorDirectoryNotFile $ unpackU x
+                    (if direrr then errorDirectoryNotFile $ unpackU x else 
return Nothing)
                  else
                     join $ liftM2 result (peekLastWriteTimeLow fad) 
(peekFileSizeLow fad)
         if res then
@@ -150,10 +157,10 @@
 
 #else
 -- Unix version
-getFileInfo x = handleBool isDoesNotExistError (const $ return Nothing) $ do
+getFileInfoEx direrr x = handleBool isDoesNotExistError (const $ return 
Nothing) $ do
     s <- getFileStatus $ unpackU_ x
     if isDirectory s then
-        errorDirectoryNotFile $ unpackU x
+        (if direrr then errorDirectoryNotFile $ unpackU x else return Nothing)
      else
         result (extractFileTime s) (fromIntegral $ fileSize s)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shake-0.15.9/src/Development/Shake/Rules/File.hs 
new/shake-0.15.10/src/Development/Shake/Rules/File.hs
--- old/shake-0.15.9/src/Development/Shake/Rules/File.hs        2016-06-12 
14:05:32.000000000 +0200
+++ new/shake-0.15.10/src/Development/Shake/Rules/File.hs       2016-06-14 
21:09:43.000000000 +0200
@@ -61,7 +61,7 @@
 
 instance Rule FileQ FileA where
     storedValue ShakeOptions{shakeChange=c} (FileQ x) = do
-        res <- getFileInfo x
+        res <- getFileInfoNoDirErr x
         case res of
             Nothing -> return Nothing
             Just (time,size) | c == ChangeModtime -> return $ Just $ FileA 
time size fileInfoNeq
@@ -79,6 +79,18 @@
         where bool b = if b then EqualCheap else NotEqual
 
 
+storedValueErrDir :: ShakeOptions -> FileQ -> IO (Maybe FileA)
+storedValueErrDir ShakeOptions{shakeChange=c} (FileQ x) = do
+    res <- getFileInfo x
+    case res of
+        Nothing -> return Nothing
+        Just (time,size) | c == ChangeModtime -> return $ Just $ FileA time 
size fileInfoNeq
+        Just (time,size) -> do
+            hash <- unsafeInterleaveIO $ getFileHash x
+            return $ Just $ FileA (if c == ChangeDigest then fileInfoNeq else 
time) size hash
+
+
+
 -- | Arguments: options; is the file an input; a message for failure if the 
file does not exist; filename
 storedValueError :: ShakeOptions -> Bool -> String -> FileQ -> IO FileA
 {-
@@ -87,7 +99,7 @@
         whenM (isNothing <$> (storedValue opts x :: IO (Maybe FileA))) $ error 
$ msg ++ "\n  " ++ unpackU (fromFileQ x)
     return $ FileA fileInfoEq fileInfoEq fileInfoEq
 -}
-storedValueError opts input msg x = fromMaybe def <$> storedValue opts2 x
+storedValueError opts input msg x = fromMaybe def <$> storedValueErrDir opts2 x
     where def = if shakeCreationCheck opts || input then error err else FileA 
fileInfoNeq fileInfoNeq fileInfoNeq
           err = msg ++ "\n  " ++ unpackU (fromFileQ x)
           opts2 = if not input && shakeChange opts == 
ChangeModtimeAndDigestInput then opts{shakeChange=ChangeModtime} else opts
@@ -144,7 +156,7 @@
 neededCheck :: [BSU] -> Action ()
 neededCheck (map (packU_ . filepathNormalise . unpackU_) -> xs) = do
     opts <- getShakeOptions
-    pre <- liftIO $ mapM (storedValue opts . FileQ) xs
+    pre <- liftIO $ mapM (storedValueErrDir opts . FileQ) xs
     post <- apply $ map FileQ xs :: Action [FileA]
     let bad = [ (x, if isJust a then "File change" else "File created")
               | (x, a, b) <- zip3 xs pre post, maybe NotEqual (\a -> 
equalValue opts (FileQ x) a b) a == NotEqual]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shake-0.15.9/src/Test/Basic.hs 
new/shake-0.15.10/src/Test/Basic.hs
--- old/shake-0.15.9/src/Test/Basic.hs  2016-06-12 14:05:32.000000000 +0200
+++ new/shake-0.15.10/src/Test/Basic.hs 2016-06-14 21:09:43.000000000 +0200
@@ -78,6 +78,9 @@
     obj "ids/out" %> \out -> do need =<< readFileLines (obj "ids/source"); 
writeFile' out ""
     obj "ids/*" %> \out -> do alwaysRerun; trace (takeFileName out); 
writeFile' out $ takeFileName out
 
+    phony (obj "foo") $ do
+        liftIO $ createDirectoryIfMissing True $ obj "foo"
+
 test build obj = do
     writeFile (obj "A.txt") "AAA"
     writeFile (obj "B.txt") "BBB"
@@ -178,4 +181,7 @@
     -- if you collapse depends to [Id] then this ends up asking for the stale 
'a'
     assertContents (obj ".log") "b"
 
+    build ["foo"]
+    build ["foo"]
+
     build [] -- should say "no want/action statements, nothing to do" (checked 
manually)


Reply via email to