#!/bin/rc
infernosvn='http://inferno-os.googlecode.com/svn/trunk'
fn getdir {
rev=`{hget $1 | htmlfmt -a -l 1000 | grep Revision |awk '{print $2}' | sed 's/://g'}
if ( test -r $rev ) { update=no; echo $1^':'^$rev^':Update not needed'}
if not { update=yes; echo $1^':'^$rev^': Updating'}
ls=`{hget $1 | htmlfmt -a -l 1000 | awk '{print $2}' | sed 's/[\[\]]//g' | sed '/^$/d' | sed '/\.\.\//d' | sed '/:$/d'}
for (f in $ls) {
name=`{basename $f}
dir=`{basename -d $f | sed '/\./d'}
if (test $dir) {
mkdir -p $dir
cd $dir
getdir $1^'/'^$dir
cd ..
}
if (test $name) {
if (~ $update yes) {
hget -o $name $1^'/'^$name >/dev/null >[2=1]
}
}
}
if (~ $update yes) { touch $rev }
}
if(! ~ $#* 1) {
echo usage:
echo ' gsvn [ site | http://project.googlecode.com/svn/trunk ]'
exit
}
switch($1){
case inferno
getdir $infernosvn
exit
case *
getdir $1
exit
}
|