source: draft-ietf-httpbis/diffs/dodiff @ 974

Last change on this file since 974 was 974, checked in by julian.reschke@…, 9 years ago

fix dodiff so it generates proper filesnames (not using the rfcdiff default anymore)

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1#!/usr/bin/perl
2#
3# usage: dodiff old new
4#  where old and new are directory siblings of this directory
5#  and contain different versions of the same files
6
7$rfcdiff = $ENV{'RFCDIFF'} || 'rfcdiff';
8@drafts = ( 'p1-messaging',
9            'p2-semantics',
10            'p3-payload',
11            'p4-conditional',
12            'p5-range',
13            'p6-cache',
14            'p7-auth' );
15
16$oldv = shift;
17$newv = shift;
18
19if (!(defined($oldv) && -d "../$oldv")) {
20    die "first argument must be the name of the old directory\n";
21}
22if (!(defined($newv) && -d "../$newv")) {
23    die "second argument must be the name of the new directory\n";
24}
25if ($oldv eq $newv) {
26    die "no differences: both arguments are the same directory\n";
27}
28
29if ($newv =~ /^\d\d$/) {  # second argument is a two-digit draft version
30    $newf = "../$newv/draft-ietf-httpbis-";
31    $newb = "-$newv\.txt";
32}
33else {
34    $newf = "../$newv/";
35    $newb = ".txt";
36}
37
38if ($oldv eq 'orig') {
39    foreach $draft (@drafts) {
40        system $rfcdiff, "../orig/rfc2616-symrefs.txt", "$newf$draft$newb";
41    }
42}
43elsif ($oldv =~ /^\d\d$/) {
44    $oldf = "../$oldv/draft-ietf-httpbis-";
45    $oldb = "-$oldv\.txt";
46
47    foreach $draft (@drafts) {
48        system("$rfcdiff --stdout $oldf$draft$oldb $newf$draft$newb > draft-ietf-httpbis-$draft-$newv-from-$oldv.diff.html");
49    }
50}
51else {
52    $oldf = "../$oldv/";
53    $oldb = '.txt';
54
55    foreach $draft (@drafts) {
56        system("$rfcdiff --stdout $oldf$draft$oldb $newf$draft$newb > $draft-$newv-from-$oldv.diff.html");
57    }
58}
59
60exit 0;
Note: See TracBrowser for help on using the repository browser.