diff options
author | 2011-10-31 12:33:41 -0400 | |
---|---|---|
committer | 2011-10-31 12:33:41 -0400 | |
commit | cc1ea8f84463c7e333bfa17a815f250d8d088841 (patch) | |
tree | aa4868f5b59edf4cbb3b34d5ae16f19d06804efa /Command/SetKey.hs | |
parent | e09dd6f306b3f69718c77a03364ee9e51a51bb3b (diff) |
Removed the setkey command, and added a setcontent command with a more useful interface.
Diffstat (limited to 'Command/SetKey.hs')
-rw-r--r-- | Command/SetKey.hs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/Command/SetKey.hs b/Command/SetKey.hs deleted file mode 100644 index 0c70d12b0..000000000 --- a/Command/SetKey.hs +++ /dev/null @@ -1,48 +0,0 @@ -{- git-annex command - - - - Copyright 2010 Joey Hess <joey@kitenet.net> - - - - Licensed under the GNU GPL version 3 or higher. - -} - -module Command.SetKey where - -import Common.Annex -import Command -import Logs.Location -import Annex.Content -import Config - -def :: [Command] -def = [command "setkey" paramPath seek - "sets annexed content for a key using a temp file"] - -seek :: [CommandSeek] -seek = [withStrings start] - -{- Sets cached content for a key. -} -start :: FilePath -> CommandStart -start file = do - showStart "setkey" file - next $ perform file - -perform :: FilePath -> CommandPerform -perform file = do - key <- cmdlineKey - -- the file might be on a different filesystem, so mv is used - -- rather than simply calling moveToObjectDir; disk space is also - -- checked this way. - ok <- getViaTmp key $ \dest -> - if dest /= file - then liftIO $ - boolSystem "mv" [File file, File dest] - else return True - if ok - then next cleanup - else error "mv failed!" - -cleanup :: CommandCleanup -cleanup = do - key <- cmdlineKey - logStatus key InfoPresent - return True |