5 cp /dev/null ../quilt-import.log
9 echo "$@" | tee -a ../quilt-import.log
15 "$@" 2>&1 | tee -a ../quilt-import.log
18 quilters=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { print $3; }')
20 for name in $quilters; do
21 sfile="../quilt/$name/series"
22 base=$(sed -n 's/^[# ]*NEXT_BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
23 if [ -n "$base" ]; then
24 base=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$base"'" { if ($2=="quilt") printf("quilt/%s", "'"$base"'"); else printf("%s/%s", "'"$base"'", $5); }')
26 base=$(sed -n 's/^[# ]*BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
30 *-git[0-9]*) rbase=$(wget -q -O - "http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${base}.id")
32 commit*) rbase=$(expr "$base" : "commit[ ]*\(.*\)")
34 [0-9]*.*) rbase="v$base"
37 log "Importing $name based on $base"
38 git rev-list -n 1 "$rbase" -- >/dev/null 2>&1 || {
42 grep -q NEXT_PATCHES "$sfile" && {
43 mv -f "$sfile" "$sfile.orig"
47 *NEXT_PATCHES_START*) do_echo=echo
49 *NEXT_PATCHES_END*) do_echo=:
53 done <"$sfile.orig" >"$sfile"
56 mv -f "$sfile" "$sfile.tmp"
57 sed -e '/^[ ]*$/d' -e '^[ ]*#/d' <"$sfile.tmp" >"$sfile"
60 log " quilt series is empty"
61 [ -f "$sfile.orig" ] &&
62 mv -f "$sfile.orig" "$sfile"
66 execute git branch -D "quilt/$name"
67 execute git checkout -b "quilt/$name" "$rbase" || sh -i || {
68 [ -f "$sfile.orig" ] &&
69 mv -f "$sfile.orig" "$sfile"
72 author=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$name"'" { printf("%s", $1); }' | sed 's/,.*$//')
73 execute git quiltimport --author "$author" --patches "../quilt/$name" || sh -i || {
74 [ -f "$sfile.orig" ] &&
75 mv -f "$sfile.orig" "$sfile"
79 [ -f "$sfile.orig" ] &&
80 mv -f "$sfile.orig" "$sfile"