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 base=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/origin.patch")
22 nbase=$(sed -n '1s/^GIT *\([^ ]*\).*$/\1/p' "$mmotm/broken-out/linux-next.patch")
23 git rev-parse --verify "$base" >/dev/null || {
24 log "Unknown origin BASE $base"
27 git rev-parse --verify "$nbase" >/dev/null || {
28 log "Unknown linux-next BASE $nbase"
31 db=$(git describe "$base")
32 dnb=$(git describe --contains "$nbase")
33 log "Importing akpm based on $db/$dnb"
35 [ -d "../quilt-tmp" ] ||
36 execute git clone -s -l -n -q . ../quilt-tmp
38 log '$' cd ../quilt-tmp
40 execute git checkout -b akpm/master "$db"
41 git branch akpm/current-base
44 /NEXT_PATCHES_START/,/NEXT_PATCHES_END/{
45 s/[ \t]*#.*NEXT_PATCHES_START[ \t]*\([^ \t]*\).*$/>\1/
46 s/[ \t]*#.*NEXT_PATCHES_END.*$/</
51 patches=$(sed -n "$sed_exp" "$sfile")
58 git branch akpm/current
59 execute git merge --no-edit --no-stat "$dnb"
60 git branch akpm/master-base
65 cref="$(git rev-parse --verify HEAD)"
69 [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
70 git branch -f "akpm/$cbranch"
75 execute git am --patch-format=mbox "$mmotm/broken-out/$f"
81 [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
82 git branch -f "akpm/$cbranch"
87 execute git fetch --force --no-tags ../quilt-tmp \
88 refs/heads/akpm/master:refs/heads/akpm/master \
89 refs/heads/akpm/master-base:refs/heads/akpm/master-base \
90 refs/heads/akpm/current:refs/heads/akpm/current \
91 refs/heads/akpm/current-base:refs/heads/akpm/current-base