use "builtin cd" not "cd" to avoid messing up plumbing Reference: /n/atom/patch/applied2013/apatchcd Date: Mon Aug 26 19:54:53 CES 2013 Signed-off-by: quanstro@quanstro.net --- /rc/bin/apatch/apply Mon Aug 26 19:54:23 2013 +++ /rc/bin/apatch/apply Mon Aug 26 19:54:24 2013 @@ -18,8 +18,14 @@ } $patch/applied $1 echo patch has been applied. emailing... - @{cd $PD/applied/$1 && $patch/diffemail ; echo ------; cat $errs} | - mail -s 'applied patch: '^$PD/applied/$1 $M `{cat $PD/applied/email|grep -v '^-$'} + u=`{cat $PD/applied/$1/email|grep -v '^-$'} + + # gross + if(~ $u quanstro@quanstro.net) + u=() + + @{builtin cd $PD/applied/$1 && $patch/diffemail ; echo ------; cat $errs} | + mail -s 'applied patch: '^$PD/applied/$1 $M $u rm -f $errs } --- /rc/bin/apatch/create Mon Aug 26 19:54:25 2013 +++ /rc/bin/apatch/create Mon Aug 26 19:54:25 2013 @@ -183,7 +183,7 @@ echo $patch >> /dist/apatch/applied echo $d locally applied. -# @{cd $PD/$1 && $patch/diffemails} | +# @{builtin cd $PD/$1 && $patch/diffemails} | # mail -s 'new patch: '^$PD/$1 $M fn sigexit sigint --- /rc/bin/apatch/diff Mon Aug 26 19:54:26 2013 +++ /rc/bin/apatch/diff Mon Aug 26 19:54:26 2013 @@ -20,7 +20,7 @@ mountfs d=$PD/$1 -cd $d || fail no dir $d +builtin cd $d || fail no dir $d fn mkdiff { if(test -e $2.orig){ --- /rc/bin/apatch/list Mon Aug 26 19:54:27 2013 +++ /rc/bin/apatch/list Mon Aug 26 19:54:28 2013 @@ -3,7 +3,7 @@ rfork e . /rc/bin/apatch/defs mountfs -cd $PD || fail no $PD +builtin cd $PD || fail no $PD args='dirs' flagfmt='a,v' @@ -14,7 +14,8 @@ dirs=$* if(~ $#dirs 0){ - q = `{ls -tr | grep -v '\.[0-9]+$'} + q = `{ls -tr | grep -v '\.[0-9]+$ +applied'} p = () for(i in $q) test -d $i && p = ($p $i) @@ -34,10 +35,8 @@ } ' } -whatis dirs } } -echo dirs >[1=2] for(i in $dirs){ if($patch/okay $i){ --- /rc/bin/apatch/notify Mon Aug 26 19:54:28 2013 +++ /rc/bin/apatch/notify Mon Aug 26 19:54:29 2013 @@ -4,7 +4,7 @@ . /rc/bin/apatch/defs mountfs -cd $PD || fail no $PD +builtin cd $PD || fail no $PD for(i in [a-zA-Z]*){ if(! test -e $i/diffs && test -e $i/done ){ echo new patch $i >[1=2] --- /rc/bin/apatch/undo Mon Aug 26 19:54:30 2013 +++ /rc/bin/apatch/undo Mon Aug 26 19:54:30 2013 @@ -9,7 +9,7 @@ mountdist -w d=/n/dist/dist/$patch/$1 -must cd $d +must builtin cd $d fn xxx { if(test -e $2.backup){ --- /rc/bin/apatch/·apply Mon Aug 26 19:54:31 2013 +++ /rc/bin/apatch/·apply Mon Aug 26 19:54:31 2013 @@ -30,7 +30,7 @@ must dircp $d /n/dist/dist/patch/$1 } d=/n/dist/dist/patch/$1 -must cd $d +must builtin cd $d echo -n merge... >[1=2] fn xxx {