squeeze 1.0.4.18 → 1.0.4.19
raw patch · 8 files changed
+77/−17 lines, 8 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Squeeze.Data.Verbosity: data Verbosity
+ Squeeze.Data.Verbosity: instance Data.Default.Class.Default Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Classes.Eq Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Classes.Ord Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Enum.Bounded Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Enum.Enum Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Read.Read Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: instance GHC.Show.Show Squeeze.Data.Verbosity.Verbosity
+ Squeeze.Data.Verbosity: range :: [Verbosity]
Files
- changelog.markdown +4/−0
- debian/DEBIAN/control +1/−1
- squeeze.cabal +2/−1
- squeeze.spec +1/−1
- src-exe/Main.hs +2/−2
- src-lib/Squeeze/Data/CommandOptions.hs +8/−8
- src-lib/Squeeze/Data/Verbosity.hs +55/−0
- src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs +4/−4
changelog.markdown view
@@ -172,3 +172,7 @@ ## 1.0.4.18 Updated list of test-compilers.++## 1.0.4.19+Replaced module **Distribution.Verbosity** with **Squeeze.Data.Verbosity**.+
debian/DEBIAN/control view
@@ -1,5 +1,5 @@ Package: squeeze-Version: 1.0.4.18-1+Version: 1.0.4.19-1 Section: utils Priority: optional Architecture: amd64
squeeze.cabal view
@@ -14,7 +14,7 @@ -- along with Squeeze. If not, see <http://www.gnu.org/licenses/>. Name: squeeze-Version: 1.0.4.18+Version: 1.0.4.19 Cabal-version: >= 1.10 Copyright: (C) 2010-2015 Dr. Alistair Ward License: GPL@@ -65,6 +65,7 @@ Squeeze.Data.CommandOptions Squeeze.Data.File Squeeze.Data.FileCombination+ Squeeze.Data.Verbosity Squeeze.Squeeze -- Required for 'cabal sdist'.
squeeze.spec view
@@ -21,7 +21,7 @@ Summary: Finds the optimal subset of the specified files, to fit into a limited space, with minimal wastage Name: squeeze-Version: 1.0.4.18+Version: 1.0.4.19 Release: 1 License: GPLv3 # From '/usr/share/doc/packages/rpm/GROUPS'.
src-exe/Main.hs view
@@ -42,11 +42,11 @@ import qualified Data.List import qualified Data.Maybe import qualified Data.Version-import qualified Distribution.Verbosity import qualified Factory.Math.Probability import qualified Paths_squeeze as Paths -- Either local stub, or package-instance autogenerated by 'Setup.hs build'. import qualified Squeeze.Data.CommandOptions as Data.CommandOptions import qualified Squeeze.Data.File as Data.File+import qualified Squeeze.Data.Verbosity as Data.Verbosity import qualified Squeeze.Squeeze as Squeeze import qualified Squeeze.Test.Performance as Test.Performance import qualified System.Console.GetOpt as G@@ -117,7 +117,7 @@ -- String [String] (G.ArgDescr CommandLineAction) String G.Option "?" ["help"] (G.NoArg $ const printUsage) "Display this help, & then exit.", G.Option "" ["verbosity"] (- setVerbosity `G.ReqArg` ToolShed.Data.List.showListWith listDelimiters [minBound :: Distribution.Verbosity.Verbosity .. maxBound] ""+ setVerbosity `G.ReqArg` ToolShed.Data.List.showListWith listDelimiters [minBound :: Data.Verbosity.Verbosity .. maxBound] "" ) ("Define the log-level; default '" ++ show (Data.CommandOptions.getVerbosity defaultCommandOptions) ++ "'. CAVEAT: to be effective, it must precede other options." ), G.Option "v" ["version"] (G.NoArg $ const printVersion) "Print version-information, & then exit.",
src-lib/Squeeze/Data/CommandOptions.hs view
@@ -47,18 +47,18 @@ import Control.Arrow((&&&)) import qualified Data.Default-import qualified Distribution.Verbosity import qualified Factory.Data.Interval import qualified Squeeze.Data.File as Data.File+import qualified Squeeze.Data.Verbosity as Data.Verbosity import qualified ToolShed.SelfValidate -- | Declares a record to contain command-line options. data CommandOptions ratio = MkCommandOptions {- getIncludeEmpty :: Bool, -- ^ Whether empty directories or files should be included in any solution.- getMaximumBytes :: Data.File.FileSize, -- ^ The maximum space (in bytes) available in which to store a subset of the specified files.- getMaybeRandomSeed :: Maybe Int, -- ^ Optionally seed the random-number generator to produce a repeatable pseudo-random sequence.- getMinimumUsageRatio :: ratio, -- ^ The minimum acceptable usage-ratio of 'getMaximumBytes'.- getVerbosity :: Distribution.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output.+ getIncludeEmpty :: Bool, -- ^ Whether empty directories or files should be included in any solution.+ getMaximumBytes :: Data.File.FileSize, -- ^ The maximum space (in bytes) available in which to store a subset of the specified files.+ getMaybeRandomSeed :: Maybe Int, -- ^ Optionally seed the random-number generator to produce a repeatable pseudo-random sequence.+ getMinimumUsageRatio :: ratio, -- ^ The minimum acceptable usage-ratio of 'getMaximumBytes'.+ getVerbosity :: Data.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output. } deriving (Eq, Show) instance Fractional f => Data.Default.Default (CommandOptions f) where@@ -67,7 +67,7 @@ getMaximumBytes = 4700000000, -- DVD-size; just under 4.4GiB. getMaybeRandomSeed = Nothing, getMinimumUsageRatio = 9 / 10, -- 90% full.- getVerbosity = Distribution.Verbosity.normal+ getVerbosity = Data.Default.def } instance Real ratio => ToolShed.SelfValidate.SelfValidator (CommandOptions ratio) where@@ -84,7 +84,7 @@ -> Data.File.FileSize -> Maybe Int -> ratio- -> Distribution.Verbosity.Verbosity+ -> Data.Verbosity.Verbosity -> CommandOptions ratio mkCommandOptions includeEmpty maximumBytes maybeRandomSeed minimumUsageRatio verbosity | ToolShed.SelfValidate.isValid commandOptions = commandOptions
+ src-lib/Squeeze/Data/Verbosity.hs view
@@ -0,0 +1,55 @@+{-+ Copyright (C) 2018 Dr. Alistair Ward++ This file is part of Squeeze.++ Squeeze is free software: you can redistribute it and/or modify+ it under the terms of the GNU General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ Squeeze is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU General Public License for more details.++ You should have received a copy of the GNU General Public License+ along with Squeeze. If not, see <http://www.gnu.org/licenses/>.+-}+{- |+ [@AUTHOR@] Dr. Alistair Ward++ [@DESCRIPTION@]+ The levels of program-output.+ N.B.: the data-type is coincidentally similar to 'Distribution.Verbosity.Internal.VerbosityLevel'.+-}++module Squeeze.Data.Verbosity(+-- * Types+-- ** Data-types+ Verbosity(),+-- * Constants+ range+) where++import qualified Data.Default++-- | Define the levels of program-output.+data Verbosity+ = Silent+ | Normal+ | Verbose+ | Deafening+ deriving (Enum, Eq, Ord, Read, Show)++instance Bounded Verbosity where+ minBound = Silent+ maxBound = Deafening++instance Data.Default.Default Verbosity where+ def = Normal++-- | The constant complete range of values.+range :: [Verbosity]+range = [minBound .. maxBound]+
src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs view
@@ -18,13 +18,13 @@ {- | [@AUTHOR@] Dr. Alistair Ward - [@DESCRIPTION@] Implements 'Test.QuickCheck.Arbitrary' for 'Distribution.Verbosity.Verbosity'.+ [@DESCRIPTION@] Implements 'Test.QuickCheck.Arbitrary'. -} module Squeeze.Test.QuickCheck.Data.Verbosity() where -import qualified Distribution.Verbosity+import qualified Squeeze.Data.Verbosity as Data.Verbosity import qualified Test.QuickCheck -instance Test.QuickCheck.Arbitrary Distribution.Verbosity.Verbosity where- arbitrary = Test.QuickCheck.elements [minBound .. maxBound]+instance Test.QuickCheck.Arbitrary Data.Verbosity.Verbosity where+ arbitrary = Test.QuickCheck.elements Data.Verbosity.range