#!/bin/sh # # Shell script to make a diff file of apcupsd # for submission to Riccardo # # Called: ./makediff <base-directory-from-last-snapshot> # # It assumes that it is called from the parent directory # of your work directory (new) and the base directory. # # It makes a copy of the base directory, makes a copy # of your current work directory (new), then cleans # up a lot of files in those directories. Any file # named "developer"s* will be deleted. This allows me # to create files such as kernsxxx in the main directory # without worrying that they will appear in the diff. # Finally, it does a diff of the two directories putting # and prints the output name. The original base # directory specified on the call line and your # work directory are not modified in any way. # # example of actuall call: ./makediff apcupsd-3.7.1-beta1 # # developer -- put your name here developer="kern" # new -- name of updated directory with your changes new="k" # # temp base directory, no need to change base="apcupsd-3.7.1" # if [ $# = 0 ] ; then echo "Need the base (old) directory as first argument" exit 1 fi if [ ! -d $1 ] ; then echo "Arg 1 must be a directory" exit 1 fi rm -rf ${base} cp -rp $1 ${base} rm -rf ${base}-${developer} cp -rp ${new} ${base}-${developer} find ${base}-${developer} ${base} -name '*~' -exec rm -f {} \; cd ${base}-${developer} rm -f ${developer}s* configure rm -f distributions/*/apccontrol.sh distributions/*/apcupsd distributions/*/awkhaltprog distributions/openbsd/apcupsd.conf rm -f distributions/*/apccontrol rm -f 1 2 cgi/1 cgi/2 cgi/config.h if [ -f Makefile ] ; then make distclean fi cd .. cd ${base} rm -f ${developer}s* configure rm -f distributions/*/apccontrol.sh distributions/*/apcupsd distributions/*/awkhaltprog distributions/openbsd/apcupsd.conf rm -f distributions/*/apccontrol rm -f 1 2 cgi/1 cgi/2 cgi/config.h if [ -f Makefile ] ; then make distclean fi cd .. # delete any old diff rm -f diff-$1-${developer} diff -u -r --new-file ${base} ${base}-${developer} >diff-$1-${developer} chmod 440 diff-$1-${developer} # delete "temp" files rm -rf ${base} rm -rf ${base}-${developer} echo " " echo "diff is in: diff-$1-${developer}" echo " " zed diff-$1-${developer}