aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Add.hs4
-rw-r--r--Command/Fix.hs6
-rw-r--r--git-annex.cabal12
3 files changed, 5 insertions, 17 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 231beb1fb..e0a8269aa 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -24,10 +24,8 @@ import Annex.Link
import qualified Annex
import qualified Annex.Queue
#ifndef __ANDROID__
-#ifdef WITH_CLIBS
import Utility.Touch
#endif
-#endif
import Utility.FileMode
import Config
import Utility.InodeCache
@@ -208,14 +206,12 @@ link file key mcache = flip catchAnnex (undo file key) $ do
replaceFile file $ makeAnnexLink l
#ifndef __ANDROID__
-#ifdef WITH_CLIBS
-- touch symlink to have same time as the original file,
-- as provided in the InodeCache
case mcache of
Just c -> liftIO $ touch file (TimeSpec $ inodeCacheToMtime c) False
Nothing -> noop
#endif
-#endif
return l
diff --git a/Command/Fix.hs b/Command/Fix.hs
index a1e30eafa..da2627619 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -15,10 +15,8 @@ import Common.Annex
import Command
import qualified Annex.Queue
#ifndef __ANDROID__
-#ifdef WITH_CLIBS
import Utility.Touch
#endif
-#endif
def :: [Command]
def = [notDirect $ noCommit $ command "fix" paramPaths seek
@@ -39,20 +37,16 @@ perform :: FilePath -> FilePath -> CommandPerform
perform file link = do
liftIO $ do
#ifndef __ANDROID__
-#ifdef WITH_CLIBS
-- preserve mtime of symlink
mtime <- catchMaybeIO $ TimeSpec . modificationTime
<$> getSymbolicLinkStatus file
#endif
-#endif
createDirectoryIfMissing True (parentDir file)
removeFile file
createSymbolicLink link file
#ifndef __ANDROID__
-#ifdef WITH_CLIBS
maybe noop (\t -> touch file t False) mtime
#endif
-#endif
next $ cleanup file
cleanup :: FilePath -> CommandCleanup
diff --git a/git-annex.cabal b/git-annex.cabal
index 17b83796a..20ac48511 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -83,8 +83,13 @@ Executable git-annex
base (>= 4.5 && < 4.9), monad-control, MonadCatchIO-transformers,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process,
SafeSemaphore, uuid, random, dlist, unix-compat
+ -- Need to list these because they're generated from .hsc files.
+ Other-Modules: Utility.Touch Utility.Mounts
+ Include-Dirs: Utility
+ C-Sources: Utility/libdiskfree.c Utility/libmounts.c
CC-Options: -Wall
GHC-Options: -Wall
+ CPP-Options: -DWITH_CLIBS
Extensions: PackageImports
-- Some things don't work with the non-threaded RTS.
GHC-Options: -threaded
@@ -93,13 +98,6 @@ Executable git-annex
GHC-Options: -O2
if (! os(windows))
- -- hsc files
- Other-Modules: Utility.Touch Utility.Mounts
- Include-Dirs: Utility
- C-Sources: Utility/libdiskfree.c Utility/libmounts.c
- CPP-Options: -DWITH_CLIBS
-
- if (! os(windows))
Build-Depends: unix
if flag(TestSuite)