3 log_file=../akpm-import.log
7 echo "$@" | tee -a $log_file
13 "$@" 2>&1 | tee -a $log_file
14 [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1
17 mmotm="../../mmotm/text"
21 [ -f "$mmotm/broken-out/origin.patch" ] &&
22 base=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/origin.patch")
24 base=$(git describe --abbrev=0 origin/master)
25 nbase=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/linux-next.patch")
26 git rev-parse --verify "$base" >/dev/null || {
27 log "Unknown origin BASE $base"
30 git rev-parse --verify "$nbase" >/dev/null || {
31 log "Unknown linux-next BASE $nbase"
34 db=$(git describe "$base")
35 dnb=$(git describe --contains "$nbase")
36 log "Importing akpm based on $db/$dnb"
38 [ -d "../quilt-tmp" ] ||
39 execute git clone -s -l -n -q . ../quilt-tmp
41 log '$' cd ../quilt-tmp
43 execute git checkout -b akpm/master "$db"
44 git branch akpm/current-base
47 /NEXT_PATCHES_START/,/NEXT_PATCHES_END/{
48 s/[ \t]*#.*NEXT_PATCHES_START[ \t]*\([^ \t]*\).*$/>\1/
49 s/[ \t]*#.*NEXT_PATCHES_END.*$/</
54 patches=$(sed -n "$sed_exp" "$sfile")
61 git branch akpm/current
62 execute git merge --no-edit --no-stat "$dnb"
63 git branch akpm/master-base
68 cref="$(git rev-parse --verify HEAD)"
72 [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
73 git branch -f "akpm/$cbranch"
78 execute git am --patch-format=mbox "$mmotm/broken-out/$f"
84 [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
85 git branch -f "akpm/$cbranch"
90 execute git fetch --force --no-tags ../quilt-tmp \
91 refs/heads/akpm/master:refs/heads/akpm/master \
92 refs/heads/akpm/master-base:refs/heads/akpm/master-base \
93 refs/heads/akpm/current:refs/heads/akpm/current \
94 refs/heads/akpm/current-base:refs/heads/akpm/current-base