diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-01-09 13:11:56 -0400 |
commit | 425bc1107aebdb701cdcee44da731dd918cd470d (patch) | |
tree | 25bcacb37277b70aa7bd0caaf0fe7c3edc665653 /Remote | |
parent | 20c7644a4d85434cf49840ea92fca0c723710c72 (diff) |
revert parentDir change
Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c
Unfortunately, this caused breakage on Windows, and possibly elsewhere,
because parentDir and takeDirectory do not behave the same when there is a
trailing directory separator.
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/BitTorrent.hs | 2 | ||||
-rw-r--r-- | Remote/Directory.hs | 2 | ||||
-rw-r--r-- | Remote/GCrypt.hs | 4 | ||||
-rw-r--r-- | Remote/Git.hs | 2 | ||||
-rw-r--r-- | Remote/Rsync.hs | 4 | ||||
-rw-r--r-- | Remote/Tahoe.hs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs index b04abe56b..d0a35fa30 100644 --- a/Remote/BitTorrent.hs +++ b/Remote/BitTorrent.hs @@ -189,7 +189,7 @@ downloadTorrentFile u = do , do showAction "downloading torrent file" showOutput - createAnnexDirectory (takeDirectory torrent) + createAnnexDirectory (parentDir torrent) if isTorrentMagnetUrl u then do tmpdir <- tmpTorrentDir u diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 1d9a15ea5..66a3de49f 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -143,7 +143,7 @@ finalizeStoreGeneric :: FilePath -> FilePath -> IO () finalizeStoreGeneric tmp dest = do void $ tryIO $ allowWrite dest -- may already exist void $ tryIO $ removeDirectoryRecursive dest -- or not exist - createDirectoryIfMissing True (takeDirectory dest) + createDirectoryIfMissing True (parentDir dest) renameDirectory tmp dest -- may fail on some filesystems void $ tryIO $ do diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index 67021732f..2f2ddc9f3 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -315,7 +315,7 @@ store r rsyncopts void $ tryIO $ createDirectoryIfMissing True tmpdir let tmpf = tmpdir </> keyFile k meteredWriteFile p tmpf b - let destdir = takeDirectory $ gCryptLocation r k + let destdir = parentDir $ gCryptLocation r k Remote.Directory.finalizeStoreGeneric tmpdir destdir return True | Git.repoIsSsh (repo r) = if isShell r @@ -340,7 +340,7 @@ retrieve r rsyncopts remove :: Remote -> Remote.Rsync.RsyncOpts -> Remover remove r rsyncopts k | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ - liftIO $ Remote.Directory.removeDirGeneric (Git.repoLocation (repo r)) (takeDirectory (gCryptLocation r k)) + liftIO $ Remote.Directory.removeDirGeneric (Git.repoLocation (repo r)) (parentDir (gCryptLocation r k)) | Git.repoIsSsh (repo r) = shellOrRsync r removeshell removersync | otherwise = unsupportedUrl where diff --git a/Remote/Git.hs b/Remote/Git.hs index 8e521cfe9..17b44fa6e 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -556,7 +556,7 @@ rsyncOrCopyFile rsyncparams src dest p = ifM (sameDeviceIds src dest) (docopy, dorsync) where sameDeviceIds a b = (==) <$> getDeviceId a <*> getDeviceId b - getDeviceId f = deviceID <$> liftIO (getFileStatus $ takeDirectory f) + getDeviceId f = deviceID <$> liftIO (getFileStatus $ parentDir f) docopy = liftIO $ bracket (forkIO $ watchfilesize zeroBytesProcessed) (void . tryIO . killThread) diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs index 72cabe2fd..ad5b77d38 100644 --- a/Remote/Rsync.hs +++ b/Remote/Rsync.hs @@ -161,7 +161,7 @@ rsyncSetup mu _ c = do store :: RsyncOpts -> Key -> FilePath -> MeterUpdate -> Annex Bool store o k src meterupdate = withRsyncScratchDir $ \tmp -> do let dest = tmp </> Prelude.head (keyPaths k) - liftIO $ createDirectoryIfMissing True $ takeDirectory dest + liftIO $ createDirectoryIfMissing True $ parentDir dest ok <- liftIO $ if canrename then do rename src dest @@ -214,7 +214,7 @@ remove o k = do - traverses directories. -} includes = concatMap use annexHashes use h = let dir = h k in - [ takeDirectory dir + [ parentDir dir , dir -- match content directory and anything in it , dir </> keyFile k </> "***" diff --git a/Remote/Tahoe.hs b/Remote/Tahoe.hs index 06c7590e7..27bb12884 100644 --- a/Remote/Tahoe.hs +++ b/Remote/Tahoe.hs @@ -153,7 +153,7 @@ tahoeConfigure configdir furl mscs = do createClient :: TahoeConfigDir -> IntroducerFurl -> IO Bool createClient configdir furl = do - createDirectoryIfMissing True (takeDirectory configdir) + createDirectoryIfMissing True (parentDir configdir) boolTahoe configdir "create-client" [ Param "--nickname", Param "git-annex" , Param "--introducer", Param furl |