summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistairWard <>2020-08-10 10:37:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-08-10 10:37:00 (GMT)
commitee2dc2d9bb1ce94fcfdc455f1151dbba3b03f5c4 (patch)
treecf667dbb7fe7ea691a941c2f5c32b44f20e280cf
parentc17d25c856871fbf9f8acdf82e883e63eafc4a67 (diff)
version 1.0.4.19HEAD1.0.4.19master
-rwxr-xr-x[-rw-r--r--].ghci0
-rwxr-xr-x[-rw-r--r--]README.markdown0
-rwxr-xr-x[-rw-r--r--]changelog.Debian0
-rwxr-xr-x[-rw-r--r--]changelog.markdown4
-rwxr-xr-x[-rw-r--r--]copyright0
-rwxr-xr-x[-rw-r--r--]debian/DEBIAN/control2
-rwxr-xr-x[-rw-r--r--]man/man1/squeeze.10
-rw-r--r--squeeze.cabal3
-rwxr-xr-x[-rw-r--r--]squeeze.spec2
-rw-r--r--src-exe/Main.hs4
-rw-r--r--src-lib/Squeeze/Data/CommandOptions.hs16
-rw-r--r--src-lib/Squeeze/Data/Verbosity.hs55
-rw-r--r--src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs8
13 files changed, 77 insertions, 17 deletions
diff --git a/.ghci b/.ghci
index 5647b0d..5647b0d 100644..100755
--- a/.ghci
+++ b/.ghci
diff --git a/README.markdown b/README.markdown
index e65f9fe..e65f9fe 100644..100755
--- a/README.markdown
+++ b/README.markdown
diff --git a/changelog.Debian b/changelog.Debian
index 9efe60b..9efe60b 100644..100755
--- a/changelog.Debian
+++ b/changelog.Debian
diff --git a/changelog.markdown b/changelog.markdown
index 4c87605..7f32900 100644..100755
--- a/changelog.markdown
+++ b/changelog.markdown
@@ -172,3 +172,7 @@ Changed references to author's domain-name.
## 1.0.4.18
Updated list of test-compilers.
+
+## 1.0.4.19
+Replaced module **Distribution.Verbosity** with **Squeeze.Data.Verbosity**.
+
diff --git a/copyright b/copyright
index 1d56894..1d56894 100644..100755
--- a/copyright
+++ b/copyright
diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control
index f07b942..5cf05b5 100644..100755
--- a/debian/DEBIAN/control
+++ b/debian/DEBIAN/control
@@ -1,5 +1,5 @@
Package: squeeze
-Version: 1.0.4.18-1
+Version: 1.0.4.19-1
Section: utils
Priority: optional
Architecture: amd64
diff --git a/man/man1/squeeze.1 b/man/man1/squeeze.1
index 18ef657..18ef657 100644..100755
--- a/man/man1/squeeze.1
+++ b/man/man1/squeeze.1
diff --git a/squeeze.cabal b/squeeze.cabal
index a5e016b..84b472a 100644
--- a/squeeze.cabal
+++ b/squeeze.cabal
@@ -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 @@ Library
Squeeze.Data.CommandOptions
Squeeze.Data.File
Squeeze.Data.FileCombination
+ Squeeze.Data.Verbosity
Squeeze.Squeeze
-- Required for 'cabal sdist'.
diff --git a/squeeze.spec b/squeeze.spec
index c681de8..abd0e9d 100644..100755
--- a/squeeze.spec
+++ b/squeeze.spec
@@ -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'.
diff --git a/src-exe/Main.hs b/src-exe/Main.hs
index 39cafb6..3808d76 100644
--- a/src-exe/Main.hs
+++ b/src-exe/Main.hs
@@ -42,11 +42,11 @@ import qualified Data.Default
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 @@ main = do
-- 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.",
diff --git a/src-lib/Squeeze/Data/CommandOptions.hs b/src-lib/Squeeze/Data/CommandOptions.hs
index 6622b59..34cba15 100644
--- a/src-lib/Squeeze/Data/CommandOptions.hs
+++ b/src-lib/Squeeze/Data/CommandOptions.hs
@@ -47,18 +47,18 @@ module Squeeze.Data.CommandOptions(
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 @@ instance Fractional f => Data.Default.Default (CommandOptions f) where
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 @@ mkCommandOptions
-> 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
diff --git a/src-lib/Squeeze/Data/Verbosity.hs b/src-lib/Squeeze/Data/Verbosity.hs
new file mode 100644
index 0000000..e6a5668
--- /dev/null
+++ b/src-lib/Squeeze/Data/Verbosity.hs
@@ -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]
+
diff --git a/src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs b/src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs
index cf3bef4..577a853 100644
--- a/src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs
+++ b/src-test/Squeeze/Test/QuickCheck/Data/Verbosity.hs
@@ -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