wednesday night / a site for sore eyes
choose one: a few recent posts; links to embarassing things; rss was for robots.

<< March 5, 2007 >>
always bring me home

i think this is a useful script; shaver would probably do it without the temp file, though.

you put it in ~/bin, and symlink rpmbuild to it. then, whenever rpmbuild fails because some rpm isn't installed, it installs them (using rum, of course), and then runs the command again:

#!/bin/sh app="/usr/bin/${0##*/}" if [ ! -x "$app" ] ; then echo >&2 "specinst: $app not found" exit 1 fi errfile=$(mktemp -q) if (( $? )) ; then echo >&2 "specinst (${0##*/}): could not create temp file" exit 1 fi if ! "$app" $@ 2>"$errfile" ; then rpms=$(awk '/is needed by/ { print $1 }' < "$errfile") if [ ! "$rpms" ] ; then cat "$errfile" >&2 rm -f "$errfile" exit 1 fi rm -f $errfile echo "specinst (${0##*/}): installing $rpms" sudo rum in $rpms && "$app" $@ fi

also it probably only works in english locales. it has not been tested extensively.

* * *