summaryrefslogtreecommitdiff
path: root/Types/Remote.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-09-15 16:34:45 -0400
committerJoey Hess <joeyh@joeyh.name>2017-09-15 16:46:03 -0400
commite1f5c90c92ea4154b7ba6bac2f6e5e1ee3635d64 (patch)
treedaf4c95cb2dc9bb668145a9102c86146f7bb03a7 /Types/Remote.hs
parente54a05612e1f780f393883468c7f102d788b4261 (diff)
split out Types.Export
Diffstat (limited to 'Types/Remote.hs')
-rw-r--r--Types/Remote.hs26
1 files changed, 1 insertions, 25 deletions
diff --git a/Types/Remote.hs b/Types/Remote.hs
index adec329733..a734be9799 100644
--- a/Types/Remote.hs
+++ b/Types/Remote.hs
@@ -18,16 +18,12 @@ module Types.Remote
, Availability(..)
, Verification(..)
, unVerified
- , ExportLocation(..)
- , ExportDirectory(..)
, isExportSupported
, ExportActions(..)
- , exportedDirectories
)
where
import qualified Data.Map as M
-import qualified System.FilePath.Posix as Posix
import Data.Ord
import qualified Git
@@ -38,6 +34,7 @@ import Types.Availability
import Types.Creds
import Types.UrlContents
import Types.NumCopies
+import Types.Export
import Config.Cost
import Utility.Metered
import Git.Types (RemoteName)
@@ -161,15 +158,6 @@ unVerified a = do
ok <- a
return (ok, UnVerified)
--- A location on a remote that a key can be exported to.
--- The FilePath will be relative, and may contain unix-style path
--- separators.
-newtype ExportLocation = ExportLocation FilePath
- deriving (Show, Eq)
-
-newtype ExportDirectory = ExportDirectory FilePath
- deriving (Show, Eq)
-
isExportSupported :: RemoteA a -> a Bool
isExportSupported r = exportSupported (remotetype r) (config r) (gitconfig r)
@@ -200,15 +188,3 @@ data ExportActions a = ExportActions
-- support renames.
, renameExport :: Key -> ExportLocation -> ExportLocation -> a Bool
}
-
--- | All subdirectories down to the ExportLocation, with the deepest ones
--- last. Does not include the top of the export.
-exportedDirectories :: ExportLocation -> [ExportDirectory]
-exportedDirectories (ExportLocation f) =
- map (ExportDirectory . Posix.joinPath . reverse) (subs [] dirs)
- where
- subs _ [] = []
- subs ps (d:ds) = (d:ps) : subs (d:ps) ds
-
- dirs = map Posix.dropTrailingPathSeparator $
- reverse $ drop 1 $ reverse $ Posix.splitPath f