update revision 393fd55d91306e6def3a3d06748eee031f57bd17
2N/A#!/bin/sh
2N/Acommit=
2N/Aif type fetch >/dev/null 2>&1
2N/Athen
2N/A fetch=fetch
2N/Aelif type curl >/dev/null 2>&1
2N/Athen
2N/A fetch="curl -O"
2N/Aelse
2N/A exit 1
2N/Afi
2N/A
2N/Afor i
2N/Ado
2N/A z=`expr "$i" : 'http://www.ietf.org/internet-drafts/\(.*\)'`
2N/A if test -n "$z"
2N/A then
2N/A i="$z"
2N/A fi
2N/A if test -f "$i"
2N/A then
2N/A continue
2N/A fi
2N/A pat=`echo "$i" | sed 's/...txt/??.txt/'`
2N/A old=`echo $pat 2> /dev/null`
2N/A if test "X$old" != "X$pat"
2N/A then
2N/A newer=0
2N/A for j in $old
2N/A do
2N/A if test $j ">" $i
2N/A then
2N/A newer=1
2N/A fi
2N/A done
2N/A if test $newer = 1
2N/A then
2N/A continue;
2N/A fi
2N/A fi
2N/A if $fetch "http://www.ietf.org/internet-drafts/$i"
2N/A then
git add "$i"
if test "X$old" != "X$pat"
then
rm $old
git rm $old
commit="$commit $old"
fi
commit="$commit $i"
fi
done
if test -n "$commit"
then
git commit -m "new draft"
git push
fi