Hello community, here is the log from the commit of package ghc-cmdargs for openSUSE:Factory checked in at 2017-04-14 13:41:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-cmdargs (Old) and /work/SRC/openSUSE:Factory/.ghc-cmdargs.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-cmdargs" Fri Apr 14 13:41:21 2017 rev:5 rq:487384 version:0.10.17 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-cmdargs/ghc-cmdargs.changes 2016-07-21 08:08:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-cmdargs.new/ghc-cmdargs.changes 2017-04-14 13:41:22.896350415 +0200 @@ -1,0 +2,15 @@ +Tue Apr 4 11:04:10 UTC 2017 - psim...@suse.com + +- Update to version 0.10.17 with cabal2obs. + +------------------------------------------------------------------- +Mon Mar 27 12:40:22 UTC 2017 - psim...@suse.com + +- Update to version 0.10.16 with cabal2obs. + +------------------------------------------------------------------- +Tue Mar 14 09:26:34 UTC 2017 - psim...@suse.com + +- Update to version 0.10.15 with cabal2obs. + +------------------------------------------------------------------- Old: ---- cmdargs-0.10.14.tar.gz New: ---- cmdargs-0.10.17.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-cmdargs.spec ++++++ --- /var/tmp/diff_new_pack.5WHgZc/_old 2017-04-14 13:41:23.844216451 +0200 +++ /var/tmp/diff_new_pack.5WHgZc/_new 2017-04-14 13:41:23.848215885 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-cmdargs # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,22 +18,20 @@ %global pkg_name cmdargs Name: ghc-%{pkg_name} -Version: 0.10.14 +Version: 0.10.17 Release: 0 Summary: Command line argument processing License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel -# Begin cabal-rpm deps: BuildRequires: ghc-filepath-devel BuildRequires: ghc-process-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-template-haskell-devel BuildRequires: ghc-transformers-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -# End cabal-rpm deps %description This library provides an easy way to define command line parsers. Most users @@ -69,15 +67,12 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install - %post devel %ghc_pkg_recache @@ -90,6 +85,6 @@ %files devel -f %{name}-devel.files %defattr(-,root,root,-) -%doc README.md +%doc CHANGES.txt README.md %changelog ++++++ cmdargs-0.10.14.tar.gz -> cmdargs-0.10.17.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/CHANGES.txt new/cmdargs-0.10.17/CHANGES.txt --- old/cmdargs-0.10.14/CHANGES.txt 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/CHANGES.txt 2017-03-31 21:30:36.000000000 +0200 @@ -1,5 +1,12 @@ Changelog for CmdArgs +0.10.17 + Add processValueIO for more controlled error messages + #529, don't include the stack trace in processValue +0.10.16 + Minor improvement to error messages +0.10.15 + #43, GHC 8.2 compatibility 0.10.14 #39, ensure correct line breaks in HTML help output #18, preserve manual \n in help messages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/Data/Generics/Any.hs new/cmdargs-0.10.17/Data/Generics/Any.hs --- old/cmdargs-0.10.14/Data/Generics/Any.hs 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/Data/Generics/Any.hs 2017-03-31 21:30:36.000000000 +0200 @@ -8,7 +8,6 @@ import Data.Data hiding (toConstr, typeOf, dataTypeOf, isAlgType) import Data.List import Data.Maybe -import qualified Data.Typeable.Internal as I import System.IO.Unsafe @@ -67,7 +66,7 @@ typeShell = tyconUQname . typeShellFull typeShellFull :: Any -> String -typeShellFull = I.tyConName . typeRepTyCon . typeOf +typeShellFull = tyConName . typeRepTyCon . typeOf typeName :: Any -> String typeName = show . typeOf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/LICENSE new/cmdargs-0.10.17/LICENSE --- old/cmdargs-0.10.14/LICENSE 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/LICENSE 2017-03-31 21:30:36.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright Neil Mitchell 2009-2016. +Copyright Neil Mitchell 2009-2017. All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/README.md new/cmdargs-0.10.17/README.md --- old/cmdargs-0.10.14/README.md 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/README.md 2017-03-31 21:30:36.000000000 +0200 @@ -1,4 +1,4 @@ -# CmdArgs: Easy Command Line Processing [![Hackage version](https://img.shields.io/hackage/v/cmdargs.svg?style=flat)](https://hackage.haskell.org/package/cmdargs) [![Build Status](https://img.shields.io/travis/ndmitchell/cmdargs.svg?style=flat)](https://travis-ci.org/ndmitchell/cmdargs) +# CmdArgs: Easy Command Line Processing [![Hackage version](https://img.shields.io/hackage/v/cmdargs.svg?label=Hackage)](https://hackage.haskell.org/package/cmdargs) [![Build Status](https://img.shields.io/travis/ndmitchell/cmdargs.svg)](https://travis-ci.org/ndmitchell/cmdargs) CmdArgs is a Haskell library for defining command line parsers. The two features that make it a better choice than the standard [getopt library](http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html) are: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/System/Console/CmdArgs/Explicit/Type.hs new/cmdargs-0.10.17/System/Console/CmdArgs/Explicit/Type.hs --- old/cmdargs-0.10.14/System/Console/CmdArgs/Explicit/Type.hs 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/System/Console/CmdArgs/Explicit/Type.hs 2017-03-31 21:30:36.000000000 +0200 @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} module System.Console.CmdArgs.Explicit.Type where @@ -7,9 +6,8 @@ import Data.Char import Data.List import Data.Maybe -#if __GLASGOW_HASKELL__ < 709 import Data.Monoid -#endif +import Prelude -- | A name, either the name of a flag (@--/foo/@) or the name of a mode. @@ -181,11 +179,14 @@ --------------------------------------------------------------------- -- REMAP +-- | Like functor, but where the the argument isn't just covariant. class Remap m where + -- | Convert between two values. remap :: (a -> b) -- ^ Embed a value -> (b -> (a, a -> b)) -- ^ Extract the mode and give a way of re-embedding -> m a -> m b +-- | Restricted version of 'remap' where the values are isomorphic. remap2 :: Remap m => (a -> b) -> (b -> a) -> m a -> m b remap2 f g = remap f (\x -> (g x, f)) @@ -204,6 +205,8 @@ instance Remap Arg where remap f g x = x{argValue = remapUpdate f g $ argValue x} +-- | Version of 'remap' for the 'Update' type alias. +remapUpdate :: (a -> b) -> (b -> (a, a -> b)) -> Update a -> Update b remapUpdate f g upd = \s v -> let (a,b) = g v in fmap b $ upd s a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/System/Console/CmdArgs/Explicit.hs new/cmdargs-0.10.17/System/Console/CmdArgs/Explicit.hs --- old/cmdargs-0.10.14/System/Console/CmdArgs/Explicit.hs 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/System/Console/CmdArgs/Explicit.hs 2017-03-31 21:30:36.000000000 +0200 @@ -1,4 +1,4 @@ -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ScopedTypeVariables, CPP #-} {-| This module constructs command lines. You may either use the helper functions ('flagNone', 'flagOpt', 'mode' etc.) or construct the type directly. These @@ -53,7 +53,7 @@ -} module System.Console.CmdArgs.Explicit( -- * Running command lines - process, processArgs, processValue, + process, processArgs, processValue, processValueIO, -- * Constructing command lines module System.Console.CmdArgs.Explicit.Type, flagHelpSimple, flagHelpFormat, flagVersion, flagNumericVersion, flagsVerbosity, @@ -112,7 +112,7 @@ let var = mplus (lookup ("CMDARGS_HELPER_" ++ show (map toUpper $ head $ modeNames m ++ [nam])) env) (lookup "CMDARGS_HELPER" env) case var of - Nothing -> run =<< (if modeExpandAt m then expandArgsAt else return) =<< getArgs + Nothing -> processValueIO m =<< (if modeExpandAt m then expandArgsAt else return) =<< getArgs Just cmd -> do res <- execute cmd m [] case res of @@ -120,11 +120,7 @@ hPutStrLn stderr $ "Error when running helper " ++ cmd hPutStrLn stderr err exitFailure - Right args -> run args - where - run args = case process m args of - Left x -> do hPutStrLn stderr x; exitFailure - Right x -> return x + Right args -> processValueIO m args readMay :: Read a => String -> Maybe a @@ -133,16 +129,29 @@ _ -> Nothing --- | Process a list of flags (usually obtained from @'getArgs'@ and @'expandArgsAt'@) with a mode. Displays --- an error and exits with failure if the command line fails to parse, or returns +#if __GLASGOW_HASKELL__ < 800 +errorWithoutStackTrace :: String -> a +errorWithoutStackTrace = error +#endif + +-- | Process a list of flags (usually obtained from @'getArgs'@ and @'expandArgsAt'@) with a mode. +-- Throws an error if the command line fails to parse, or returns -- the associated value. Implemeneted in terms of 'process'. This function -- does not take account of any environment variables that may be set -- (see 'processArgs'). +-- +-- If you are in 'IO' you will probably get a better user experience by calling 'processValueIO'. processValue :: Mode a -> [String] -> a processValue m xs = case process m xs of - Left x -> error x + Left x -> errorWithoutStackTrace x Right x -> x +-- | Like 'processValue' but on failure prints to stderr and exits the program. +processValueIO :: Mode a -> [String] -> IO a +processValueIO m xs = case process m xs of + Left x -> do hPutStrLn stderr x; exitFailure + Right x -> return x + -- | Create a help flag triggered by @-?@/@--help@. flagHelpSimple :: (a -> a) -> Flag a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/System/Console/CmdArgs/Implicit/Reader.hs new/cmdargs-0.10.17/System/Console/CmdArgs/Implicit/Reader.hs --- old/cmdargs-0.10.14/System/Console/CmdArgs/Implicit/Reader.hs 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/System/Console/CmdArgs/Implicit/Reader.hs 2017-03-31 21:30:36.000000000 +0200 @@ -76,9 +76,9 @@ where xs = [(map toLower c, compose0 x c) | c <- ctors x] - rd s | null ys = Left $ "Could not read, expected one of: " ++ unwords (map fst xs) + rd s | null ys = Left $ "Could not read " ++ show s ++ ", expected one of: " ++ unwords (map fst xs) | Just (_,x) <- find ((==) s . fst) ys = Right x - | length ys > 1 = Left $ "Ambiguous read, could be any of: " ++ unwords (map fst ys) + | length ys > 1 = Left $ "Ambiguous read for " ++ show s ++ ", could be any of: " ++ unwords (map fst ys) | otherwise = Right $ snd $ head ys where ys = filter (isPrefixOf s . fst) xs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cmdargs-0.10.14/cmdargs.cabal new/cmdargs-0.10.17/cmdargs.cabal --- old/cmdargs-0.10.14/cmdargs.cabal 2016-02-16 12:21:26.000000000 +0100 +++ new/cmdargs-0.10.17/cmdargs.cabal 2017-03-31 21:30:36.000000000 +0200 @@ -1,13 +1,13 @@ -cabal-version: >= 1.6 +cabal-version: >= 1.18 build-type: Simple name: cmdargs -version: 0.10.14 +version: 0.10.17 license: BSD3 license-file: LICENSE category: Console author: Neil Mitchell <ndmitch...@gmail.com> maintainer: Neil Mitchell <ndmitch...@gmail.com> -copyright: Neil Mitchell 2009-2016 +copyright: Neil Mitchell 2009-2017 synopsis: Command line argument processing description: This library provides an easy way to define command line parsers. Most users @@ -33,7 +33,7 @@ extra-doc-files: README.md CHANGES.txt -tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 source-repository head type: git @@ -41,13 +41,16 @@ flag testprog default: False + manual: True description: Build the test program flag quotation default: True + manual: True description: Build the Quote module library + default-language: Haskell2010 build-depends: base >= 4.4 && < 5, filepath, @@ -58,7 +61,7 @@ build-depends: template-haskell exposed-modules: System.Console.CmdArgs.Quote -- See bug #539 for why this magic is required - extensions: TemplateHaskell + other-extensions: TemplateHaskell exposed-modules: System.Console.CmdArgs @@ -89,9 +92,11 @@ System.Console.CmdArgs.Implicit.UI executable cmdargs + default-language: Haskell2010 main-is: Main.hs - if flag(quotation) - extensions: TemplateHaskell + other-extensions: TemplateHaskell + build-depends: + base, transformers, filepath, process, template-haskell if flag(testprog) && flag(quotation) buildable: True else