From 2daf5647b6961ff6281d5c89b50783e5258a6b4b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 5 Mar 2020 10:12:42 +0100 Subject: do not overwrite prepare if it already existed --- extra/devtools/PKGBUILD | 22 ++++++++++++++-------- extra/mutter/PKGBUILD | 17 +++++++++++------ extra/xfce4-diskperf-plugin/PKGBUILD | 14 ++++++++++---- 3 files changed, 35 insertions(+), 18 deletions(-) (limited to 'extra') diff --git a/extra/devtools/PKGBUILD b/extra/devtools/PKGBUILD index 19bd31a0..37f0da9d 100644 --- a/extra/devtools/PKGBUILD +++ b/extra/devtools/PKGBUILD @@ -17,14 +17,20 @@ unset b2sums makedepends+=('asciidoc') -prepare() { - cd "${srcdir}/${pkgname}32-v${pkgver}" - sed -i ' - s,\$working_dir/etc/pacman\.d/mirrorlist32,/dev/null, - s/mirrorlist32/mirrorlist/g - ' 'arch-nspawn.in' - sed -i 's@s,/mirrorlist\\\$\$,\\032,;\?@@' 'Makefile' -} +eval "$( + { + declare -f prepare || \ + printf 'prepare() {\n}\n' + } \ + | sed ' + $i cd "${srcdir}/${pkgname}32-v${pkgver}" \ + sed -i '"'"' \ + s,\$working_dir/etc/pacman\.d/mirrorlist32,/dev/null, \ + s/mirrorlist32/mirrorlist/g \ + '"'"' '"'"'arch-nspawn.in'"'"' \ + sed -i '"'"'s@s,/mirrorlist\\\$\$,\\032,;\?@@'"'"' '"'"'Makefile'"'"' + ' +)" eval "$( declare -f prepare build check package | \ diff --git a/extra/mutter/PKGBUILD b/extra/mutter/PKGBUILD index 60ceb6fa..8a8a4f44 100644 --- a/extra/mutter/PKGBUILD +++ b/extra/mutter/PKGBUILD @@ -9,9 +9,14 @@ eval "$( source+=(fix-build.diff) sha256sums+=('28aa24daed161f2566ca2b159beb43285184c533956b851a7eb318de741da935') -prepare() { - cd $pkgname - - # fix build with libglvnd's EGL headers - git apply -3 ../fix-build.diff -} +eval "$( + { + declare -f prepare || \ + printf 'prepare() {\n}\n' + } \ + | sed ' + $i cd "$srcdir/$pkgname" \ + # fix build with libglvnd's EGL headers \ + git apply -3 ../fix-build.diff + ' +)" diff --git a/extra/xfce4-diskperf-plugin/PKGBUILD b/extra/xfce4-diskperf-plugin/PKGBUILD index f42f1cb5..74532d0b 100644 --- a/extra/xfce4-diskperf-plugin/PKGBUILD +++ b/extra/xfce4-diskperf-plugin/PKGBUILD @@ -1,5 +1,11 @@ # see https://bugs.archlinux.org/task/60632 -prepare() { - cd $pkgname-$pkgver - sed -i '/#include / a #include /' panel-plugin/devperf.c -} +eval "$( + { + declare -f prepare || \ + printf 'prepare() {\n}\n' + } \ + | sed ' + $ i cd "$srcdir/$pkgname-$pkgver"\ + sed -i '"'"'/#include / a #include /'"'"' panel-plugin/devperf.c + ' +)" -- cgit v1.2.3-70-g09d2