summaryrefslogtreecommitdiff
path: root/Remote/Helper
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-18 13:57:25 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-18 13:59:59 -0400
commita5e968bb8d4c608c33463160ea2b583a3e34b8fc (patch)
treeffd59e071fadf718ed4f270d2cf2b67fda9b6315 /Remote/Helper
parent9d2ac4d87dc98bd2ab60da38a7e98f0964fd1595 (diff)
add ExportTree table to export db
New table needed to look up what filenames are used in the currently exported tree, for reasons explained in export.mdwn. Also, added smart constructors for ExportLocation and ExportDirectory to make sure they contain filepaths with the right direction slashes. And some code refactoring. This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Remote/Helper')
-rw-r--r--Remote/Helper/Export.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Remote/Helper/Export.hs b/Remote/Helper/Export.hs
index df75dacd0..6f4811285 100644
--- a/Remote/Helper/Export.hs
+++ b/Remote/Helper/Export.hs
@@ -93,7 +93,7 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
-- Storing a key on an export would need a way to
-- look up the file(s) that the currently exported
-- tree uses for a key; there's not currently an
- -- inexpensive way to do that (getExportLocation
+ -- inexpensive way to do that (getExportedLocation
-- only finds files that have been stored on the
-- export already).
{ storeKey = \_ _ _ -> do
@@ -105,7 +105,7 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
, retrieveKeyFile = \k _af dest p -> unVerified $
if maybe False (isJust . verifyKeyContent) (maybeLookupBackendVariety (keyVariety k))
then do
- locs <- liftIO $ getExportLocation db k
+ locs <- liftIO $ getExportedLocation db k
case locs of
[] -> do
warning "unknown export location"
@@ -136,7 +136,7 @@ adjustExportable r = case M.lookup "exporttree" (config r) of
, checkPresent = \k -> do
ea <- exportActions r
anyM (checkPresentExport ea k)
- =<< liftIO (getExportLocation db k)
+ =<< liftIO (getExportedLocation db k)
, mkUnavailable = return Nothing
, getInfo = do
is <- getInfo r
@@ -155,10 +155,10 @@ removeEmptyDirectories ea db loc ks
ok <- allM (go removeexportdirectory)
(reverse (exportDirectories loc))
unless ok $ liftIO $ do
- -- Add back to export database, so this is
- -- tried again next time.
+ -- Add location back to export database,
+ -- so this is tried again next time.
forM_ ks $ \k ->
- addExportLocation db k loc
+ addExportedLocation db k loc
flushDbQueue db
return ok
where