#!/bin/bash p=4000.diff MAKE='nice -n 4 make -j3' OPTIONS="show update dry-run apply undry-run unapply compile install log exit" select opt in $OPTIONS; do if [ "$opt" = "show" ]; then vi $p elif [ "$opt" = "update" ]; then hg pull -u http://jusst.de/hg/multiproto elif [ "$opt" = "dry-run" ]; then patch --dry-run -p1 < $p elif [ "$opt" = "apply" ]; then patch -p1 < $p elif [ "$opt" = "undry-run" ]; then patch --dry-run -p1 -R < $p elif [ "$opt" = "unapply" ]; then patch -p1 -R < $p elif [ "$opt" = "compile" ]; then cd v4l && $MAKE distclean && \ $MAKE allmodconfig && $MAKE elif [ "$opt" = "install" ]; then sudo $MAKE install && cd .. elif [ "$opt" = "log" ]; then hg log|less elif [ "$opt" = "exit" ]; then exit else echo bad option fi done