diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-01-06 19:00:01 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-01-06 19:00:01 -0400 |
commit | 6be8289158fd30d972ac22766452e7c9dc809e6f (patch) | |
tree | ba4929c7c8f27d2b43051f637394115cda39258b /Command | |
parent | 6ea1214fa5d19241851a977ab82437563e2afc81 (diff) | |
parent | 971ed2a464a1a1e4d5e650e32390d232cd354d9d (diff) |
Merge branch 'master' into relativepaths
Conflicts:
Locations.hs
debian/changelog
Diffstat (limited to 'Command')
-rw-r--r-- | Command/AddUrl.hs | 8 | ||||
-rw-r--r-- | Command/Fix.hs | 2 | ||||
-rw-r--r-- | Command/FromKey.hs | 2 | ||||
-rw-r--r-- | Command/Fsck.hs | 10 | ||||
-rw-r--r-- | Command/FuzzTest.hs | 4 | ||||
-rw-r--r-- | Command/Import.hs | 2 | ||||
-rw-r--r-- | Command/ImportFeed.hs | 2 | ||||
-rw-r--r-- | Command/Unlock.hs | 2 | ||||
-rw-r--r-- | Command/Vicfg.hs | 2 |
9 files changed, 17 insertions, 17 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 97adc75ee..a5fa53ca0 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -101,7 +101,7 @@ performRemote r relaxed uri file sz = ifAnnexed file adduri geturi downloadRemoteFile :: Remote -> Bool -> URLString -> FilePath -> Maybe Integer -> Annex (Maybe Key) downloadRemoteFile r relaxed uri file sz = do urlkey <- Backend.URL.fromUrl uri sz - liftIO $ createDirectoryIfMissing True (parentDir file) + liftIO $ createDirectoryIfMissing True (takeDirectory file) ifM (Annex.getState Annex.fast <||> pure relaxed) ( do cleanup (Remote.uuid r) loguri file urlkey Nothing @@ -195,7 +195,7 @@ addUrlFileQuvi relaxed quviurl videourl file = do showOutput ok <- Transfer.notifyTransfer Transfer.Download (Just file) $ Transfer.download webUUID key (Just file) Transfer.forwardRetry $ const $ do - liftIO $ createDirectoryIfMissing True (parentDir tmp) + liftIO $ createDirectoryIfMissing True (takeDirectory tmp) downloadUrl [videourl] tmp if ok then do @@ -227,7 +227,7 @@ addUrlChecked relaxed url u checkexistssize key addUrlFile :: Bool -> URLString -> FilePath -> Annex (Maybe Key) addUrlFile relaxed url file = do - liftIO $ createDirectoryIfMissing True (parentDir file) + liftIO $ createDirectoryIfMissing True (takeDirectory file) ifM (Annex.getState Annex.fast <||> pure relaxed) ( nodownload relaxed url file , downloadWeb url file @@ -269,7 +269,7 @@ downloadWith downloader dummykey u url file = where runtransfer tmp = Transfer.notifyTransfer Transfer.Download (Just file) $ Transfer.download u dummykey (Just file) Transfer.forwardRetry $ \p -> do - liftIO $ createDirectoryIfMissing True (parentDir tmp) + liftIO $ createDirectoryIfMissing True (takeDirectory tmp) downloader tmp p {- Hits the url to get the size, if available. diff --git a/Command/Fix.hs b/Command/Fix.hs index 774ef8583..956ea4352 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -43,7 +43,7 @@ perform file link = do <$> getSymbolicLinkStatus file #endif #endif - createDirectoryIfMissing True (parentDir file) + createDirectoryIfMissing True (takeDirectory file) removeFile file createSymbolicLink link file #ifdef WITH_CLIBS diff --git a/Command/FromKey.hs b/Command/FromKey.hs index 3b20749fe..96da895ed 100644 --- a/Command/FromKey.hs +++ b/Command/FromKey.hs @@ -34,7 +34,7 @@ start _ = error "specify a key and a dest file" perform :: Key -> FilePath -> CommandPerform perform key file = do link <- inRepo $ gitAnnexLink file key - liftIO $ createDirectoryIfMissing True (parentDir file) + liftIO $ createDirectoryIfMissing True (takeDirectory file) liftIO $ createSymbolicLink link file next $ cleanup file diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 46c1620f1..837e68ea8 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -200,7 +200,7 @@ fixLink key file = do go want have | want /= fromInternalGitPath have = do showNote "fixing link" - liftIO $ createDirectoryIfMissing True (parentDir file) + liftIO $ createDirectoryIfMissing True (takeDirectory file) liftIO $ removeFile file addAnnexLink want file | otherwise = noop @@ -218,7 +218,7 @@ verifyLocationLog key desc = do file <- calcRepo $ gitAnnexLocation key when (present && not direct) $ freezeContent file - whenM (liftIO $ doesDirectoryExist $ parentDir file) $ + whenM (liftIO $ doesDirectoryExist $ takeDirectory file) $ freezeContentDir file {- In direct mode, modified files will show up as not present, @@ -450,7 +450,7 @@ needFsck _ _ = return True -} recordFsckTime :: Key -> Annex () recordFsckTime key = do - parent <- parentDir <$> calcRepo (gitAnnexLocation key) + parent <- takeDirectory <$> calcRepo (gitAnnexLocation key) liftIO $ void $ tryIO $ do touchFile parent #ifndef mingw32_HOST_OS @@ -459,7 +459,7 @@ recordFsckTime key = do getFsckTime :: Key -> Annex (Maybe EpochTime) getFsckTime key = do - parent <- parentDir <$> calcRepo (gitAnnexLocation key) + parent <- takeDirectory <$> calcRepo (gitAnnexLocation key) liftIO $ catchDefaultIO Nothing $ do s <- getFileStatus parent return $ if isSticky $ fileMode s @@ -477,7 +477,7 @@ getFsckTime key = do recordStartTime :: Annex () recordStartTime = do f <- fromRepo gitAnnexFsckState - createAnnexDirectory $ parentDir f + createAnnexDirectory $ takeDirectory f liftIO $ do nukeFile f withFile f WriteMode $ \h -> do diff --git a/Command/FuzzTest.hs b/Command/FuzzTest.hs index 87bee963f..a2a474d31 100644 --- a/Command/FuzzTest.hs +++ b/Command/FuzzTest.hs @@ -173,7 +173,7 @@ instance Arbitrary FuzzAction where runFuzzAction :: FuzzAction -> Annex () runFuzzAction (FuzzAdd (FuzzFile f)) = liftIO $ do - createDirectoryIfMissing True $ parentDir f + createDirectoryIfMissing True $ takeDirectory f n <- getStdRandom random :: IO Int writeFile f $ show n ++ "\n" runFuzzAction (FuzzDelete (FuzzFile f)) = liftIO $ nukeFile f @@ -210,7 +210,7 @@ genFuzzAction = do case md of Nothing -> genFuzzAction Just d -> do - newd <- liftIO $ newDir (parentDir $ toFilePath d) + newd <- liftIO $ newDir (takeDirectory $ toFilePath d) maybe genFuzzAction (return . FuzzMoveDir d) newd FuzzDeleteDir _ -> do d <- liftIO existingDir diff --git a/Command/Import.hs b/Command/Import.hs index b20e63853..113df19ac 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -88,7 +88,7 @@ start mode (srcfile, destfile) = next $ return True importfile = do handleexisting =<< liftIO (catchMaybeIO $ getSymbolicLinkStatus destfile) - liftIO $ createDirectoryIfMissing True (parentDir destfile) + liftIO $ createDirectoryIfMissing True (takeDirectory destfile) liftIO $ if mode == Duplicate || mode == SkipDuplicates then void $ copyFileExternal CopyAllMetaData srcfile destfile else moveFile srcfile destfile diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs index c45fad961..05dc4f3e4 100644 --- a/Command/ImportFeed.hs +++ b/Command/ImportFeed.hs @@ -311,7 +311,7 @@ checkFeedBroken' url f = do now <- liftIO getCurrentTime case prev of Nothing -> do - createAnnexDirectory (parentDir f) + createAnnexDirectory (takeDirectory f) liftIO $ writeFile f $ show now return False Just prevtime -> do diff --git a/Command/Unlock.hs b/Command/Unlock.hs index 56c4f1dc0..75df99332 100644 --- a/Command/Unlock.hs +++ b/Command/Unlock.hs @@ -46,7 +46,7 @@ perform dest key = ifM (checkDiskSpace Nothing key 0) ( do src <- calcRepo $ gitAnnexLocation key tmpdest <- fromRepo $ gitAnnexTmpObjectLocation key - liftIO $ createDirectoryIfMissing True (parentDir tmpdest) + liftIO $ createDirectoryIfMissing True (takeDirectory tmpdest) showAction "copying" ifM (liftIO $ copyFileExternal CopyAllMetaData src tmpdest) ( do diff --git a/Command/Vicfg.hs b/Command/Vicfg.hs index 8fc10deb5..12a6084bd 100644 --- a/Command/Vicfg.hs +++ b/Command/Vicfg.hs @@ -39,7 +39,7 @@ seek = withNothing start start :: CommandStart start = do f <- fromRepo gitAnnexTmpCfgFile - createAnnexDirectory $ parentDir f + createAnnexDirectory $ takeDirectory f cfg <- getCfg descs <- uuidDescriptions liftIO $ writeFileAnyEncoding f $ genCfg cfg descs |