]> git.ozlabs.org Git - next-scripts/commitdiff
allow for optional building after merging a tree
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Nov 2008 05:25:34 +0000 (16:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Nov 2008 05:25:34 +0000 (16:25 +1100)
do_merge
make_tree_file

index 44b90d7f65ec86fff754377b1e0d52d1d268478c..ff19ef6f17be0386c1b6f2c586bb553175b0d96f 100755 (executable)
--- a/do_merge
+++ b/do_merge
@@ -31,7 +31,11 @@ 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); }')
 
+need_build=false
+
 for h in $heads; do
+       tree=${h%/*}
+       [ "$tree" == "quilt" ] && tree=${h#quilt/}
        log Merging $h
        old_head=$(git rev-parse HEAD)
        execute git merge $h || {
@@ -40,9 +44,21 @@ for h in $heads; do
                GIT_EDITOR=: execute git commit -v -a
                execute git diff -M --stat --summary 'HEAD^..'
        }
-       new_head=$(git rev-parse HEAD)
-       [ "$old_head" = "$new_head" ] && continue
        $no_build && continue
+       $need_build || {
+               # See if we need to build after merging this tree
+               new_head=$(git rev-parse HEAD)
+               [ "$old_head" = "$new_head" ] ||
+                       need_build=true
+               $need_build || 
+                       [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] ||
+                       need_build=true
+       }
+       $need_build ||
+               continue
+       do_build=$(grep -v '^#' ../real_control | awk -F '      ' '$3=="'$tree'" { print $6; }')
+       [ "$do_build" = "yes" ] ||
+               continue
        rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
                echo Rsync failed 1>&2
                bash -i || exit
@@ -51,6 +67,7 @@ for h in $heads; do
                echo Build failed 1>&2
                bash -i || exit
        }
+       need_build=false
 done
 
 exit 0
index 83ade7542216de0aca39296a5b03f9373cd4906f..8a7549210510e0181b7d98a9c85f5af7711e57d8 100755 (executable)
@@ -18,7 +18,7 @@ echo 'Name            SHA1
 ----           ----' > Next/SHA1s
 
 IFS='  '
-while read email type name url ref; do
+while read email type name url ref build; do
        [[ "$email" =~ '^#.*$' ]] && continue
        tab="\t"
        [ $(echo "$name" | wc -c) -le 8 ] && tab="\t\t"