diff options
author | Jon Ringle <jon@ringle.org> | 2011-07-04 09:22:04 -0400 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-07-15 15:36:06 +0200 |
commit | 957c6c663cdd46ef8341b84893b32d1bb1a04edf (patch) | |
tree | fbab67fa4f7865d4d0524e05b56c79a18be01bfd /scripts/lib/ptxd_make_world_patchin.sh | |
parent | 6b42a4e51a796de571697418afe4ec54e84a0df7 (diff) | |
download | ptxdist-957c6c663cdd46ef8341b84893b32d1bb1a04edf.tar.gz ptxdist-957c6c663cdd46ef8341b84893b32d1bb1a04edf.tar.xz |
git-ptx-patches: Allow patches before base tag
The patch series I have for the Linux kernel includes incremental patches
from upstream like
patch-2.6.33.1.bz2
patch-2.6.33.1-2.bz2
followed by a patch series for my board.
But ptxdist messes this up when applying the patch series with git.
This patch allows one to mark the base tag in the series with:
#tag:base --start-number 1
Other arbitrary tags can also be put in the series:
#tag:for-upstream --start-number 5
When using 'git ptx-patches' to regenerate the series, only the patches
between "#tag:base" and the next "#tag:*" or EOF in the series are
regenerated. All others in the series are left untouched. To use a
different tag than the default tag base, use -t tagname.
e.g.:
# generated by git-ptx-patches
patch-2.6.33.1.bz2
patch-2.6.33.1-2.bz2
patch-2.6.33.2-3.bz2
#tag:for-upstream --start-number 1
0001-for-upstream-1.patch
0002-for-upstream-2.patch
0003-for-upstream-3.patch
#tag:base --start-number 4
0004-foo.patch
0005-bar.batch
# 25a3096f40bc8d841c8bf3ec24dd101f - git-ptx-patches magic
Any options included on a #tag:* line are passed to git format-patch when
generating the patches for that section.
Signed-off-by: Jon Ringle <jon@ringle.org>
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.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh index bbb749045..d3544f245 100644 --- a/scripts/lib/ptxd_make_world_patchin.sh +++ b/scripts/lib/ptxd_make_world_patchin.sh @@ -112,6 +112,16 @@ ptxd_make_world_patchin_apply_git_compat() esac case "${patch}" in + "#tag:"*) + local tag="${patch##\#tag:}" + if [ -f ${pkg_patchin_dir}/.ptxdist/git-patches/series ]; then + mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{,.${tag}} && + touch ${pkg_patchin_dir}/.ptxdist/git-patches/series + else + touch ${pkg_patchin_dir}/.ptxdist/git-patches/series.${tag} + fi + continue + ;; ""|"#"*) continue ;; # skip empty lines and comments *.gz) cat="zcat" ;; *.bz2) cat="bzcat" ;; @@ -141,6 +151,23 @@ ptxd_make_world_patchin_apply_git() # ptxd_make_world_patchin_apply_git_compat || return + grep "\#tag:" "${pkg_patchin_dir}/.ptxdist/series" | while read tagline; do + local tag="${tagline##\#tag:}" + tag=$(echo ${tag}|cut -d' ' -f1) + if [ -f "${pkg_patchin_dir}/.ptxdist/git-patches/series.${tag}" ]; then + mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{,.1} || return + mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{.${tag},} || return + + git quiltimport \ + --patches "${pkg_patchin_dir}/.ptxdist/git-patches" \ + --author "unknown author <unknown.author@example.com>" + echo "tagging -> ${tag}" + git tag -f ${tag} + mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{,.${tag}} || return + mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{.1,} || return + fi + done + git quiltimport \ --patches "${pkg_patchin_dir}/.ptxdist/git-patches" \ --author "unknown author <unknown.author@example.com>" |