| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | OUT=ChangeLog |
| 3 | BASE=http://etoys.squeak.org/updates |
| 4 | VERSION=etoys5.0 |
| 5 | FETCH="curl -s -S" |
| 6 | #FETCH="wget -q -O -" |
| 7 | TAC=`whichscip-shell system . . which. tac || echoscip-shell system . . echo. tail -r` |
| 8 | UPDATES=`$FETCH $BASE/updates.list \ |
| 9 | | trscip-shell system . . tr. '\r' '\n' \ |
| 10 | | awkscip-shell system . . awk. "/^#/{p=0};{if(p)print};/^#$VERSION/{p=1}" \ |
| 11 | | $TAC \ |
| 12 | ` |
| 13 | mkdirscip-shell system . . mkdir. -p updates |
| 14 | mvscip-shell system . . mv. -f $OUT $OUT~ |
| 15 | |
| 16 | COUNT=`echoscip-shell system . . echo. $UPDATES|wcscip-shell system . . wc. -w` |
| 17 | |
| 18 | for f in $UPDATES ; do |
| 19 | N=$(($N+1)) |
| 20 | printfscip-shell system . . printf. "[$N/$COUNT] $f \r" |
| 21 | |
| 22 | [scip-shell system . . `[`. -f updates/$f ] || $FETCH $BASE/$f > updates/$f |
| 23 | |
| 24 | echoscip-shell system . . echo. >> $OUT |
| 25 | echoscip-shell system . . echo. === $f === >> $OUT |
| 26 | catscip-shell system . . cat. updates/$f \ |
| 27 | | trscip-shell system . . tr. '\r' '\n' \ |
| 28 | | awkscip-shell system . . awk. '/"/{if(p){print;exit}};/^"/{p=1};{if(p)print};/\!/{c=c+1;if(c>1)exit;if(p){print;exit}}scip-shell filesystem . . `/"/{if(p){print;exit}};/^"/{p=1};{if(p)print};/\!/{c=c+1;if(c>1)exit;if(p){print;exit}}`.' \ |
| 29 | | sedscip-shell system . . sed. 's/"//g;s/!//g' \ |
| 30 | >> $OUT |
| 31 | done |
| 32 | |
| 33 | printfscip-shell system . . printf. "\n" |