mostly finished with createDirectoryUnder conversion

Remaining things needing converted are in the assistant, and Annex.Ssh.

Every other remaining call to createDirectoryIfMissing True has been
audited and is not relevant. The ones in Build/ of course don't get
included in the program. Others included eg, Remote.Tahoe and
Config.Files which both write to dotfiles under the home directory.
This commit is contained in:
Joey Hess 2020-03-06 11:57:15 -04:00
parent 2f204b5d37
commit 7f992ef59c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 30 additions and 23 deletions

View file

@ -49,6 +49,7 @@ import qualified Remote.Helper.Ssh as Ssh
import Utility.Metered
import Annex.UUID
import Annex.Ssh
import Annex.Perms
import qualified Remote.Rsync
import qualified Remote.Directory
import Utility.Rsync
@ -283,7 +284,7 @@ setupRepo gcryptid r
- which is needed for direct rsync of objects to work.
-}
rsyncsetup = Remote.Rsync.withRsyncScratchDir $ \tmp -> do
liftIO $ createDirectoryIfMissing True $ tmp </> objectDir
createAnnexDirectory (tmp </> objectDir)
dummycfg <- liftIO dummyRemoteGitConfig
(rsynctransport, rsyncurl, _) <- rsyncTransport r dummycfg
let tmpconfig = tmp </> "config"
@ -368,7 +369,7 @@ store' repo r rsyncopts
| not $ Git.repoIsUrl repo =
byteStorer $ \k b p -> guardUsable repo (return False) $ liftIO $ do
let tmpdir = Git.repoLocation repo </> "tmp" </> fromRawFilePath (keyFile k)
void $ tryIO $ createDirectoryIfMissing True tmpdir
void $ tryIO $ createDirectoryUnder (Git.repoLocation repo) tmpdir
let tmpf = tmpdir </> fromRawFilePath (keyFile k)
meteredWriteFile p tmpf b
let destdir = parentDir $ gCryptLocation repo k