rmurl: New command, removes one of the recorded urls for a file.

This commit is contained in:
Joey Hess 2013-04-22 17:18:53 -04:00
parent 7e23ce6cef
commit 6be815a30c
5 changed files with 41 additions and 1 deletions

30
Command/RmUrl.hs Normal file
View file

@ -0,0 +1,30 @@
{- git-annex command
-
- Copyright 2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.RmUrl where
import Common.Annex
import Command
import Logs.Web
def :: [Command]
def = [notBareRepo $
command "rmurl" (paramPair paramFile paramUrl) seek
SectionCommon "record file is not available at url"]
seek :: [CommandSeek]
seek = [withPairs start]
start :: (FilePath, String) -> CommandStart
start (file, url) = flip whenAnnexed file $ \_ (key, _) -> do
showStart "rmurl" file
next $ next $ cleanup url key
cleanup :: String -> Key -> CommandCleanup
cleanup url key = do
setUrlMissing key url
return True