add cabal-tweak-remove-upperbound
This commit is contained in:
parent
8532ad674a
commit
f4b0280742
37
cabal-tweak-remove-upperbound
Executable file
37
cabal-tweak-remove-upperbound
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e +x
|
||||||
|
|
||||||
|
USAGE="Usage: $0 dep"
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "$USAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEP=$1
|
||||||
|
CABALFILE=$(ls *.cabal)
|
||||||
|
|
||||||
|
if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
|
||||||
|
echo "There needs to be one .cabal file in the current dir!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BREAK=[^[:alnum:]-]
|
||||||
|
|
||||||
|
if ! grep -q "$BREAK$DEP$BREAK[^,]*" $CABALFILE; then
|
||||||
|
echo "$CABALFILE does not match: $DEP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CABALFILE.orig ]; then
|
||||||
|
BACKUP=.orig
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "$BREAK$DEP$BREAK[^,]*&&" $CABALFILE; then
|
||||||
|
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^&,]*[^ ]\+\) *&&[^,]*/\1/g" $CABALFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "$BREAK$DEP$BREAK[^,]*==" $CABALFILE; then
|
||||||
|
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^=,]*\)==\([^,*]*\)\.\*/\1>=\2/g" $CABALFILE
|
||||||
|
fi
|
@ -10,7 +10,7 @@
|
|||||||
#%%global without_hscolour 1
|
#%%global without_hscolour 1
|
||||||
|
|
||||||
Name: ghc-rpm-macros
|
Name: ghc-rpm-macros
|
||||||
Version: 2.0.3
|
Version: 2.0.4
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: RPM macros for building Haskell packages for GHC
|
Summary: RPM macros for building Haskell packages for GHC
|
||||||
|
|
||||||
@ -29,6 +29,7 @@ Source8: ghc-pkg-wrapper
|
|||||||
Source9: macros.ghc-os
|
Source9: macros.ghc-os
|
||||||
Source10: Setup.hs
|
Source10: Setup.hs
|
||||||
Source11: cabal-tweak-drop-dep
|
Source11: cabal-tweak-drop-dep
|
||||||
|
Source12: cabal-tweak-remove-upperbound
|
||||||
Requires: redhat-rpm-config
|
Requires: redhat-rpm-config
|
||||||
# for ghc_version
|
# for ghc_version
|
||||||
Requires: ghc-compiler
|
Requires: ghc-compiler
|
||||||
@ -167,6 +168,7 @@ install -p -D -m 0644 %{SOURCE10} %{buildroot}/%{_datadir}/%{name}/Setup.hs
|
|||||||
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
|
install -p -D -m 0755 %{SOURCE4} %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
|
||||||
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
|
install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
|
||||||
install -p -D -m 0755 %{SOURCE11} %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
|
install -p -D -m 0755 %{SOURCE11} %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
|
||||||
|
install -p -D -m 0755 %{SOURCE12} %{buildroot}/%{_bindir}/cabal-tweak-remove-upperbound
|
||||||
install -p -D -m 0755 %{SOURCE8} %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper
|
install -p -D -m 0755 %{SOURCE8} %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||||
@ -190,6 +192,7 @@ EOF
|
|||||||
%{_bindir}/cabal-tweak-dep-ver
|
%{_bindir}/cabal-tweak-dep-ver
|
||||||
%{_bindir}/cabal-tweak-drop-dep
|
%{_bindir}/cabal-tweak-drop-dep
|
||||||
%{_bindir}/cabal-tweak-flag
|
%{_bindir}/cabal-tweak-flag
|
||||||
|
%{_bindir}/cabal-tweak-remove-upperbound
|
||||||
%{_datadir}/%{name}/Setup.hs
|
%{_datadir}/%{name}/Setup.hs
|
||||||
|
|
||||||
|
|
||||||
@ -203,6 +206,9 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 13 2019 Jens Petersen <petersen@redhat.com> - 2.0.4-1
|
||||||
|
- add cabal-tweak-remove-upperbound script
|
||||||
|
|
||||||
* Sat Aug 10 2019 Jens Petersen <petersen@redhat.com> - 2.0.3-1
|
* Sat Aug 10 2019 Jens Petersen <petersen@redhat.com> - 2.0.3-1
|
||||||
- only depend on ghc-prof(pkgid) if libHSpkgid_p.a exists
|
- only depend on ghc-prof(pkgid) if libHSpkgid_p.a exists
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user