aboutsummaryrefslogtreecommitdiff
path: root/Command/Optimize.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Optimize.hs')
-rw-r--r--Command/Optimize.hs34
1 files changed, 0 insertions, 34 deletions
diff --git a/Command/Optimize.hs b/Command/Optimize.hs
deleted file mode 100644
index 1a2b2237f..000000000
--- a/Command/Optimize.hs
+++ /dev/null
@@ -1,34 +0,0 @@
-{- git-annex command
- -
- - Copyright 2011 Joey Hess <joey@kitenet.net>
- -
- - Licensed under the GNU GPL version 3 or higher.
- -}
-
-module Command.Optimize where
-
-import Command
-import Utility
-import LocationLog
-import Trust
-import Config
-import qualified Command.Get
-import qualified Command.Drop
-
-command :: [Command]
-command = [repoCommand "optimize" (paramOptional $ paramRepeating paramPath) seek
- "get or drop content to best use available space"]
-
-seek :: [CommandSeek]
-seek = [withNumCopies start]
-
-start :: CommandStartAttrFile
-start p@(file, attr) = notBareRepo $ isAnnexed file $ \(key, _) -> do
- needed <- getNumCopies $ readMaybe attr
- (_, safelocations) <- trustPartition UnTrusted =<< keyLocations key
- dispatch needed (length safelocations)
- where
- dispatch needed present
- | present < needed = Command.Get.start file
- | present > needed = Command.Drop.start p
- | otherwise = stop