Skip to content

Commit

Permalink
tmp: Update sequence-patch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsrb committed Dec 18, 2018
1 parent ab83254 commit 1ccbffb
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tmp/sequence-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...]
of the component patches fail to apply the tree will not be rolled
back.
The --rapid option will use rapidpatch to apply patches.
The --rapid option will use rapidquilt to apply patches.
When used with last-patch-name, both --fast and --no-quilt
will set up a quilt environment for the remaining patches.
Expand All @@ -74,7 +74,8 @@ END
}

apply_rapid_patches() {
printf "%s\n" ${PATCHES_BEFORE[@]} | rapidquilt -d $PATCH_DIR -p $PWD
printf "%s\n" ${PATCHES_BEFORE[@]} >> $PATCH_DIR/series
rapidquilt push -a -d $PATCH_DIR -p $PWD
status=$?

PATCHES=( ${PATCHES_AFTER[@]} )
Expand Down Expand Up @@ -254,7 +255,7 @@ while true; do
--fast)
FAST=1
;;
--rapid)
--rapid)
RAPID=1
;;
--arch)
Expand Down
79 changes: 79 additions & 0 deletions tmp/sequence-patch.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
diff --git a/scripts/sequence-patch.sh b/scripts/sequence-patch.sh
index 75fa028ba69..62dea2ba6d2 100755
--- a/scripts/sequence-patch.sh
+++ b/scripts/sequence-patch.sh
@@ -38,7 +38,7 @@ esac
usage() {
cat <<END
SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...]
- [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]
+ [--fast] [--rapid] [last-patch-name] [--vanilla] [--fuzz=NUM]
[--patch-dir=PATH] [--build-dir=PATH] [--config=ARCH-FLAVOR [--kabi]]
[--ctags] [--cscope] [--etags] [--skip-reverse]

@@ -65,12 +65,22 @@ SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...]
of the component patches fail to apply the tree will not be rolled
back.

+ The --rapid option will use rapidquilt to apply patches.
+
When used with last-patch-name, both --fast and --no-quilt
will set up a quilt environment for the remaining patches.
END
exit 1
}

+apply_rapid_patches() {
+ printf "%s\n" ${PATCHES_BEFORE[@]} >> $PATCH_DIR/series
+ rapidquilt push -a -d $PATCH_DIR -p $PWD
+ status=$?
+
+ PATCHES=( ${PATCHES_AFTER[@]} )
+}
+
apply_fast_patches() {
echo "[ Fast-applying ${#PATCHES_BEFORE[@]} patches. ${#PATCHES_AFTER[@]} remain. ]"
LAST_LOG=$(echo "${PATCHES_BEFORE[@]}" | xargs cat | \
@@ -200,7 +210,7 @@ if $have_arch_patches; then
else
arch_opt=""
fi
-options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,patch-dir:,build-dir:,config:,kabi,ctags,cscope,etags,skip-reverse -- "$@"`
+options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,rapid,vanilla,fuzz,patch-dir:,build-dir:,config:,kabi,ctags,cscope,etags,skip-reverse -- "$@"`

if [ $? -ne 0 ]
then
@@ -213,6 +223,7 @@ QUIET=1
EXTRA_SYMBOLS=
QUILT=true
FAST=
+RAPID=
VANILLA=false
SP_BUILD_DIR=
CONFIG=
@@ -244,6 +255,9 @@ while true; do
--fast)
FAST=1
;;
+ --rapid)
+ RAPID=1
+ ;;
--arch)
export PATCH_ARCH=$2
shift
@@ -566,10 +580,12 @@ fi
mkdir $PATCH_DIR/.pc
echo 2 > $PATCH_DIR/.pc/.version

-if [ -z "$FAST" ]; then
- apply_patches
-else
+if [ -n "$FAST" ]; then
apply_fast_patches
+elif [ -n "$RAPID" ]; then
+ apply_rapid_patches
+else
+ apply_patches
fi

if [ -n "$EXTRA_SYMBOLS" ]; then

0 comments on commit 1ccbffb

Please sign in to comment.