Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Jens Petersen | fd21afbf53 | |
Jens Petersen | f81411162f | |
Dridi Boukelmoune | 4db2d64524 | |
Dridi Boukelmoune | 418bc37bf7 |
|
@ -0,0 +1,35 @@
|
|||
From 138080bdc7442458f45bd2726d9e8cb4b68cf24f Mon Sep 17 00:00:00 2001
|
||||
From: Vidar Holen <spam@vidarholen.net>
|
||||
Date: Sun, 16 Dec 2018 14:42:19 -0800
|
||||
Subject: [PATCH] Fix infinite loop on annotations for SC2188 (fixes #1413)
|
||||
|
||||
---
|
||||
src/ShellCheck/Analytics.hs | 2 +-
|
||||
src/ShellCheck/Checker.hs | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs
|
||||
index 7754ee64..a164de13 100644
|
||||
--- a/src/ShellCheck/Analytics.hs
|
||||
+++ b/src/ShellCheck/Analytics.hs
|
||||
@@ -2692,7 +2692,7 @@ checkRedirectedNowhere params token =
|
||||
case drop 1 $ getPath (parentMap params) t of
|
||||
T_DollarExpansion _ [_] : _ -> True
|
||||
T_Backticked _ [_] : _ -> True
|
||||
- T_Annotation _ _ u : _ -> isInExpansion u
|
||||
+ t@T_Annotation {} : _ -> isInExpansion t
|
||||
_ -> False
|
||||
getDanglingRedirect token =
|
||||
case token of
|
||||
diff --git a/src/ShellCheck/Checker.hs b/src/ShellCheck/Checker.hs
|
||||
index 7ac9c913..10074e38 100644
|
||||
--- a/src/ShellCheck/Checker.hs
|
||||
+++ b/src/ShellCheck/Checker.hs
|
||||
@@ -231,5 +231,7 @@ prop_filewideAnnotation8 = null $
|
||||
prop_sourcePartOfOriginalScript = -- #1181: -x disabled posix warning for 'source'
|
||||
2039 `elem` checkWithIncludes [("./saywhat.sh", "echo foo")] "#!/bin/sh\nsource ./saywhat.sh"
|
||||
|
||||
+prop_spinBug1413 = null $ check "fun() {\n# shellcheck disable=SC2188\n> /dev/null\n}\n"
|
||||
+
|
||||
return []
|
||||
runTests = $quickCheckAll
|
|
@ -1,4 +1,4 @@
|
|||
# generated by cabal-rpm-0.12.6
|
||||
# generated by cabal-rpm-0.13
|
||||
# https://fedoraproject.org/wiki/Packaging:Haskell
|
||||
|
||||
%global pkg_name ShellCheck
|
||||
|
@ -8,17 +8,21 @@
|
|||
|
||||
Name: %{pkg_name}
|
||||
Version: 0.6.0
|
||||
Release: 1%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Shell script analysis tool
|
||||
|
||||
License: GPLv3+
|
||||
Url: https://www.shellcheck.net/
|
||||
Source: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
|
||||
# Begin cabal-rpm sources:
|
||||
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
|
||||
# End cabal-rpm sources
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1707331
|
||||
Patch0: https://github.com/koalaman/shellcheck/commit/138080bd.patch
|
||||
|
||||
# Begin cabal-rpm deps:
|
||||
BuildRequires: ghc-Cabal-devel
|
||||
BuildRequires: ghc-rpm-macros
|
||||
# Begin cabal-rpm deps:
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: ghc-QuickCheck-devel
|
||||
BuildRequires: ghc-aeson-devel
|
||||
BuildRequires: ghc-bytestring-devel
|
||||
|
@ -66,15 +70,21 @@ This package provides the Haskell %{name} library development files.
|
|||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
# Begin cabal-rpm setup:
|
||||
%autosetup -p1
|
||||
# End cabal-rpm setup
|
||||
|
||||
|
||||
%build
|
||||
# Begin cabal-rpm build:
|
||||
%ghc_lib_build
|
||||
# End cabal-rpm build
|
||||
|
||||
|
||||
%install
|
||||
# Begin cabal-rpm install
|
||||
%ghc_lib_install
|
||||
# End cabal-rpm install
|
||||
|
||||
install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
|
||||
|
||||
|
@ -92,14 +102,18 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
|
|||
|
||||
|
||||
%files
|
||||
# Begin cabal-rpm files:
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_bindir}/shellcheck
|
||||
# End cabal-rpm files
|
||||
%{_mandir}/man1/shellcheck.1*
|
||||
|
||||
|
||||
%files -n ghc-%{name} -f ghc-%{name}.files
|
||||
# Begin cabal-rpm files:
|
||||
%license LICENSE
|
||||
# End cabal-rpm files
|
||||
|
||||
|
||||
%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files
|
||||
|
@ -107,6 +121,12 @@ install -Dpm 0644 shellcheck.1 %{buildroot}%{_mandir}/man1/shellcheck.1
|
|||
|
||||
|
||||
%changelog
|
||||
* Sat Jul 27 2019 Jens Petersen <petersen@redhat.com> - 0.6.0-3
|
||||
- refresh to cabal-rpm-0.13
|
||||
|
||||
* Sat May 18 2019 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 0.6.0-2
|
||||
- Add upstream patch for BZ#1707331 (infinite loop on annotations for SC2188)
|
||||
|
||||
* Mon Dec 03 2018 Dridi Boukelmoune <dridi.boukelmoune@gmail.com> - 0.6.0-1
|
||||
- Update to 0.6.0
|
||||
|
||||
|
|
Loading…
Reference in New Issue