Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to bypass applying interfere #88

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions src/lib/interfere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,33 @@ function interference-apply() {

interference-generic "${_PKGTAG}"

# shellcheck source=/dev/null
[[ -f "${_INTERFERE}/prepare" ]] \
&& source "${_INTERFERE}/prepare"

if [[ -f "${_INTERFERE}/interfere.patch" ]]; then
if patch -Np1 <"${_INTERFERE}/interfere.patch"; then
echo 'Patches applied with success'
else
echo 'Ignoring patch failure...'
if [[ -e "interfere.bypass" ]]; then
# bypass interfere
:
else
# shellcheck source=/dev/null
[[ -f "${_INTERFERE}/prepare" ]] \
&& source "${_INTERFERE}/prepare"

if [[ -f "${_INTERFERE}/interfere.patch" ]]; then
if patch -Np1 <"${_INTERFERE}/interfere.patch"; then
echo 'Patches applied with success'
else
echo 'Ignoring patch failure...'
fi
fi
fi

if [[ -f "${_INTERFERE}/PKGBUILD.prepend" ]]; then
# The worst one, but KISS and easier to maintain
_PREPEND="$(cat "${_INTERFERE}/PKGBUILD.prepend")"
_PKGBUILD="$(cat PKGBUILD)"
echo "$_PREPEND" >PKGBUILD
echo "$_PKGBUILD" >>PKGBUILD
fi
if [[ -f "${_INTERFERE}/PKGBUILD.prepend" ]]; then
# The worst one, but KISS and easier to maintain
_PREPEND="$(cat "${_INTERFERE}/PKGBUILD.prepend")"
_PKGBUILD="$(cat PKGBUILD)"
echo "$_PREPEND" >PKGBUILD
echo "$_PKGBUILD" >>PKGBUILD
fi

[[ -f "${_INTERFERE}/PKGBUILD.append" ]] \
&& cat "${_INTERFERE}/PKGBUILD.append" >>PKGBUILD
[[ -f "${_INTERFERE}/PKGBUILD.append" ]] \
&& cat "${_INTERFERE}/PKGBUILD.append" >>PKGBUILD
fi

interference-pkgrel "${_PKGTAG}"

Expand Down