diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-06-02 22:12:56 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-06-03 15:15:01 +0200 |
commit | d554f146cc2dfad719c6410764c8a76857a23247 (patch) | |
tree | a1622becd15da5f01fb0e1a3f3e84e2d9a277f5c /scripts | |
parent | ac867ac124749795aac3a5c38381f4bd18c2470c (diff) | |
download | ptxdist-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')
-rwxr-xr-x | scripts/git-ptx-patches | 11 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_patchin.sh | 11 |
2 files changed, 19 insertions, 3 deletions
diff --git a/scripts/git-ptx-patches b/scripts/git-ptx-patches index 747380706..cdecd799a 100755 --- a/scripts/git-ptx-patches +++ b/scripts/git-ptx-patches @@ -55,12 +55,16 @@ range="${tag}..${tag2}" echo "$PTX_PATCHES_HEADER" > .ptxdist/series.0 :> .ptxdist/series.1 -if grep -q "^#tag:" .ptxdist/series; then - tagline=$(grep "#tag:${tag}" .ptxdist/series) +touch .ptxdist/series.append +if grep -q "^#tag:" .ptxdist/series .ptxdist/series.append; then + tagline=$(cat .ptxdist/series .ptxdist/series.append | grep "#tag:${tag}") t=$(echo "${tagline}"|cut -d' ' -f1) if [ "#tag:${tag}" == "${t}" ]; then tagopt=$(echo "${tagline}"|cut -d' ' -s -f2-) - sed -e "/$PTX_PATCHES_HEADER/d" -n -e "0,/#tag:${tag}/p" .ptxdist/series >> .ptxdist/series.0 + sed -e "/$PTX_PATCHES_HEADER/d" -n \ + -e '/git-ptx-patches magic/d' \ + -e "0,/#tag:${tag}/p" \ + .ptxdist/series .ptxdist/series.append >> .ptxdist/series.0 # Remove patches before #tag:${tag} so they don't get rm'd with remove_old=yes sed -i --follow-symlinks "0,/#tag:${tag}/d" .ptxdist/series if [ -n "${tag2}" ]; then @@ -79,6 +83,7 @@ else fi echo "#tag:${tag} --start-number 1" >> .ptxdist/series.0 fi +rm .ptxdist/series.append case "$remove_old" in "no") ;; 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 |