summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
commitd0fa82fb721cdc85438287e29a94cb796b7bc464 (patch)
tree26a2486b8e715b5937ce41679eafd42c02f2310a /Command
parent679eaf6077375c5d59501d12c79e0891cbdd904f (diff)
git-annex now builds on Windows (doesn't work)
Diffstat (limited to 'Command')
-rwxr-xr-x[-rw-r--r--]Command/Add.hs2
-rwxr-xr-x[-rw-r--r--]Command/Fix.hs2
-rwxr-xr-x[-rw-r--r--]Command/FromKey.hs2
-rwxr-xr-xCommand/Fsck.hs16
-rwxr-xr-x[-rw-r--r--]Command/Import.hs2
-rwxr-xr-x[-rw-r--r--]Command/Indirect.hs2
-rwxr-xr-x[-rw-r--r--]Command/ReKey.hs2
-rwxr-xr-x[-rw-r--r--]Command/RecvKey.hs2
-rwxr-xr-x[-rw-r--r--]Command/Status.hs1
-rwxr-xr-x[-rw-r--r--]Command/TransferKeys.hs2
-rwxr-xr-x[-rw-r--r--]Command/Unannex.hs6
11 files changed, 36 insertions, 3 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 68a894d30..95af72a6f 100644..100755
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -9,6 +9,8 @@
module Command.Add where
+import System.PosixCompat.Files
+
import Common.Annex
import Annex.Exception
import Command
diff --git a/Command/Fix.hs b/Command/Fix.hs
index 6aedbad6e..c6b4df257 100644..100755
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -7,6 +7,8 @@
module Command.Fix where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Annex.Queue
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index 30b491478..c3d2daafe 100644..100755
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -7,6 +7,8 @@
module Command.FromKey where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Annex.Queue
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index c63bc3ea0..fe1d35162 100755
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -9,6 +9,8 @@
module Command.Fsck where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Annex
@@ -30,8 +32,10 @@ import qualified Option
import Types.Key
import Utility.HumanTime
-#ifndef mingw32_HOST_OS
+#ifndef __WINDOWS__
import System.Posix.Process (getProcessID)
+#else
+import System.Random (getStdRandom, random)
#endif
import Data.Time.Clock.POSIX
import Data.Time
@@ -142,10 +146,14 @@ performRemote key file backend numcopies remote =
, checkKeyNumCopies key file numcopies
]
withtmp a = do
- pid <- liftIO getProcessID
+#ifndef __WINDOWS__
+ v <- liftIO getProcessID
+#else
+ v <- liftIO (getStdRandom random :: IO Int)
+#endif
t <- fromRepo gitAnnexTmpDir
createAnnexDirectory t
- let tmp = t </> "fsck" ++ show pid ++ "." ++ keyFile key
+ let tmp = t </> "fsck" ++ show v ++ "." ++ keyFile key
let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
cleanup
cleanup `after` a tmp
@@ -453,7 +461,9 @@ recordFsckTime key = do
parent <- parentDir <$> calcRepo (gitAnnexLocation key)
liftIO $ void $ tryIO $ do
touchFile parent
+#ifndef __WINDOWS__
setSticky parent
+#endif
getFsckTime :: Key -> Annex (Maybe EpochTime)
getFsckTime key = do
diff --git a/Command/Import.hs b/Command/Import.hs
index d86b44b80..cadf8fa2e 100644..100755
--- a/Command/Import.hs
+++ b/Command/Import.hs
@@ -7,6 +7,8 @@
module Command.Import where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Annex
diff --git a/Command/Indirect.hs b/Command/Indirect.hs
index 668bebefb..bf1509944 100644..100755
--- a/Command/Indirect.hs
+++ b/Command/Indirect.hs
@@ -7,6 +7,8 @@
module Command.Indirect where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Git
diff --git a/Command/ReKey.hs b/Command/ReKey.hs
index bc4a9fac9..05fd73f1b 100644..100755
--- a/Command/ReKey.hs
+++ b/Command/ReKey.hs
@@ -7,6 +7,8 @@
module Command.ReKey where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import qualified Annex
diff --git a/Command/RecvKey.hs b/Command/RecvKey.hs
index 840fd34cb..c316e2ca5 100644..100755
--- a/Command/RecvKey.hs
+++ b/Command/RecvKey.hs
@@ -7,6 +7,8 @@
module Command.RecvKey where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import CmdLine
diff --git a/Command/Status.hs b/Command/Status.hs
index 0009ff075..6a50c1ab5 100644..100755
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -13,6 +13,7 @@ import "mtl" Control.Monad.State.Strict
import qualified Data.Map as M
import Text.JSON
import Data.Tuple
+import System.PosixCompat.Files
import Common.Annex
import qualified Types.Backend as B
diff --git a/Command/TransferKeys.hs b/Command/TransferKeys.hs
index 2f5ea1fe4..d83170bbc 100644..100755
--- a/Command/TransferKeys.hs
+++ b/Command/TransferKeys.hs
@@ -9,6 +9,8 @@
module Command.TransferKeys where
+import System.PosixCompat.Files
+
import Common.Annex
import Command
import Annex.Content
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 53b593f20..6674b37d2 100644..100755
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Command.Unannex where
import Common.Annex
@@ -58,6 +60,9 @@ cleanup file key = do
return True
where
+#ifdef __WINDOWS__
+ goFast = go
+#else
goFast = do
-- fast mode: hard link to content in annex
src <- calcRepo $ gitAnnexLocation key
@@ -66,6 +71,7 @@ cleanup file key = do
( thawContent file
, go
)
+#endif
go = do
fromAnnex key file
logStatus key InfoMissing