2002-07-04 00:32:48 +00:00
|
|
|
#!/bin/sh
|
2004-06-08 07:12:10 +00:00
|
|
|
commit=
|
2012-04-26 12:22:49 +10:00
|
|
|
if type fetch >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
fetch=fetch
|
|
|
|
elif type curl >/dev/null 2>&1
|
|
|
|
then
|
2012-04-27 10:34:27 +10:00
|
|
|
fetch="curl -L -O"
|
2012-04-26 12:22:49 +10:00
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-07-04 00:32:48 +00:00
|
|
|
for i
|
|
|
|
do
|
2012-04-27 10:45:05 +10:00
|
|
|
z=
|
|
|
|
case $i in
|
2012-07-14 12:18:56 +10:00
|
|
|
http://tools.ietf.org/html/*|http://www.ietf.org/internet-drafts/*|http://www.ietf.org/id/*)
|
|
|
|
z=`expr "$i" : 'http://.*/.*/\(.*\)'`
|
2012-04-27 10:45:05 +10:00
|
|
|
;;
|
2012-07-14 12:18:56 +10:00
|
|
|
*://*/*)
|
|
|
|
echo -n "unknown uri $i"
|
|
|
|
continue;
|
2012-04-27 10:45:05 +10:00
|
|
|
esac
|
2004-03-09 02:44:22 +00:00
|
|
|
if test -n "$z"
|
|
|
|
then
|
2012-07-14 12:18:56 +10:00
|
|
|
case $z in
|
|
|
|
*-[0-9][0-9]) z="$z.txt"''
|
|
|
|
esac
|
2004-03-09 02:44:22 +00:00
|
|
|
i="$z"
|
|
|
|
fi
|
2002-07-04 00:32:48 +00:00
|
|
|
if test -f "$i"
|
|
|
|
then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
pat=`echo "$i" | sed 's/...txt/??.txt/'`
|
|
|
|
old=`echo $pat 2> /dev/null`
|
2002-09-27 00:31:53 +00:00
|
|
|
if test "X$old" != "X$pat"
|
|
|
|
then
|
|
|
|
newer=0
|
|
|
|
for j in $old
|
|
|
|
do
|
2002-10-25 22:12:09 +00:00
|
|
|
if test $j ">" $i
|
2002-09-27 00:31:53 +00:00
|
|
|
then
|
|
|
|
newer=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test $newer = 1
|
|
|
|
then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
fi
|
2012-04-27 10:45:05 +10:00
|
|
|
if $fetch "http://www.ietf.org/id/$i"
|
2002-07-04 00:32:48 +00:00
|
|
|
then
|
2012-04-26 12:22:49 +10:00
|
|
|
git add "$i"
|
2002-09-09 13:10:20 +00:00
|
|
|
if test "X$old" != "X$pat"
|
|
|
|
then
|
|
|
|
rm $old
|
2012-04-26 12:22:49 +10:00
|
|
|
git rm $old
|
2004-06-08 07:12:10 +00:00
|
|
|
commit="$commit $old"
|
2002-09-09 13:10:20 +00:00
|
|
|
fi
|
2004-06-08 07:12:10 +00:00
|
|
|
commit="$commit $i"
|
2002-07-04 00:32:48 +00:00
|
|
|
fi
|
|
|
|
done
|
2004-06-08 07:12:10 +00:00
|
|
|
if test -n "$commit"
|
|
|
|
then
|
2012-04-26 12:22:49 +10:00
|
|
|
git commit -m "new draft"
|
|
|
|
git push
|
2004-06-08 07:12:10 +00:00
|
|
|
fi
|