proper fix to disable tests everywhere (#1158522)

We don't really want to link ShellCheck to QuickCheck:
QuickCheck should only be used at buildtime for tests
- https://github.com/koalaman/shellcheck/issues/254

I had forgotten to remove the QuickCheck imports
in my earlier ARM version of the patch
(that QC module is not available on all secondary archs).

Sorry about the formatting changes but it makes
life easier for me to keep the spacing close to cblrpm output.
(Maybe I should add an ignore whitespace option to
"cblrpm diff" in the future.:)

Hopefully this should now really build on all archs!
epel9
Jens Petersen 10 years ago
parent b4d116ee78
commit ba15a85ee6

@ -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 <http://www.gnu.org/licenses/>.
@ -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 <http://www.gnu.org/licenses/>.
@ -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 <http://www.gnu.org/licenses/>.
-}
@ -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" []

@ -1,10 +1,15 @@
%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}
@ -17,19 +22,21 @@ 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
Patch0: ShellCheck-disable-TemplateHaskell-runTests.patch
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
%if %{with tests}
BuildRequires: ghc-QuickCheck-devel
%endif
# End cabal-rpm deps
BuildRequires: pandoc
@ -49,7 +56,6 @@ The goals of ShellCheck are:
%package -n ghc-%{name}
Summary: Haskell %{name} library
%description -n ghc-%{name}
This package provides the Haskell %{name} shared library.
@ -119,7 +125,8 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
%changelog
* Tue Nov 4 2014 Jens Petersen <petersen@redhat.com> - 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 <dridi.boukelmoune@gmail.com> - 0.3.4-1
- bumped to version 0.3.4

Loading…
Cancel
Save