- disallow patch names that duplicate with previously applied patches - don't ask if you want to email; you do - don't flake out if unable to find a unique patch name Reference: /n/atom/patch/applied2013/apatchupd1 Date: Tue Jun 18 18:54:04 CES 2013 Signed-off-by: quanstro@quanstro.net --- /rc/bin/apatch/okay Tue Jun 18 18:53:04 2013 +++ /rc/bin/apatch/okay Tue Jun 18 18:53:04 2013 @@ -7,6 +7,11 @@ } i=$1 +if(! test -d $i){ + echo 'patch: missing patch: '^$i >[1=2] + exit missing patch +} + files=(files removed readme email) for(f in $files) if(! test -e $i/$f ){ --- /rc/bin/apatch/create Tue Jun 18 18:53:04 2013 +++ /rc/bin/apatch/create Tue Jun 18 18:53:04 2013 @@ -93,17 +93,22 @@ ~ $flagv 1 && echo patchd $PD/$patch >[1=2] -if(test -e $PD/$patch){ +if(test -e $PD/$patch || test -e $PD/appled/$patch){ if(~ $force n){ echo patch $patch already exists. echo Use flag -f to force and redefine it exit fail } >[1=2] + found=() for(i in `{seq 1 100}){ - if(! test -e $PD/$patch.$i){ + if(! test -e $PD/$patch.$i || test -e $PD/appled/$patch.$i){ patch = $patch.$i + found=1 break } + } + if(~ $#found 0){ + fatal too many patches in sequence } echo new name: $patch>[1=2] } --- /rc/bin/apatch/apply Tue Jun 18 18:53:04 2013 +++ /rc/bin/apatch/apply Tue Jun 18 18:53:04 2013 @@ -5,7 +5,7 @@ mountfs -a mountdist -w # writable -echo applying to [something] ... +echo applying to atom sources ... test -e /n/dist/lib/patch.skip && bind /dev/null /n/dist/lib/patch.skip test -e /n/dist/lib/patch.skipfile && bind /dev/null /n/dist/lib/patch.skipfile @@ -17,8 +17,7 @@ echo rm -rf $PD/$patch.* } $patch/applied $1 - echo patch has been applied. hit enter to notify $M or del to skip - read + echo patch has been applied. emailing... @{cd $PD/applied/$1 && $patch/diffemail ; echo ------; cat $errs} | mail -s 'applied patch: '^$PD/applied/$1 $M rm -f $errs