summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
commit4e14ef3660924e7c005c42d4d58716ee0beb2d31 (patch)
tree4691e44203ded56f77bf2c4abf5de9a6acdac462 /Command/Add.hs
parent516d4899d3ea7e12ee9b408160b36190b8c2d3f2 (diff)
can now build Android targeted binary
Various things that don't work on Android are just ifdefed out. * the webapp (needs template haskell for arm) * --include and --exclude globbing (needs libpcre, which is not ported; probably I'll make it use the pure haskell glob library instead) * annex.diskreserve checking (missing sys/statvfs.h) * timestamp preservation support (yawn) * S3 * WebDAV * XMPP The resulting 17mb binary has been tested on Android, and it is able to, at least, print its usage message.
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index a68b190de..bfab33099 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Command.Add where
import Common.Annex
@@ -18,7 +20,9 @@ import Logs.Location
import Annex.Content
import Annex.Content.Direct
import Annex.Perms
+#ifndef WITH_ANDROID
import Utility.Touch
+#endif
import Utility.FileMode
import Config
import qualified Git.HashObject
@@ -141,12 +145,14 @@ link file key hascontent = handle (undo file key) $ do
l <- calcGitLink file key
liftIO $ createSymbolicLink l file
+#ifndef WITH_ANDROID
when hascontent $ do
-- touch the symlink to have the same mtime as the
-- file it points to
liftIO $ do
mtime <- modificationTime <$> getFileStatus file
touch file (TimeSpec mtime) False
+#endif
return l