From cc1ea8f84463c7e333bfa17a815f250d8d088841 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Oct 2011 12:33:41 -0400 Subject: Removed the setkey command, and added a setcontent command with a more useful interface. --- Command/SetKey.hs | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 Command/SetKey.hs (limited to 'Command/SetKey.hs') 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 - - - - 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 -- cgit v1.2.3