diff --git a/ShellCheck-skip-TemplateHaskell-on-ARM.patch b/ShellCheck-disable-TemplateHaskell-runTests.patch similarity index 53% rename from ShellCheck-skip-TemplateHaskell-on-ARM.patch rename to ShellCheck-disable-TemplateHaskell-runTests.patch index 824805d..c1a95c9 100644 --- a/ShellCheck-skip-TemplateHaskell-on-ARM.patch +++ b/ShellCheck-disable-TemplateHaskell-runTests.patch @@ -1,6 +1,29 @@ -diff -up ShellCheck-0.3.4/ShellCheck/Analytics.hs~ ShellCheck-0.3.4/ShellCheck/Analytics.hs ---- ShellCheck-0.3.4/ShellCheck/Analytics.hs~ 2014-07-09 10:52:01.000000000 +0900 -+++ ShellCheck-0.3.4/ShellCheck/Analytics.hs 2014-09-22 11:30:02.572576093 +0900 +diff -up ShellCheck-0.3.4/ShellCheck.cabal.orig ShellCheck-0.3.4/ShellCheck.cabal +--- ShellCheck-0.3.4/ShellCheck.cabal.orig 2014-07-09 10:52:01.000000000 +0900 ++++ ShellCheck-0.3.4/ShellCheck.cabal 2014-11-06 19:34:50.761660370 +0900 +@@ -41,8 +41,7 @@ library + json, + mtl, + parsec, +- regex-compat, +- QuickCheck >= 2.2 ++ regex-compat + exposed-modules: + ShellCheck.Analytics + ShellCheck.AST +@@ -61,8 +60,7 @@ executable shellcheck + json, + mtl, + parsec, +- regex-compat, +- QuickCheck >= 2.2 ++ regex-compat + main-is: shellcheck.hs + + test-suite test-shellcheck +diff -up ShellCheck-0.3.4/ShellCheck/Analytics.hs.orig ShellCheck-0.3.4/ShellCheck/Analytics.hs +--- ShellCheck-0.3.4/ShellCheck/Analytics.hs.orig 2014-07-09 10:52:01.000000000 +0900 ++++ ShellCheck-0.3.4/ShellCheck/Analytics.hs 2014-11-06 19:30:25.675907927 +0900 @@ -15,8 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -11,7 +34,15 @@ diff -up ShellCheck-0.3.4/ShellCheck/Analytics.hs~ ShellCheck-0.3.4/ShellCheck/A import Control.Arrow (first) import Control.Monad -@@ -2879,7 +2878,3 @@ checkFindActionPrecedence params = check +@@ -33,7 +32,6 @@ import ShellCheck.Data + import ShellCheck.Parser hiding (runTests) + import Text.Regex + import qualified Data.Map as Map +-import Test.QuickCheck.All (quickCheckAll) + + data Shell = Ksh | Zsh | Sh | Bash + deriving (Show, Eq) +@@ -2879,7 +2877,3 @@ checkFindActionPrecedence params = check param <- getLiteralString t return $ param `elem` strs warnFor t = warn (getId t) 2146 "This action ignores everything before the -o. Use \\( \\) to group." @@ -19,9 +50,9 @@ diff -up ShellCheck-0.3.4/ShellCheck/Analytics.hs~ ShellCheck-0.3.4/ShellCheck/A -return [] -runTests = $quickCheckAll - -diff -up ShellCheck-0.3.4/ShellCheck/Parser.hs~ ShellCheck-0.3.4/ShellCheck/Parser.hs ---- ShellCheck-0.3.4/ShellCheck/Parser.hs~ 2014-07-09 10:52:01.000000000 +0900 -+++ ShellCheck-0.3.4/ShellCheck/Parser.hs 2014-09-22 11:30:32.801636172 +0900 +diff -up ShellCheck-0.3.4/ShellCheck/Parser.hs.orig ShellCheck-0.3.4/ShellCheck/Parser.hs +--- ShellCheck-0.3.4/ShellCheck/Parser.hs.orig 2014-07-09 10:52:01.000000000 +0900 ++++ ShellCheck-0.3.4/ShellCheck/Parser.hs 2014-11-06 19:30:34.103931850 +0900 @@ -15,8 +15,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -33,7 +64,15 @@ diff -up ShellCheck-0.3.4/ShellCheck/Parser.hs~ ShellCheck-0.3.4/ShellCheck/Pars import ShellCheck.AST import ShellCheck.Data -@@ -2093,7 +2093,3 @@ parseShell filename contents = +@@ -33,7 +33,6 @@ import Prelude hiding (readList) + import System.IO + import Text.Parsec.Error + import GHC.Exts (sortWith) +-import Test.QuickCheck.All (quickCheckAll) + + backslash = char '\\' + linefeed = optional carriageReturn >> char '\n' +@@ -2093,7 +2092,3 @@ parseShell filename contents = lt x = trace (show x) x ltt t = trace (show t) @@ -41,10 +80,10 @@ diff -up ShellCheck-0.3.4/ShellCheck/Parser.hs~ ShellCheck-0.3.4/ShellCheck/Pars -return [] -runTests = $quickCheckAll - -diff -up ShellCheck-0.3.4/ShellCheck/Simple.hs~ ShellCheck-0.3.4/ShellCheck/Simple.hs ---- ShellCheck-0.3.4/ShellCheck/Simple.hs~ 2014-07-09 10:52:01.000000000 +0900 -+++ ShellCheck-0.3.4/ShellCheck/Simple.hs 2014-09-22 11:29:17.715486995 +0900 -@@ -15,15 +15,14 @@ +diff -up ShellCheck-0.3.4/ShellCheck/Simple.hs.orig ShellCheck-0.3.4/ShellCheck/Simple.hs +--- ShellCheck-0.3.4/ShellCheck/Simple.hs.orig 2014-07-09 10:52:01.000000000 +0900 ++++ ShellCheck-0.3.4/ShellCheck/Simple.hs 2014-11-06 19:30:46.321966530 +0900 +@@ -15,15 +15,13 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -} @@ -58,11 +97,10 @@ diff -up ShellCheck-0.3.4/ShellCheck/Simple.hs~ ShellCheck-0.3.4/ShellCheck/Simp import Text.Parsec.Pos import Data.List -import Test.QuickCheck.All (quickCheckAll) -+--import Test.QuickCheck.All (quickCheckAll) shellCheck :: String -> [AnalysisOption] -> [ShellCheckComment] shellCheck script options = -@@ -66,7 +65,3 @@ prop_commentDisablesAnalysisIssue1 = +@@ -66,7 +64,3 @@ prop_commentDisablesAnalysisIssue1 = null $ shellCheck "#shellcheck disable=SC2086\necho $1" [] prop_commentDisablesAnalysisIssue2 = null $ shellCheck "#shellcheck disable=SC2086\n#lol\necho $1" [] diff --git a/ShellCheck.spec b/ShellCheck.spec index 9947944..6146b14 100644 --- a/ShellCheck.spec +++ b/ShellCheck.spec @@ -1,37 +1,44 @@ %global pkg_name ShellCheck -%ifarch %(echo %{ghc_arches_with_ghci} | sed -e s/armv7hl//) -%bcond_without tests -%else +# re-enable after QuickCheck code moved out of main src files +# (see https://github.com/koalaman/shellcheck/issues/254) +#%%ifarch %(echo %{ghc_arches_with_ghci} | sed -e s/armv7hl//) +#%%bcond_without tests +#%%else +#%%bcond_with tests +#%%endif + +# disable all tests for now to avoid linking QuickCheck %bcond_with tests -%endif # no useful debuginfo for Haskell packages without C sources %global debug_package %{nil} -Name: %{pkg_name} -Version: 0.3.4 -Release: 2%{?dist} -Summary: Tool for checking common errors in POSIX shell scripts +Name: %{pkg_name} +Version: 0.3.4 +Release: 2%{?dist} +Summary: Tool for checking common errors in POSIX shell scripts -License: AGPLv3+ -URL: http://www.shellcheck.net/about.html -Source0: http://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz -Patch0: ShellCheck-skip-TemplateHaskell-on-ARM.patch +License: AGPLv3+ +URL: http://www.shellcheck.net/about.html +Source0: http://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz +Patch0: ShellCheck-disable-TemplateHaskell-runTests.patch -BuildRequires: ghc-Cabal-devel -BuildRequires: ghc-rpm-macros +BuildRequires: ghc-Cabal-devel +BuildRequires: ghc-rpm-macros # Begin cabal-rpm deps: -BuildRequires: chrpath -BuildRequires: ghc-QuickCheck-devel -BuildRequires: ghc-containers-devel -BuildRequires: ghc-directory-devel -BuildRequires: ghc-json-devel -BuildRequires: ghc-mtl-devel -BuildRequires: ghc-parsec-devel -BuildRequires: ghc-regex-compat-devel +BuildRequires: chrpath +BuildRequires: ghc-containers-devel +BuildRequires: ghc-directory-devel +BuildRequires: ghc-json-devel +BuildRequires: ghc-mtl-devel +BuildRequires: ghc-parsec-devel +BuildRequires: ghc-regex-compat-devel +%if %{with tests} +BuildRequires: ghc-QuickCheck-devel +%endif # End cabal-rpm deps -BuildRequires: pandoc +BuildRequires: pandoc %description The goals of ShellCheck are: @@ -47,20 +54,19 @@ The goals of ShellCheck are: %package -n ghc-%{name} -Summary: Haskell %{name} library - +Summary: Haskell %{name} library %description -n ghc-%{name} This package provides the Haskell %{name} shared library. %package -n ghc-%{name}-devel -Summary: Haskell %{name} library development files -Provides: ghc-%{name}-static = %{version}-%{release} -Requires: ghc-compiler = %{ghc_version} -Requires(post): ghc-compiler = %{ghc_version} +Summary: Haskell %{name} library development files +Provides: ghc-%{name}-static = %{version}-%{release} +Requires: ghc-compiler = %{ghc_version} +Requires(post): ghc-compiler = %{ghc_version} Requires(postun): ghc-compiler = %{ghc_version} -Requires: ghc-%{name}%{?_isa} = %{version}-%{release} +Requires: ghc-%{name}%{?_isa} = %{version}-%{release} %description -n ghc-%{name}-devel This package provides the Haskell %{name} library development files. @@ -119,7 +125,8 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1 %changelog * Tue Nov 4 2014 Jens Petersen - 0.3.4-2 -- only enable tests on archs with ghci except armv7 (#1158522) +- disable tests on all archs (#1158522) + - QuickCheck should really only be used for buildtime tests * Thu Sep 11 2014 Dridi - 0.3.4-1 - bumped to version 0.3.4