summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_patchin.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-06-02 22:12:56 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-06-03 15:15:01 +0200
commitd554f146cc2dfad719c6410764c8a76857a23247 (patch)
treea1622becd15da5f01fb0e1a3f3e84e2d9a277f5c /scripts/lib/ptxd_make_world_patchin.sh
parentac867ac124749795aac3a5c38381f4bd18c2470c (diff)
downloadptxdist-d554f146cc2dfad719c6410764c8a76857a23247.tar.gz
ptxdist-d554f146cc2dfad719c6410764c8a76857a23247.tar.xz
git-ptx-patches: play nice with patches managed by other tools
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_patchin.sh')
-rw-r--r--scripts/lib/ptxd_make_world_patchin.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh
index 1cdd96c88..2f22fe573 100644
--- a/scripts/lib/ptxd_make_world_patchin.sh
+++ b/scripts/lib/ptxd_make_world_patchin.sh
@@ -154,6 +154,17 @@ ptxd_make_world_patchin_apply_git()
git quiltimport \
--patches "${pkg_patchin_dir}/.ptxdist/git-patches" \
--author "unknown author <unknown.author@example.com>"
+
+ # skip patches generated by other tools with '# <tool>-end' as end marker
+ if tail -n1 "${pkg_patchin_dir}/.ptxdist/series" | grep -q '# [^ ]*-end$'; then
+ local last="$(sed -n 's/^\([0-9][0-9]*\)-.*/\1/p' "${pkg_patchin_dir}/.ptxdist/series" | tail -n1)"
+ git tag -f base
+ local next=1000
+ if [ -n "${last}" ]; then
+ next="$[(1+${last}/1000)*1000]"
+ fi
+ echo "#tag:base --start-number ${next}" >> ${pkg_patchin_dir}/.ptxdist/series.append
+ fi
}
export -f ptxd_make_world_patchin_apply_git