From patchwork Sat Sep 10 18:32:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [master,v3] fix patching error by empty build_patches dir From: Jan-Tarek Butt X-Patchwork-Id: 220 Message-Id: <20160910183229.30871-1-tarek@ring0.de> To: franken-dev@freifunk.net Cc: dev@lists.ffnw.de Date: Sat, 10 Sep 2016 20:32:29 +0200 --- buildscript | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- 2.9.3 diff --git a/buildscript b/buildscript index 04942e6..1474966 100755 --- a/buildscript +++ b/buildscript @@ -122,9 +122,11 @@ get_source() { } patch_target() { - for patch in "$PWD"/build_patches/openwrt/*.patch; do - patch --no-backup-if-mismatch -p0 -d "$target" -i "$patch" - done + if [ $(find $PWD/build_patches/openwrt/*.patch 2> /dev/null | wc -l) -ge 1 ]; then + for patch in "$PWD"/build_patches/openwrt/*.patch; do + patch --no-backup-if-mismatch -p0 -d "$target" -i "$patch" + done + fi } prepare() {