diff options
author | Erich Eckner <git@eckner.net> | 2019-01-16 15:41:18 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-16 15:41:18 +0100 |
commit | ff791f0a90743def1feeec7c0011d753fb15408d (patch) | |
tree | f5de86b7687a6b1f596b723f530f045a02c129f2 /lib/common-functions | |
parent | b0e6586805a456fe8430abc2b5eb4601b7e0eed2 (diff) | |
download | builder-ff791f0a90743def1feeec7c0011d753fb15408d.tar.xz |
bin/build-packages: -d|--diff new - we can now build the trunk version more easily
Diffstat (limited to 'lib/common-functions')
-rwxr-xr-x | lib/common-functions | 17 |
1 files changed, 17 insertions, 0 deletions
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" +} |