diff --git a/make-srpm.sh b/make-srpm.sh index 13cde513..4105dff9 100755 --- a/make-srpm.sh +++ b/make-srpm.sh @@ -301,7 +301,7 @@ This package contains the unicontrol plug-in for csmock. %{_mandir}/man1/csmock.1* %{_datadir}/csmock/cwe-map.csv %{_datadir}/csmock/scripts/enable-keep-going.sh -%{_datadir}/csmock/scripts/chroot-fixups +%attr(755,root,root) %{_datadir}/csmock/scripts/chroot-fixups %{_datadir}/csmock/scripts/patch-rawbuild.sh %{python3_sitelib}/csmock/__init__.py* %{python3_sitelib}/csmock/common diff --git a/scripts/chroot-fixups/00-pre-usr-move-shells.sh b/scripts/chroot-fixups/00-pre-usr-move-shells.sh new file mode 100755 index 00000000..b70fe1a9 --- /dev/null +++ b/scripts/chroot-fixups/00-pre-usr-move-shells.sh @@ -0,0 +1,14 @@ +# intentionally no shebang so that rpmbuild does not break this script +# shellcheck shell=sh + +# exit successfully if this is a post-UsrMove chroot +test -L /bin && exit 0 + +# if rpmbuild from the host env translated /bin/bash to /usr/bin/bash in the +# shebangs of our scripts, create reverse symlinks to make the scripts work +# in the chroot env again +for sh in bash sh; do + dst=/usr/bin/${sh} + test -e ${dst} && continue + test -x /bin/${sh} && ln -sv ../../bin/${sh} $dst +done