From: Stephen Rothwell Date: Wed, 5 Mar 2014 06:56:52 +0000 (+1100) Subject: turn {import,merge}-cpuinit into -init X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=1715e1555a93c0aec50311542c5f40debaea9de9;p=next-scripts turn {import,merge}-cpuinit into -init --- diff --git a/import-cpuinit b/import-cpuinit deleted file mode 100755 index 34c22f6..0000000 --- a/import-cpuinit +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -log_file=../cpuinit-import.log - -log() -{ - echo "$@" | tee -a $log_file -} - -execute() -{ - log "$" $@ - "$@" 2>&1 | tee -a $log_file - [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1 -} - -cpuinit="$(cd ../cpuinit;pwd)" -sfile="$cpuinit/series" -cpwd=$(pwd) - -base=$1 -log "Importing cpuinit based on $base" -base=$(git rev-parse --verify "$base" 2>/dev/null) || { - log "Bad base $base" - exit 1 -} - -[ -d "../quilt-tmp" ] || - execute git clone -s -l -n -q . ../quilt-tmp - -log '$' cd ../quilt-tmp -cd ../quilt-tmp -execute git checkout -b cpuinit/master "$base" -git branch cpuinit/master-base - -patches=$(sed -e '/^#/d' -e '/^[ \t]*$/d' "$sfile") - -for f in $patches; do - execute git am --patch-format=mbox "$cpuinit/$f" -done - -log '$' cd $cpwd -cd $cpwd - -execute git fetch -f ../quilt-tmp cpuinit/master-base:cpuinit/master-base -execute git fetch -f ../quilt-tmp cpuinit/master:cpuinit/master - -rm -rf ../quilt-tmp - -exit 0 diff --git a/import-init b/import-init new file mode 100755 index 0000000..47c2da9 --- /dev/null +++ b/import-init @@ -0,0 +1,50 @@ +#!/bin/bash + +log_file=../init-import.log + +log() +{ + echo "$@" | tee -a $log_file +} + +execute() +{ + log "$" $@ + "$@" 2>&1 | tee -a $log_file + [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1 +} + +init="$(cd ../init;pwd)" +sfile="$init/series" +cpwd=$(pwd) + +base=$1 +log "Importing init based on $base" +base=$(git rev-parse --verify "$base" 2>/dev/null) || { + log "Bad base $base" + exit 1 +} + +[ -d "../quilt-tmp" ] || + execute git clone -s -l -n -q . ../quilt-tmp + +log '$' cd ../quilt-tmp +cd ../quilt-tmp +execute git checkout -b init/master "$base" +git branch init/master-base + +patches=$(sed -e '/^#/d' -e '/^[ \t]*$/d' "$sfile") + +for f in $patches; do + execute git am -3 --patch-format=mbox "$init/$f" +done + +log '$' cd $cpwd +cd $cpwd + +execute git fetch -f ../quilt-tmp init/master-base:init/master-base +execute git fetch -f ../quilt-tmp init/master:init/master + +rm -rf ../quilt-tmp + +exit 0 diff --git a/merge_cpuinit b/merge_cpuinit deleted file mode 100755 index 999bca9..0000000 --- a/merge_cpuinit +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -no_build=false - -[ "$1" = "-n" ] && { - shift - no_build=true -} - -. "$(dirname $0)/common.sh" - -log() -{ - echo "$@" | tee -a $LOG_FILE -} - -execute() -{ - log "$" $@ - $@ 2>&1 | tee -a $LOG_FILE - return ${PIPESTATUS[0]} -} - -cpwd=../next - -execute git clone -s -l -n -q . ../rebase-tmp || { - echo Clone failed 1>&2 - bash -i || exit -} -log '$' cd ../rebase-tmp -cd ../rebase-tmp -execute git checkout -b cpuinit remotes/origin/cpuinit/master || { - echo Checkout of remotes/origin/cpuinit/master failed 1>&2 - bash -i || exit -} -execute git rebase --onto master remotes/origin/cpuinit/master-base || { - echo Rebase failed 1>&2 - bash -i || exit -} -echo "fix up?" -bash -i -log '$' cd $cpwd -cd $cpwd -execute git fetch -f ../rebase-tmp cpuinit:cpuinit/master || { - echo Fetch of cpuinit/master failed 1>&2 - bash -i || exit -} -execute rm -rf ../rebase-tmp - -git branch -f cpuinit/master-base HEAD - -old_head=$(git rev-parse HEAD) -log Merging cpuinit/master '('$(git log -1 --oneline cpuinit/master)')' -execute git merge --no-ff cpuinit/master || { - echo Merge failed 1>&2 - bash -i || exit -} -printf "%s\t\t%s\n" cpuinit $(git show-ref --hash cpuinit/master) >> $SHA1_FILE - -[ -f "../merge-fixes/cpuinit" ] && { - for p in $(cat "../merge-fixes/cpuinit"); do - $(dirname $0)/merge_fix -n "$p" || { - bash -i || exit - } - done -} - -new_head=$(git rev-parse HEAD) - -$no_build || - [ "$old_head" = "$new_head" ] || - [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] || { - - git push -f "$build_host":"$build_dir" master:refs/heads/next || { - echo git push failed 1>&2 - bash -i || exit - } - "$bin_dir/do_build" || { - echo Build failed 1>&2 - bash -i || exit - } -} - -exit 0 diff --git a/merge_init b/merge_init new file mode 100755 index 0000000..1659b3c --- /dev/null +++ b/merge_init @@ -0,0 +1,84 @@ +#!/bin/bash + +no_build=false + +[ "$1" = "-n" ] && { + shift + no_build=true +} + +. "$(dirname $0)/common.sh" + +log() +{ + echo "$@" | tee -a $LOG_FILE +} + +execute() +{ + log "$" $@ + $@ 2>&1 | tee -a $LOG_FILE + return ${PIPESTATUS[0]} +} + +cpwd=../next + +execute git clone -s -l -n -q . ../rebase-tmp || { + echo Clone failed 1>&2 + bash -i || exit +} +log '$' cd ../rebase-tmp +cd ../rebase-tmp +execute git checkout -b init remotes/origin/init/master || { + echo Checkout of remotes/origin/init/master failed 1>&2 + bash -i || exit +} +execute git rebase --onto master remotes/origin/init/master-base || { + echo Rebase failed 1>&2 + bash -i || exit +} +echo "fix up?" +bash -i +log '$' cd $cpwd +cd $cpwd +execute git fetch -f ../rebase-tmp init:init/master || { + echo Fetch of init/master failed 1>&2 + bash -i || exit +} +execute rm -rf ../rebase-tmp + +git branch -f init/master-base HEAD + +old_head=$(git rev-parse HEAD) +log Merging init/master '('$(git log -1 --oneline init/master)')' +execute git merge --no-ff init/master || { + echo Merge failed 1>&2 + bash -i || exit +} +printf "%s\t\t%s\n" init $(git show-ref --hash init/master) >> $SHA1_FILE + +[ -f "../merge-fixes/init" ] && { + for p in $(cat "../merge-fixes/init"); do + $(dirname $0)/merge_fix -n "$p" || { + bash -i || exit + } + done +} + +new_head=$(git rev-parse HEAD) + +$no_build || + [ "$old_head" = "$new_head" ] || + [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] || { + + git push -f "$build_host":"$build_dir" master:refs/heads/next || { + echo git push failed 1>&2 + bash -i || exit + } + "$bin_dir/do_build" || { + echo Build failed 1>&2 + bash -i || exit + } +} + +exit 0