#!/bin/bash function repository_configure () { i=$1 checkoutdir=`jhbuild -f jhbuildrc run --in-checkoutdir=$i -- pwd` # unfortunately, jhbuild run also echos the command it ran, so we need to remove that checkoutdir=`echo $checkoutdir | tr '\n' ' ' ` checkoutdir=${checkoutdir%% *} # metamodules don't have a checkoutdir, so check for .git/config if [ -e "$checkoutdir/.git/config" ]; then cd $checkoutdir case $i in xserver) EMAIL="xorg-devel@lists.x.org" SUBJECT="PATCH" ;; libxcb) EMAIL="xcb@lists.freedesktop.org" SUBJECT="PATCH" ;; xcb-*) EMAIL="xcb@lists.freedesktop.org" SUBJECT="PATCH $i" ;; mesa-mesa) EMAIL="mesa-dev@lists.freedesktop.org" SUBJECT="PATCH" ;; mesa-*) EMAIL="mesa-dev@lists.freedesktop.org" SUBJECT="PATCH $i" ;; fontconfig) EMAIL="fontconfig@lists.freedesktop.org" SUBJECT="PATCH" ;; xkeyboard-config) EMAIL="" # requests patch submission via bugzilla SUBJECT="PATCH" ;; libpixman) EMAIL="pixman@lists.freedesktop.org" SUBJECT="PATCH" ;; *) EMAIL="xorg-devel@lists.x.org" SUBJECT="PATCH `git config remote.origin.url | sed s#git://anongit.freedesktop.org/git/xorg/##`" ;; esac echo "$i: email to $EMAIL with subject $SUBJECT" if [ -n "$EMAIL" ]; then git config --replace-all sendemail.to $EMAIL fi git config --replace-all format.subjectprefix "$SUBJECT" if [ $i != "xserver" ]; then git remote set-url --push origin `git config remote.origin.url | sed s#git://anongit#ssh://git#` endif cd - >/dev/null fi } if [ "$#" -gt 0 ] ; then ARGS="$*" else ARGS=`jhbuild -f jhbuildrc list` fi IFS=$'\n' for i in $ARGS ; do repository_configure $i done