From: Stephen Rothwell Date: Fri, 15 Feb 2008 05:20:34 +0000 (+1100) Subject: Add update_trees X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=55e5aeea308c38bb13cc6ca612fe4625bbdf7fe6;p=next-scripts Add update_trees --- diff --git a/update_trees b/update_trees new file mode 100755 index 0000000..75333d0 --- /dev/null +++ b/update_trees @@ -0,0 +1,61 @@ +#!/bin/sh + +( + IFS=' ' + + while read email type name url ref; do + echo $name: $type + if [ "$type" = "git" ]; then + git fetch "$name" + continue + fi + ( + cd ../quilt/"$name" + wget -N --quiet --recursive --no-directories --no-parent "$url" + ) + done <../real_control + + ( + cd ../quilt + git add . + git commit -v -a + ) +) + +quilters=$(awk -F ' ' '$2=="quilt" { print $3; }' ../real_control) + +for name in $quilters; do + sfile="../quilt/$name/series" + base=$(sed -n 's/^[# ]*BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile") + case "$base" in + *-git[0-9]*) base=$(wget -q -O - "http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${base}.id") + ;; + commit*) base=$(expr "$base" : "commit[ ]*\(.*\)") + ;; + [0-9]*.*) base="v$base" + ;; + esac + echo "$sfile": "$base" + grep -q NEXT_PATCHES "$sfile" && { + mv -f "$sfile" "$sfile.orig" + do_echo=: + while read line; do + case $line in + *NEXT_PATCHES_START*) do_echo=echo + ;; + *NEXT_PATCHES_END*) do_echo=: + ;; + esac + $do_echo $line + done <"$sfile.orig" >"$sfile" + } + + git branch -D "quilt/$name" + git checkout -b "quilt/$name" "$base" || sh -i + git quiltimport --patches "../quilt/$name" || sh -i + + [ -f "$sfile.orig" ] && + mv -f $sfile.orig $sfile +done + +exit 0