summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/git-ptx-patches11
-rw-r--r--scripts/lib/ptxd_make_world_patchin.sh11
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