Fix tests subpackage test script

popd and pushd are bash-specific. Use bash in shell bang.
Prevent from evaluating the script in here-document definition.
Create a temporary directory correctly.
Also correct a typo in a comment.
This commit is contained in:
Petr Písař 2019-10-29 14:32:08 +01:00
parent fc84f8df7a
commit 14e6ac0339

View File

@ -9,7 +9,7 @@
Name: perl-LDAP
Version: 0.66
Release: 5%{?dist}
Release: 6%{?dist}
Epoch: 1
Summary: LDAP Perl module
License: GPL+ or Artistic
@ -184,12 +184,12 @@ find %{buildroot} -type f -name .packlist -delete
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
# FIXME: Generators should scan these non-executable files
cp -a data t test.cfg %{buildroot}/%{_libexecdir}/%{name}
cat > %{buildroot}/%{_libexecdir}/%{name}/test <<EOF
#!/bin/sh
cat > %{buildroot}/%{_libexecdir}/%{name}/test <<'EOF'
#!/bin/bash
set -e
# t/common.pl reads from ./data and writes into ./temp. The easiest solution
# is to copy the tests into a writable directory and execute the from there.
DIR=$(mktemp)
# is to copy the tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
prove -I .
@ -222,6 +222,9 @@ make test
%{_libexecdir}/%{name}
%changelog
* Tue Oct 29 2019 Petr Pisar <ppisar@redhat.com> - 1:0.66-6
- Fix tests subpackage test script
* Mon Aug 26 2019 Petr Pisar <ppisar@redhat.com> - 1:0.66-5
- Package tests