3 cp /dev/null ../quilt-import.log
7 echo "$@" | tee -a ../quilt-import.log
13 "$@" 2>&1 | tee -a ../quilt-import.log
14 [ ${PIPESTATUS[0]} -eq 0 ] || sh -i || {
15 [ -f "$sfile.orig" ] &&
16 mv -f "$sfile.orig" "$sfile"
21 quilters=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { print $3; }')
23 for name in $quilters; do
24 sfile="../quilt/$name/series"
25 base=$(sed -n 's/^[# ]*NEXT_BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
26 if [ -n "$base" ]; then
27 base=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$base"'" { if ($2=="quilt") printf("quilt/%s", "'"$base"'"); else printf("%s/%s", "'"$base"'", $5); }')
29 base=$(sed -n 's/^[# ]*BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
33 *-git[0-9]*) rbase=$(wget -q -O - "http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${base}.id")
35 commit*) rbase=$(expr "$base" : "commit[ ]*\(.*\)")
37 [0-9]*.*) rbase="v$base"
40 log "Importing $name based on $base"
41 rbase_sha1=$(git rev-parse --verify "$rbase^{commit}") || {
45 mv -f "$sfile" "$sfile.orig"
46 if grep -q NEXT_PATCHES "$sfile.orig"; then
50 *NEXT_PATCHES_START*) do_echo=echo
52 *NEXT_PATCHES_END*) do_echo=:
56 done <"$sfile.orig" >"$sfile"
58 cp "$sfile.orig" "$sfile"
61 git show-ref --quiet --verify "refs/heads/quilt/$name" ||
62 execute git branch "quilt/$name" "$rbase_sha1"
64 mv -f "$sfile" "$sfile.tmp"
65 sed -e '/^[ ]*$/d' -e '/^[ ]*#/d' <"$sfile.tmp" >"$sfile"
68 log " quilt series is empty"
69 [ -f "$sfile.orig" ] &&
70 mv -f "$sfile.orig" "$sfile"
71 execute git update-ref "refs/heads/quilt/$name" "$rbase_sha1"
75 execute git checkout "quilt/$name"
76 execute git reset --hard "$rbase_sha1"
78 author=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$name"'" { printf("%s", $1); }' | sed 's/,.*$//')
79 execute git quiltimport --author "$author" --patches "../quilt/$name"
81 [ -f "$sfile.orig" ] &&
82 mv -f "$sfile.orig" "$sfile"