summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-11 12:47:57 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-11 12:47:57 -0400
commitbc0bf97b20c48e1d1a35d25e2e76a311c102438c (patch)
tree05934001ff6b3060cb477a1bd017316827eb050b /Types
parent7f5e752b41b559bce358a9d6a053a7b195706e80 (diff)
let url claims optionally include a suggested filename
Diffstat (limited to 'Types')
-rw-r--r--Types/Remote.hs3
-rw-r--r--Types/URLClaim.hs11
2 files changed, 13 insertions, 1 deletions
diff --git a/Types/Remote.hs b/Types/Remote.hs
index baa857906..bb56bb01d 100644
--- a/Types/Remote.hs
+++ b/Types/Remote.hs
@@ -25,6 +25,7 @@ import Types.UUID
import Types.GitConfig
import Types.Availability
import Types.Creds
+import Types.URLClaim
import Config.Cost
import Utility.Metered
import Git.Types
@@ -103,7 +104,7 @@ data RemoteA a = Remote {
-- Information about the remote, for git annex info to display.
getInfo :: a [(String, String)],
-- Some remotes can download from an url (or uri).
- claimUrl :: Maybe (URLString -> a Bool),
+ claimUrl :: Maybe (URLString -> a (Maybe URLClaim)),
-- Checks that the url is accessible, and gets the size of its
-- content. Returns Nothing if the url is accessible, but
-- its size cannot be determined inexpensively.
diff --git a/Types/URLClaim.hs b/Types/URLClaim.hs
new file mode 100644
index 000000000..f14333111
--- /dev/null
+++ b/Types/URLClaim.hs
@@ -0,0 +1,11 @@
+{- git-annex url claiming
+ -
+ - Copyright 2014 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Types.URLClaim where
+
+data URLClaim = URLClaimed | URLClaimedAs FilePath
+ deriving (Eq)