summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMubashshir2022-01-09 23:58:41 +0600
committerMubashshir2022-01-09 23:58:41 +0600
commitf7940931133538289294301bca702440bd06401f (patch)
tree09eda7c122df2e0a0b88ce947bd4d5d3d5cd0847
parent486ade231b0a406dea3bdd59f4175b52e8df2489 (diff)
downloadaur-f7940931133538289294301bca702440bd06401f.tar.gz
anbox: Check before applying patches
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD19
2 files changed, 16 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index eb620cf730a2..e399bf278572 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = anbox-git
pkgdesc = Running Android in a container
pkgver = r1358.84f0268
- pkgrel = 2
+ pkgrel = 3
epoch = 1
url = http://anbox.io/
arch = x86_64
diff --git a/PKGBUILD b/PKGBUILD
index 9ad73fc36f7a..99847c3d9109 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=anbox-git
pkgver=r1358.84f0268
-pkgrel=2
+pkgrel=3
epoch=1
arch=('x86_64')
url="http://anbox.io/"
@@ -61,9 +61,20 @@ prepare() {
truncate -s 0 cmake/FindGMock.cmake
truncate -s 0 tests/CMakeLists.txt
sed -i '1i\#include <cstdint>' "$srcdir/anbox/src/anbox/input/manager.cpp"
- for each in lxc sdbus delayed-start desktop-dir;do
- patch -p1 < "$srcdir/$each.patch"
- done
+
+ # Thanks to @bartus <arch-user-repo@bartus.33mail.com> for suggesting the patch
+ # checking before applying it.
+ # Original patch: http://ix.io/3Clr
+ printf '%s\n' "${source[@]%%::*}" \
+ | awk -F . '/\.patch/{print $1}' \
+ | while read -r patch;do
+ if patch --dry-run -Np1 -Rsf < "$srcdir/$patch.patch" &> /dev/null; then
+ warning "Patch already applied, please remove $patch.patch from source[]!"
+ read -t5 -p 'press enter to continue...' || true
+ else
+ patch -Np1 < "$srcdir/$patch.patch"
+ fi
+ done
git submodule init
git config submodule.external/cpu_features.url $srcdir/cpu_features