update-drafts.pl revision 499b34cea04a46823d003d4c0520c8b03e8513cb
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#!/usr/local/bin/perl -w
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# Copyright (C) 2000, 2001 Internet Software Consortium.
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# Permission to use, copy, modify, and distribute this software for any
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# purpose with or without fee is hereby granted, provided that the above
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# copyright notice and this permission notice appear in all copies.
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# $Id: update-drafts.pl,v 1.4 2001/01/09 22:01:03 bwelling Exp $
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# Replace internet drafts with updated versions, if any.
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# Usage:
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# cd doc/draft
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# perl ../../util/update-drafts.pl *.txt
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# (ignore "404 Not Found" errors from FTP)
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley# cvs commit -m"updated drafts"
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley#
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halleyforeach (@ARGV) {
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley $ofile = $_;
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley if (/^(.*-)([0-9][0-9])(\.txt)/) {
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley $nfile = "$1" . sprintf("%02d", $2 + 1) . "$3";
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley print $nfile, "\n";
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley system "ftp http://www.ietf.org/internet-drafts/$nfile";
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley if ($? == 0) {
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley unlink($ofile);
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley system "cvs remove $ofile";
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley system "cvs add $nfile";
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley }
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley }
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley}
7e6c9a9a733f7a57ace98e4692573f42a2cad0edBob Halley