From ff791f0a90743def1feeec7c0011d753fb15408d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 16 Jan 2019 15:41:18 +0100 Subject: bin/build-packages: -d|--diff new - we can now build the trunk version more easily --- lib/common-functions | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/common-functions b/lib/common-functions index b29379b..cd938f8 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -891,3 +891,20 @@ failsafe_rsync() { done return 1 } + +# apply_trunk_patch source_dir diff_source_dir +# apply a patch between diff_source_dir/PKGBUILD and +# diff_source_dir/../../trunk/PKGBUILD onto source_dir/PKGBUILD +apply_trunk_patch() { + local source_dir="$1" + local diff_source_dir="$2" + if [ -z "${diff_source_dir}" ]; then + # no diff_source_dir => no action + return + fi + diff -u3 "${diff_source_dir}/PKGBUILD" "${diff_source_dir}/../../trunk/PKGBUILD" \ + | sed ' + 1,2 s#^\(\(+++\|---\)\s\+\)\S\+/\(PKGBUILD\s.*\)$#\1\3# + ' \ + | patch -p0 "${source_dir}/PKGBUILD" +} -- cgit v1.2.3-54-g00ecf