first pass at using new keys
It compiles. It sorta works. Several subcommands are FIXME marked and broken, because things that used to accept separate --backend and --key params need to be changed to accept just a --key that encodes all the key info, now that there is metadata in keys.
This commit is contained in:
parent
675ee89749
commit
9d49fe2c17
20 changed files with 116 additions and 123 deletions
13
Command.hs
13
Command.hs
|
@ -17,11 +17,13 @@ import Data.List
|
|||
|
||||
import Types
|
||||
import qualified Backend
|
||||
import qualified BackendTypes
|
||||
import Messages
|
||||
import qualified Annex
|
||||
import qualified GitRepo as Git
|
||||
import Locations
|
||||
import Utility
|
||||
import Key
|
||||
|
||||
{- A command runs in four stages.
|
||||
-
|
||||
|
@ -233,11 +235,14 @@ cmdlineKey :: Annex Key
|
|||
cmdlineKey = do
|
||||
k <- Annex.getState Annex.defaultkey
|
||||
backends <- Backend.list
|
||||
return $ genKey (head backends) (keyname' k)
|
||||
return $ stubKey {
|
||||
keyName = kname k,
|
||||
keyBackendName = BackendTypes.name $ head backends
|
||||
}
|
||||
where
|
||||
keyname' Nothing = badkey
|
||||
keyname' (Just "") = badkey
|
||||
keyname' (Just n) = n
|
||||
kname Nothing = badkey
|
||||
kname (Just "") = badkey
|
||||
kname (Just n) = n
|
||||
badkey = error "please specify the key with --key"
|
||||
|
||||
{- Given an original list of files, and an expanded list derived from it,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue