#!/bin/bash O=`pwd`/collected-patches mkdir -p $O rm -f $O/* M=`pwd`/checkout IFS=$'\n' LIST=`jhbuild -f jhbuildrc list` for i in $LIST ; do D=`jhbuild -f jhbuildrc run --in-checkoutdir="$i" -- bash -c 'pwd' 2>/dev/null` if [ $? == 0 ] ; then D=`echo $D | tr '\n' ' ' ` D=${D%% *} # echo "$i: $D" if [ "$D" != "$M" ] ; then cd $D if [ -e ".git" ]; then git diff --quiet --ignore-submodules || (echo "$i: dirty" && exit 1 ) || exit 1 FN=`git format-patch -o $O origin/master` cd - >/dev/null for p in $FN; do echo $p mv $p $O/$i-`basename $p` done fi fi fi done