summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-14 14:10:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-14 14:15:26 -0400
commit177245deb6ee3271eb44d77c2b0cd722755b2c3f (patch)
tree876c4844937c831470192d367123f581fb6cc3d8 /Assistant
parent4e2d50d2e4c9b4d3487c24042b733d02c2f4dd46 (diff)
crippled filesystem support, probing and initial support
git annex init probes for crippled filesystems, and sets direct mode, as well as `annex.crippledfilesystem`. Avoid manipulating permissions of files on crippled filesystems. That would likely cause an exception to be thrown. Very basic support in Command.Add for cripped filesystems; avoids the lock down entirely since doing it needs both permissions and hard links. Will make this better soon.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Pairing/Network.hs2
-rw-r--r--Assistant/Threads/Committer.hs6
2 files changed, 5 insertions, 3 deletions
diff --git a/Assistant/Pairing/Network.hs b/Assistant/Pairing/Network.hs
index 44a63df36..6c625f881 100644
--- a/Assistant/Pairing/Network.hs
+++ b/Assistant/Pairing/Network.hs
@@ -60,7 +60,7 @@ multicastPairMsg repeats secret pairdata stage = go M.empty repeats
go cache' $ pred <$> n
{- The multicast library currently chokes on ipv6 addresses. -}
sendinterface _ (IPv6Addr _) = noop
- sendinterface cache i = void $ catchMaybeIO $
+ sendinterface cache i = void $ tryIO $
withSocketsDo $ bracket setup cleanup use
where
setup = multicastSender (multicastAddress i) pairingPort
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index ce39735f9..463c2965c 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -233,7 +233,8 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
then a
else do
-- remove the hard link
- void $ liftIO $ tryIO $ removeFile $ contentLocation keysource
+ when (contentLocation keysource /= keyFilename keysource) $
+ void $ liftIO $ tryIO $ removeFile $ contentLocation keysource
return Nothing
{- Files can Either be Right to be added now,
@@ -278,7 +279,8 @@ safeToAdd delayadd pending inprocess = do
warning $ keyFilename ks
++ " still has writers, not adding"
-- remove the hard link
- void $ liftIO $ tryIO $ removeFile $ contentLocation ks
+ when (contentLocation ks /= keyFilename ks) $
+ void $ liftIO $ tryIO $ removeFile $ contentLocation ks
canceladd _ = noop
openwrite (_file, mode, _pid)