[git-annex] Add the no-ifelse patch

Ben Boeckel mathstuf at fedoraproject.org
Sat Jun 23 10:48:46 UTC 2012


commit eb8813f3ed71751ebac96762c6d5430fd47b4129
Author: Ben Boeckel <mathstuf at gmail.com>
Date:   Sat Jun 23 06:48:34 2012 -0400

    Add the no-ifelse patch

 git-annex-no-ifelse.patch |   84 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)
---
diff --git a/git-annex-no-ifelse.patch b/git-annex-no-ifelse.patch
new file mode 100644
index 0000000..7b95e17
--- /dev/null
+++ b/git-annex-no-ifelse.patch
@@ -0,0 +1,84 @@
+diff -u -r -U5 -N git-annex-3.20120522/Common.hs git-annex-3.20120522.no-ifelse/Common.hs
+--- git-annex-3.20120522/Common.hs	2012-05-22 11:28:25.000000000 -0400
++++ git-annex-3.20120522.no-ifelse/Common.hs	2012-06-02 09:44:55.941168737 -0400
+@@ -1,9 +1,8 @@
+ module Common (module X) where
+ 
+ import Control.Monad as X hiding (join)
+-import Control.Monad.IfElse as X
+ import Control.Applicative as X
+ import Control.Monad.State.Strict as X (liftIO)
+ import Control.Exception.Extensible as X (IOException)
+ 
+ import Data.Maybe as X
+@@ -25,7 +24,8 @@
+ import Utility.SafeCommand as X
+ import Utility.Path as X
+ import Utility.Directory as X
+ import Utility.Monad as X
+ import Utility.FileSystemEncoding as X
++import Utility.Conditional as X
+ 
+ import Utility.PartialPrelude as X
+diff -u -r -U5 -N git-annex-3.20120522/git-annex.cabal git-annex-3.20120522.no-ifelse/git-annex.cabal
+--- git-annex-3.20120522/git-annex.cabal	2012-05-22 11:28:26.000000000 -0400
++++ git-annex-3.20120522.no-ifelse/git-annex.cabal	2012-06-02 09:46:02.857169451 -0400
+@@ -33,11 +33,11 @@
+   Main-Is: git-annex.hs
+   Build-Depends: MissingH, hslogger, directory, filepath,
+    unix, containers, utf8-string, network, mtl, bytestring, old-locale, time,
+    pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP,
+    base == 4.5.*, monad-control, transformers-base, lifted-base,
+-   IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance
++   text, QuickCheck >= 2.1, bloomfilter, edit-distance
+   Other-Modules: Utility.Touch
+   C-Sources: Utility/libdiskfree.c
+   Extensions: CPP
+ 
+   if flag(S3)
+diff -u -r -U5 -N git-annex-3.20120522/Utility/Conditional.hs git-annex-3.20120522.no-ifelse/Utility/Conditional.hs
+--- git-annex-3.20120522/Utility/Conditional.hs	1969-12-31 19:00:00.000000000 -0500
++++ git-annex-3.20120522.no-ifelse/Utility/Conditional.hs	2012-06-02 09:44:55.942168737 -0400
+@@ -0,0 +1,16 @@
++{- monadic conditional operators
++ -
++ - Copyright 2011 Joey Hess <joey at kitenet.net>
++ -
++ - Licensed under the GNU GPL version 3 or higher.
++ -}
++
++module Utility.Conditional where
++
++import Control.Monad (when, unless)
++
++whenM :: Monad m => m Bool -> m () -> m ()
++whenM c a = c >>= flip when a
++
++unlessM :: Monad m => m Bool -> m () -> m ()
++unlessM c a = c >>= flip unless a
+diff -u -r -U5 -N git-annex-3.20120522/Utility/Directory.hs git-annex-3.20120522.no-ifelse/Utility/Directory.hs
+--- git-annex-3.20120522/Utility/Directory.hs	2012-05-22 11:28:26.000000000 -0400
++++ git-annex-3.20120522.no-ifelse/Utility/Directory.hs	2012-06-02 09:45:33.002169133 -0400
+@@ -10,21 +10,21 @@
+ import System.IO.Error
+ import System.Posix.Files
+ import System.Directory
+ import Control.Exception (throw)
+ import Control.Monad
+-import Control.Monad.IfElse
+ import System.FilePath
+ import Control.Applicative
+ import Control.Exception (bracket_)
+ import System.Posix.Directory
+ 
+ import Utility.SafeCommand
+ import Utility.TempFile
+ import Utility.Exception
+ import Utility.Monad
+ import Utility.Path
++import Utility.Conditional
+ 
+ {- Lists the contents of a directory.
+  - Unlike getDirectoryContents, paths are not relative to the directory. -}
+ dirContents :: FilePath -> IO [FilePath]
+ dirContents d = map (d </>) . filter notcruft <$> getDirectoryContents d


More information about the scm-commits mailing list