summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Add.hs4
-rw-r--r--Command/Fix.hs6
2 files changed, 10 insertions, 0 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 90a9f561b..9f1beb28a 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -23,9 +23,11 @@ import Annex.Perms
import Annex.Link
import qualified Annex
import qualified Annex.Queue
+#ifdef WITH_CLIBS
#ifndef __ANDROID__
import Utility.Touch
#endif
+#endif
import Config
import Utility.InodeCache
import Annex.FileMatcher
@@ -211,6 +213,7 @@ link file key mcache = flip catchAnnex (undo file key) $ do
l <- inRepo $ gitAnnexLink file key
replaceFile file $ makeAnnexLink l
+#ifdef WITH_CLIBS
#ifndef __ANDROID__
-- touch symlink to have same time as the original file,
-- as provided in the InodeCache
@@ -218,6 +221,7 @@ link file key mcache = flip catchAnnex (undo file key) $ do
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 da2627619..a63a10f8f 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -14,9 +14,11 @@ import System.PosixCompat.Files
import Common.Annex
import Command
import qualified Annex.Queue
+#ifdef WITH_CLIBS
#ifndef __ANDROID__
import Utility.Touch
#endif
+#endif
def :: [Command]
def = [notDirect $ noCommit $ command "fix" paramPaths seek
@@ -36,17 +38,21 @@ start file (key, _) = do
perform :: FilePath -> FilePath -> CommandPerform
perform file link = do
liftIO $ do
+#ifdef WITH_CLIBS
#ifndef __ANDROID__
-- preserve mtime of symlink
mtime <- catchMaybeIO $ TimeSpec . modificationTime
<$> getSymbolicLinkStatus file
#endif
+#endif
createDirectoryIfMissing True (parentDir file)
removeFile file
createSymbolicLink link file
+#ifdef WITH_CLIBS
#ifndef __ANDROID__
maybe noop (\t -> touch file t False) mtime
#endif
+#endif
next $ cleanup file
cleanup :: FilePath -> CommandCleanup