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
25 sfile="../quilt/$name/series"
26 base=$(sed -n 's/^#[ ]*NEXT[-_]BASE[ ]*\([^ ]*\)[ ]*$/\1/p' "$sfile")
27 if [ -n "$base" ]; then
28 base=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$base"'" { if ($2=="quilt") printf("quilt/%s", "'"$base"'"); else printf("%s/%s", "'"$base"'", $5); }')
30 base=$(sed -n 's/^#[ ]*BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
33 base=$(sed '1{s/^#.*GIT commit \(.*\)$/\1/;q}' "$sfile")
40 *-git[0-9]*) rbase=$(wget -q -O - "http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${base}.id")
42 commit*) rbase=$(expr "$base" : "commit[ ]*\(.*\)")
44 [0-9]*.*) rbase="v$base"
47 log "Importing $name based on $base"
48 rbase_sha1=$(git rev-parse --verify "$rbase^{commit}") || {
53 # don't bother importing things that haven't changed
54 mb=$(git merge-base "$rbase_sha1" "quilt/$name")
55 change_size=$(cd ../quilt;git diff last_merge.. -- "$name/" | wc -c)
56 [ "$mb" = "$rbase_sha1" ] && [ $change_size -eq 0 ] && {
57 log "Unchanged quilt series $name"
61 mv -f "$sfile" "$sfile.orig"
63 grep -q NEXT_PATCHES "$sfile.orig" && do_echo=:
66 *NEXT_PATCHES_START*) do_echo=echo
68 *NEXT_PATCHES_END*) do_echo=:
73 sed -e 's/[ ]*#.*$//' -e '/^[ ]*$/d' >"$sfile"
75 git show-ref --quiet --verify "refs/heads/quilt/$name" ||
76 execute git branch "quilt/$name" "$rbase_sha1"
79 log " quilt series is empty"
80 mv -f "$sfile.orig" "$sfile"
81 execute git update-ref "refs/heads/quilt/$name" "$rbase_sha1"
85 [ -d "../quilt-tmp" ] ||
86 execute git clone -s -l -n -q . ../quilt-tmp
88 log '$' cd ../quilt-tmp
90 execute git reset --hard "$rbase_sha1"
92 author=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$name"'" { printf("%s", $1); }' | sed 's/,.*$//')
93 execute git quiltimport --author "$author" --patches "../quilt/$name"
98 execute git fetch -f ../quilt-tmp master:"quilt/$name"
100 mv -f "$sfile.orig" "$sfile"
103 [ -d "../quilt-tmp" ] &&
106 ( cd ../quilt; git update-ref refs/heads/last_merge HEAD )