[ "$branch" ] || {
branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
- branch=${branch#quilt/}
branch=${branch%%/*}
}
[ "$branch" ] || {
branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
- branch=${branch#quilt/}
branch=${branch%%/*}
}
execute git reset --hard stable
}
-heads=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
+heads=$(grep -v '^#' ../real_control | awk -F '\t' '$2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); }')
need_build=false
for h in $heads; do
tree=${h%%/*}
- [ "$tree" == "quilt" ] && tree=${h#quilt/}
[ -n "$start_from" ] && {
if [ "$tree" = "$start_from" ]; then
hlog=$(git log -1 --oneline $h) 2>/dev/null
log Merging $h "($hlog)"
old_head=$(git rev-parse HEAD)
+ [ -x "../pre-merge/$tree" ] && {
+ "../pre-merge/$tree" || bash -i || exit
+ }
case "$h" in
*:*)
do_rebase $h $tree
get_field()
{
grep -v '^#' ../real_control |
- awk -F ' ' '$3 == "'$1'" { print $'$2'; }'
+ awk -F '\t' '$3 == "'$1'" { print $'$2'; }'
}
trees="$@"
[ "$trees" ] ||
- trees=$(grep -v '^#' ../real_control | awk -F ' ' '{ print $3 }')
+ trees=$(grep -v '^#' ../real_control | awk -F '\t' '{ print $3 }')
for name in $trees; do
type=$(get_field "$name" 2)
continue
fi
+ if [ "$type" = "mmotm" ]; then
+ cd ../../mmotm/text || {
+ echo "Cannot chdir to ../../mmotm/text" 1>&2
+ continue
+ }
+ rsync -avHP --exclude .git --exclude broken-out.tar.gz --delete ozlabs.org:~akpm/public_html/mmotm/. .
+ cd "$origwd"
+ continue
+ fi
+
if [ "$type" = "quilt" ]; then
url=$(get_field "$name" 4)
url=${url%/} # strip trailing / if necessary
continue
}
find * -type f | grep -v '^series$' | sort >.series.old
- do_echo=echo
- grep -q NEXT_PATCHES series &&
- do_echo=:
- while read line; do
- case "$line" in
- *NEXT_PATCHES_START*) do_echo=echo ;;
- *NEXT_PATCHES_END*) do_echo=: ;;
- ''|\#*) : ;;
- *) $do_echo $line ;;
- esac
- done <series |
- sed -e 's/[ ]*#.*$//' -e '/^[ ]*$/d' |
+ if grep -q NEXT_PATCHES series; then
+ sed -n '/NEXT_PATCHES_START/,/NEXT_PATCHES_END/p' series
+ else
+ cat series
+ fi |
+ sed -e 's/[ \t]*#.*$//' -e '/^[ \t]*$/d' |
sort >.series.next
- sed "s|^|$url/|" .series.next |
- wget -N -nv --no-cache -i - || {
- echo "Wget of series '$name' failed" 1>&2
- cd ..
- rm -rf "$name"
- git checkout "$name"
- cd "$origwd"
- continue
+ [ -s .series.next ] && {
+ sed "s|^|$url/|" .series.next |
+ wget -N -nv --no-cache -i - || {
+ echo "Wget of series '$name' failed" 1>&2
+ cd ..
+ rm -rf "$name"
+ git checkout "$name"
+ cd "$origwd"
+ continue
+ }
}
comm -23 .series.old .series.next | xargs -r rm -f
rm -f .series.old .series.next
#!/bin/bash
+log_file=../akpm-import.log
+
log()
{
- echo "$@" | tee -a ../akpm-import.log
+ echo "$@" | tee -a $log_file
}
execute()
{
log "$" $@
- "$@" 2>&1 | tee -a ../akpm-import.log
- [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
+ "$@" 2>&1 | tee -a $log_file
+ [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1
}
name="akpm"
exit 1
}
-mv -f "$sfile" "$sfile.orig"
-do_echo=echo
-grep -q NEXT_PATCHES "$sfile.orig" && do_echo=:
-while read line; do
- case $line in
- *NEXT_PATCHES_START*) do_echo=echo
- ;;
- *NEXT_PATCHES_END*) do_echo=:
- ;;
- esac
- $do_echo $line
-done <"$sfile.orig" |
- sed -e 's/[ ]*#.*$//' -e '/^[ ]*$/d' >"$sfile"
-
-git show-ref --quiet --verify "refs/heads/quilt/$name" ||
- execute git branch "quilt/$name" "$base"
-
-[ -s "$sfile" ] || {
- log " quilt series is empty"
- mv -f "$sfile.orig" "$sfile"
- execute git update-ref "refs/heads/quilt/$name" "$nbase"
- exit 0
-}
-
[ -d "../quilt-tmp" ] ||
execute git clone -s -l -n -q . ../quilt-tmp
log '$' cd ../quilt-tmp
cd ../quilt-tmp
execute git reset --hard "$base"
-execute git merge --no-edit --no-stat "$nbase" || bash -i || exit 1
-git branch base
+git branch current-base
+
+sed_exp='/NEXT_PATCHES_START/,/NEXT_PATCHES_END/{s/[ \t]*#.*$//;/^[ \t]*$/!p;};/^linux-next.patch/p'
+patches=$(sed -n "$sed_exp" "$sfile")
-for f in $(cat "$mmotm/series"); do
+for f in $patches; do
[ "$f" = "origin.patch" ] && continue
- [ "$f" = "linux-next.patch" ] && continue
- execute git am "$mmotm/broken-out/$f" ||
- bash -i ||
- break
+ [ "$f" = "linux-next.patch" ] && {
+ git branch current
+ execute git merge --no-edit --no-stat "$nbase"
+ git branch master-base
+ continue
+ }
+ execute git am --patch-format=mbox "$mmotm/broken-out/$f"
done
log '$' cd $cpwd
cd $cpwd
-execute git fetch -f ../quilt-tmp master:"quilt/$name"
-execute git fetch -f ../quilt-tmp base:"quilt/${name}-base"
-
-mv -f "$sfile.orig" "$sfile"
+execute git fetch -f ../quilt-tmp current:"$name/current"
+execute git fetch -f ../quilt-tmp current-base:"$name/current-base"
+execute git fetch -f ../quilt-tmp master:"$name/master"
+execute git fetch -f ../quilt-tmp master-base:"$name/master-base"
-[ -d "../quilt-tmp" ] &&
- rm -rf ../quilt-tmp
+rm -rf ../quilt-tmp
exit 0
i=$((i + 1))
#for t in 'POWER5%gr%' 'POWER5%gs%' 'POWER6%' 'POWER7%' '%Opteron%' '%PPC970%'; do
-for t in 'POWER5%gs%' 'POWER6%' 'POWER7%' '%PPC970%'; do
+#for t in 'POWER5%gs%' 'POWER6%' 'POWER7%' '%PPC970%'; do
+for t in 'POWER5%gs%' 'POWER6%' 'POWER7%'; do
cat >"../abat/$d-abat.ozlabs.ibm.com-$i" <<EOF
option title linux-next $d boot test
#option timed 2010-07-07 19:30 +1000
[ "$dir" ] || dir="$(date '+%Y%m%d')"
-heads=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
+heads=$(grep -v '^#' ../real_control | awk -F '\t' '$2=="quilt" || $2=="git" { printf("%s/%s ", $3, $5); }')
for h in $heads; do
tree=${h%%/*}
- rem_ref=refs/remotes
- [ "$tree" == "quilt" ] && {
- tree=${h#quilt/}
- rem_ref=refs/heads
- }
[ "${h%:*}" == "${h}" ] ||
h="${tree}/${h##*:}"
- git update-ref "refs/next/$dir/$tree" "$rem_ref/$h"
+ git update-ref "refs/next/$dir/$tree" "$h"
done
git pack-refs --all --prune
git commit -s -v -a -m "Add linux-next specific files for $d"
git tag -u 41D5C07A -m "$n" "$n"
-git update-ref refs/heads/stable refs/remotes/origin/master
+git branch -f stable refs/remotes/origin/master
p="patch-$l-$n"
git diff-tree -p "$l.." >"../$p"
cpwd=../next
+git update-ref "refs/next/$today/akpm-current" akpm/current
+git branch -f akpm-current/current akpm/current
+
+git branch -f akpm/base HEAD
+
+hlog=$(git log -1 --oneline akpm-current/current) 2>/dev/null
+log Merging akpm-current/current "($hlog)"
+execute git merge akpm-current/current || {
+ echo Merge failed 1>&2
+ echo $h >>../merge.debug
+ git diff >>../merge.debug 2>&1
+ git diff 2>&1 | egrep -q '<<<<<|^\*' && {
+ bash -i || exit
+ }
+ GIT_EDITOR=: execute git commit -v -a
+ execute git diff -M --stat --summary 'HEAD^..'
+}
+
execute git clone -s -l -n -q . ../rebase-tmp || {
echo Clone failed 1>&2
bash -i || exit
}
log '$' cd ../rebase-tmp
cd ../rebase-tmp
-execute git fetch --no-tags $cpwd refs/heads/quilt/akpm:akpm || {
- echo Fetch of top failed 1>&2
+execute git fetch --no-tags $cpwd refs/heads/akpm/master:akpm || {
+ echo Fetch of akpm/master failed 1>&2
bash -i || exit
}
-execute git fetch --no-tags $cpwd refs/heads/quilt/akpm-base:akpm-base || {
- echo Fetch of base failed 1>&2
+execute git fetch --no-tags $cpwd refs/heads/akpm/master-base:akpm-base || {
+ echo Fetch of akpm/master-base failed 1>&2
bash -i || exit
}
execute git checkout akpm || {
echo Rebase failed 1>&2
bash -i || exit
}
-echo "fix up? use git rebase -i --onto master akpm-base"
+echo "fix up?"
bash -i
log '$' cd $cpwd
cd $cpwd
-execute git fetch -f ../rebase-tmp akpm:quilt/akpm || {
+execute git fetch -f ../rebase-tmp akpm:akpm/master || {
echo Pull failed 1>&2
bash -i || exit
}
execute rm -rf ../rebase-tmp
-git update-ref "refs/next/$today/akpm" quilt/akpm
-git update-ref refs/heads/quilt/akpm-base HEAD
+git update-ref "refs/next/$today/akpm" akpm/master
+
+git branch -f akpm/master-base HEAD
-log Merging quilt/akpm '('$(git log -1 --oneline quilt/akpm)')'
-execute git merge --no-ff quilt/akpm || {
+log Merging akpm/master '('$(git log -1 --oneline akpm/master)')'
+execute git merge --no-ff akpm/master || {
echo Merge failed 1>&2
bash -i || exit
}
echo "git reset failed" 1>&2
bash -i || exit
}
-execute git add . || {
+execute git add -A . || {
echo "git add failed" 1>&2
bash -i || exit
}
[ "$branch" ] || {
branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
- branch=${branch#quilt/}
branch=${branch%%/*}
}
sylpheed --compose "mailto:$contact?Cc=linux-next@vger.kernel.org,%20linux-kernel@vger.kernel.org&Subject=linux-next: manual merge of the $branch tree with the tree&Body=Hi $greeting,%0A\
%0A\
-Today's linux-next merge of the $branch tree got a conflict in $file between commit (%22%22) from the tree and commit (%22%22) from the $branch tree."
+Today's linux-next merge of the $branch tree got a conflict in $file between commit (%22%22) from the tree and commit (%22%22) from the $branch tree.%0A\
+%0A\
+I fixed it up (see below) and can carry the fix as necessary (no action%0A\
+is required)."
exit 0
#!/bin/bash
-#cp /dev/null ../quilt-import.log
+log_file=../quilt-import.log
+#cp /dev/null $log_file
log()
{
- echo "$@" | tee -a ../quilt-import.log
+ echo "$@" | tee -a $log_file
}
execute()
{
log "$" $@
- "$@" 2>&1 | tee -a ../quilt-import.log
- [ ${PIPESTATUS[0]} -eq 0 ] || sh -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
+ "$@" 2>&1 | tee -a $log_file
+ [ ${PIPESTATUS[0]} -eq 0 ] || $SHELL -i || exit 1
}
-quilters=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { print $3; }')
+cpwd=$(pwd)
+
+quilters=$(grep -v '^#' ../real_control | awk -F '\t' '$2=="quilt" { print $3; }')
for name in $quilters; do
sfile="../quilt/$name/series"
- base=$(sed -n 's/^#[ ]*NEXT[-_]BASE[ ]*\([^ ]*\)[ ]*$/\1/p' "$sfile")
+ base=$(sed -n 's/^#[ \t]*NEXT[-_]BASE[ \t]*\([^ \t]*\)[ \t]*$/\1/p' "$sfile")
if [ -n "$base" ]; then
- nbase=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$base"'" { if ($2=="quilt") printf("quilt/%s", "'"$base"'"); else printf("%s/%s", "'"$base"'", $5); }')
+ nbase=$(grep -v '^#' ../real_control | awk -F '\t' '$3=="'"$base"'" { printf("%s/%s", "'"$base"'", $5); }')
[ -n "$nbase" ] && base="$nbase"
else
- base=$(sed -n 's/^#[ ]*BASE[ ]*\(.*\)[ ]*$/\1/p' "$sfile")
+ base=$(sed -n 's/^#[ \t]*BASE[ \t]*\(.*\)[ \t]*$/\1/p' "$sfile")
[ -n "$base" ] || {
# for stgit
base=$(sed '1{s/^#.*GIT commit \(.*\)$/\1/;q}' "$sfile")
case "$base" in
*-git[0-9]*) rbase=$($(dirname $0)/get_gitid "${base}")
;;
- commit*) rbase=$(expr "$base" : "commit[ ]*\(.*\)")
+ commit*) rbase=${base##commit*[[:space:]]}
;;
[0-9]*.*) rbase="v$base"
;;
}
# don't bother importing things that haven't changed
- mb=$(git merge-base "$rbase_sha1" "quilt/$name")
+ mb=$(git merge-base "$rbase_sha1" "$name/master")
change_size=$(cd ../quilt;git diff last_merge.. -- "$name/" | wc -c)
[ "$mb" = "$rbase_sha1" ] && [ $change_size -eq 0 ] && {
log "Unchanged quilt series $name"
continue
}
- mv -f "$sfile" "$sfile.orig"
- do_echo=echo
- grep -q NEXT_PATCHES "$sfile.orig" && do_echo=:
- while read line; do
- case $line in
- *NEXT_PATCHES_START*) do_echo=echo
- ;;
- *NEXT_PATCHES_END*) do_echo=:
- ;;
- esac
- $do_echo $line
- done <"$sfile.orig" |
- sed -e 's/[ ]*#.*$//' -e '/^[ ]*$/d' >"$sfile"
-
- git show-ref --quiet --verify "refs/heads/quilt/$name" ||
- execute git branch "quilt/$name" "$rbase_sha1"
-
- [ -s "$sfile" ] || {
+ sed_exp='s/[ \t]*#.*$//;/^[ \t]*$/!p'
+ grep -q NEXT_PATCHES "$sfile" &&
+ sed_exp='/NEXT_PATCHES_START/,/NEXT_PATCHES_END/{'"$sed_exp"';}'
+ patches=$(sed -n "$sed_exp" "$sfile")
+
+ git show-ref --quiet --verify "refs/heads/$name/master" ||
+ execute git branch "$name/master" "$rbase_sha1"
+
+ [ -n "$patches" ] || {
log " quilt series is empty"
- mv -f "$sfile.orig" "$sfile"
- execute git update-ref "refs/heads/quilt/$name" "$rbase_sha1"
+ execute git branch -f "$name/master" "$rbase_sha1"
continue
}
cd ../quilt-tmp
execute git reset --hard "$rbase_sha1"
- while read f <&5 ; do
+ for f in $patches; do
old_head=$(git rev-parse --verify HEAD)
execute git am "../quilt/$name/$f"
new_head=$(git rev-parse --verify HEAD)
echo "Tree unchanged, please check ..."
bash -i || exit
}
- done 5<"../quilt/$name/series"
-
- log '$' cd ../next
- cd ../next
+ done
- execute git fetch -f ../quilt-tmp master:"quilt/$name"
+ log '$' cd $cpwd
+ cd $cpwd
- mv -f "$sfile.orig" "$sfile"
+ execute git fetch -f ../quilt-tmp master:"$name/master"
done
[ -d "../quilt-tmp" ] &&
rm -rf ../quilt-tmp
-( cd ../quilt; git update-ref refs/heads/last_merge HEAD )
+( cd ../quilt; git branch -f last_merge HEAD )
exit 0