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:34:27 +10:00
|
|
|
z=`expr "$i" : 'http://www.ietf.org/id/\(.*\)'`
|
2004-03-09 02:44:22 +00:00
|
|
|
if test -n "$z"
|
|
|
|
then
|
|
|
|
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-26 12:22:49 +10:00
|
|
|
if $fetch "http://www.ietf.org/internet-drafts/$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
|