]> git.ozlabs.org Git - next-scripts/commitdiff
Various updates I forgot to commit
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 18 Mar 2009 23:59:23 +0000 (10:59 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 18 Mar 2009 23:59:23 +0000 (10:59 +1100)
backup_next
fetch_trees
find_branch
make_abat_scripts [new file with mode: 0755]
merge_old_version [new file with mode: 0755]
summary [new file with mode: 0755]

index 062648dbb8615019c3a5b54908c36773e0175dbe..f9249a1dc25d25a1f0315e163aab8e707f0bf95f 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+host="fs"
+[ "$1" ] && host="$1"
+
 rsync -avHP --include next/.git --include next/.git/'**' --exclude next/'**' \
        --include quilt/.git --include quilt/.git/'**' --exclude quilt/'**' \
-       --delete --delete-excluded next/ fs:next/
+       --delete --delete-excluded next/ "$host":next/
index c5bdf73178d76d57b0b8436910e6e8a30b141fea..69105f41766cdb42ed03b36ba30b9ea6f7fb8449 100755 (executable)
@@ -1,20 +1,27 @@
 #!/bin/bash
 
-IFS='  '
-
 origwd=$(pwd)
 
-while read email type name url ref; do
-       [[ "$email" =~ '^#.*$' ]] && {
-               echo $name: skipped
-               continue
-       }
+get_field()
+{
+       grep -v '^#' ../real_control |
+               awk -F '        ' '$3 == "'$1'" { print $'$2'; }'
+}
+
+trees=$(grep -v '^#' ../real_control | awk -F '        ' '{ print $3 }')
+
+for name in $trees; do
+       type=$(get_field "$name" 2)
+
        echo $name: $type
        if [ "$type" = "git" ]; then
                git fetch "$name"
                continue
        fi
+
        if [ "$type" = "quilt" ]; then
+               url=$(get_field "$name" 4)
+
                case "$url" in
                http://kernel.org/*|http://www.kernel.org/*)
                        use_rsync=true
@@ -96,7 +103,7 @@ while read email type name url ref; do
                rm -f .series.old .series.next
                cd "$origwd"
        fi
-done <../real_control
+done
 
 cd ../quilt
 git add .
index 95c3bfa077b12c1ce656ae71e50b34c51a206b6c..dbaf1fa19b1c4f9550501c366d0dc453e0b6e878 100755 (executable)
@@ -5,6 +5,9 @@ commit=$1
        echo "$0: <commit id> [<top tag> [<linus branch>]]" 1>&2
        exit 1
 }
+commit=$(git rev-parse --verify "$commit")
+[ "$commit" ] ||
+       exit 1
 
 top=$2
 [ "$top" ] || top=HEAD
@@ -14,15 +17,26 @@ linus=$3
 
 base=$(git merge-base "$linus" "$top")
 
-git log --first-parent --pretty='format:%H %P' "$base".."$top" |
+git log --first-parent --reverse --pretty='format:%H %P' "$base".."$top" |
 while read m p1 p2
 do
-       [ "$p2" ] || continue
+       [ "$p1" = "$commit" ] && {
+               echo "Directly committed"
+               break
+       }
+       [ "$p2" ] ||
+               continue
        git rev-list $base..$p2 | grep -q "$commit" || continue
-       branch=$(git show $m | sed -n "s/[      ]*Merge .* '\([^']*\)'/\1/p")
-       tree=${branch%%/*}
-       [ "$tree" = "quilt" ] && tree=${branch##*/}
-       echo "$tree"
+       branch=$(git show $m | sed -n "s/[      ]*Merge .*'\([^']*\)'\( of \([^ ]*\).*\)*$/\1|\3/p")
+       tree=${branch##*|}
+       branch=${branch%%|*}
+       [ "$tree" ] || {
+               tree=${branch%%/*}
+               [ "$tree" = "quilt" ] && tree=${branch##*/}
+               echo "$tree"
+               break
+       }
+       echo "$tree#$branch"
        break
 done
 
diff --git a/make_abat_scripts b/make_abat_scripts
new file mode 100755 (executable)
index 0000000..d2a99dc
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+d="$1"
+
+[ -d ../abat ] || mkdir ../abat
+
+i=1
+for t in "IBM,9124-720 eServer OpenPower 720" "IBM,9110-51A System p5 510" "IBM,9117-MMA System p 570"
+do
+       cat >"../abat/$d-abat.ozlabs.ibm.com-$i" <<EOF
+option title linux-next $d boot test
+class next type="$t"
++\$kernel "master^"
++\$config http://ozlabs.au.ibm.com/~tony/abat/configs/no_CONFIG_LOCALVERSION_AUTO.config
+build generic git git://fs.ozlabs.ibm.com/home/kernel/linux-next.git \$kernel -c \$config -m -j\$num_cpus
+boot initcall_debug
+EOF
+       i=$((i + 1));
+done
+
+i=1
+for t in 'type="88552RZ"' 'type="IBM eServer BladeCenter LS20 -[885055U]-"' 'type="-[622142U]-"' 'type="PowerMac7,2"' 'machine_name="js22-bup1"'
+do
+       cat >"../abat/$d-abat.linux.ibm.com-$i" <<EOF
+option title linux-next $d boot test
+class next $t
++\$kernel "master^"
++\$config http://ozlabs.au.ibm.com/~tony/abat/configs/no_CONFIG_LOCALVERSION_AUTO.config
+build generic git git://ozlabs.au.ibm.com/srv/git/sfr/next.git \$kernel -c \$config -m -j\$num_cpus
+boot initcall_debug
+EOF
+       i=$((i + 1));
+done
+
+exit 0
diff --git a/merge_old_version b/merge_old_version
new file mode 100755 (executable)
index 0000000..b84bc0c
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+LOG_FILE="../merge.log"
+build_host="sprygo"
+build_dir="/scratch/sfr/next"
+build_cmd="bin/build_next"
+
+no_build=false
+[ "$1" = "-n" ] && {
+       shift
+       no_build=true
+}
+
+tree=$1
+ver=$2
+
+rev=$(git rev-parse -verify "next-$ver/$tree")
+[ "$rev" ] || {
+       echo "No such tree/date" 1>&2
+       exit 1
+}
+
+[ -n "$3" ] && build_host="$3"
+
+log()
+{
+       echo "$@" | tee -a $LOG_FILE
+}
+
+execute()
+{
+       log "$" $@
+       $@ 2>&1 | tee -a $LOG_FILE
+       return ${PIPESTATUS[0]}
+}
+
+GIT_EDITOR=: execute git reset --hard 'HEAD^' || {
+       echo "git reset failed" 1>&2
+       bash -i || exit
+}
+
+log Merging "next-$ver/$tree"
+execute git merge "next-$ver/$tree" || {
+       echo Merge failed 1>&2
+       bash -i || exit
+       GIT_EDITOR=: execute git commit -v -a
+       execute git diff -M --stat --summary 'HEAD^..'
+}
+
+$no_build && exit 0
+
+rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
+       echo Rsync failed 1>&2
+       bash -i || exit
+}
+
+echo "Building using $build_cmd on $build_host"
+ssh "$build_host" "$build_cmd" || {
+       echo Build failed 1>&2
+       bash -i || exit
+}
+
+d=$(date --date "5 hours ago" '+%Y%m%d')
+git update-ref "refs/heads/next-$d/broken/$tree" "refs/heads/next-$d/$tree"
+git update-ref "refs/heads/next-$d/$tree" "refs/heads/next-$ver/$tree"
+
+exit 0
diff --git a/summary b/summary
new file mode 100755 (executable)
index 0000000..1aa4866
--- /dev/null
+++ b/summary
@@ -0,0 +1,60 @@
+#!/bin/bash --norc
+
+LOG_FILE="../summary"
+
+cp /dev/null $LOG_FILE
+
+log()
+{
+       echo "$@" | tee -a $LOG_FILE
+}
+
+patch_and_sha_ids()
+{
+       echo "$*" | xargs -r -n 1 git diff-tree -p | git patch-id | sort
+}
+
+patch_ids()
+{
+       patch_and_sha_ids "$@" | cut -d' ' -f1
+}
+
+heads=$(grep -v '^#' ../real_control | awk -F '        ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
+
+seen_ids=""
+seen_heads=""
+seen_sha1s=""
+
+for h in $heads; do
+       mb=$(git merge-base origin/master $h)
+       rh=$(git rev-parse $h)
+       [ "$mb" = "$rh" ] && {
+               log $h
+               continue
+       }
+
+       c=$(git rev-list --no-merges $mb...$rh $seen_heads | sort)
+       seen_heads="$seen_heads ^$rh"
+       [ -z "$c" ] && {
+               log $h
+               continue
+       }
+
+#      origin_ids=$(patch_ids $(git rev-list --no-merges $mb..origin/master))
+
+       is=$(patch_and_sha_ids $c)
+#      is=$(join -v 1 <(echo "$is") <(echo "$origin_ids"))
+       is=$(join -v 1 <(echo "$is") ../origin1.ids)
+       is=$(join -v 1 <(echo "$is") <(echo "$seen_ids"))
+       c1=$(echo "$is" | cut -d' ' -f2)
+       [ "$is" ] && seen_ids=$( (echo "$seen_ids"; echo "$is" | cut -d' ' -f1) | sort)
+
+       log $h \($(echo "$c" | wc -w) $(echo "$c1" | wc -w)\)
+
+       seen_sha1s="$seen_sha1s $c1"
+done
+
+log
+git shortlog --no-walk $seen_sha1s 2>&1 | tee -a $LOG_FILE
+
+exit 0