Ignore:
Timestamp:
Mar 11, 2009, 5:07:29 PM (11 years ago)
Author:
fielding@…
Message:

change to a real script that takes the old and new directories as args

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/diffs/dodiff

    r556 r557  
    1 # rfcdiff ../orig/rfc2616.txt ../orig/rfc2616-symrefs.txt
     1#!/usr/bin/perl
    22#
    3 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p1-messaging-00.txt
    4 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p2-semantics-00.txt
    5 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p3-payload-00.txt
    6 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p4-conditional-00.txt
    7 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p5-range-00.txt
    8 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p6-cache-00.txt
    9 # rfcdiff ../orig/rfc2616-symrefs.txt ../00/draft-ietf-httpbis-p7-auth-00.txt
    10 #
    11 # rfcdiff ../00/draft-ietf-httpbis-p1-messaging-00.txt ../01/draft-ietf-httpbis-p1-messaging-01.txt
    12 # rfcdiff ../00/draft-ietf-httpbis-p2-semantics-00.txt ../01/draft-ietf-httpbis-p2-semantics-01.txt
    13 # rfcdiff ../00/draft-ietf-httpbis-p3-payload-00.txt ../01/draft-ietf-httpbis-p3-payload-01.txt
    14 # rfcdiff ../00/draft-ietf-httpbis-p4-conditional-00.txt ../01/draft-ietf-httpbis-p4-conditional-01.txt
    15 # rfcdiff ../00/draft-ietf-httpbis-p5-range-00.txt ../01/draft-ietf-httpbis-p5-range-01.txt
    16 # rfcdiff ../00/draft-ietf-httpbis-p6-cache-00.txt ../01/draft-ietf-httpbis-p6-cache-01.txt
    17 # rfcdiff ../00/draft-ietf-httpbis-p7-auth-00.txt ../01/draft-ietf-httpbis-p7-auth-01.txt
    18 #
    19 # rfcdiff ../01/draft-ietf-httpbis-p1-messaging-01.txt \
    20 #         ../02/draft-ietf-httpbis-p1-messaging-02.txt
    21 # rfcdiff ../01/draft-ietf-httpbis-p2-semantics-01.txt \
    22 #         ../02/draft-ietf-httpbis-p2-semantics-02.txt
    23 # rfcdiff ../01/draft-ietf-httpbis-p3-payload-01.txt \
    24 #         ../02/draft-ietf-httpbis-p3-payload-02.txt
    25 # rfcdiff ../01/draft-ietf-httpbis-p4-conditional-01.txt \
    26 #         ../02/draft-ietf-httpbis-p4-conditional-02.txt
    27 # rfcdiff ../01/draft-ietf-httpbis-p5-range-01.txt \
    28 #         ../02/draft-ietf-httpbis-p5-range-02.txt
    29 # rfcdiff ../01/draft-ietf-httpbis-p6-cache-01.txt \
    30 #         ../02/draft-ietf-httpbis-p6-cache-02.txt
    31 # rfcdiff ../01/draft-ietf-httpbis-p7-auth-01.txt \
    32 #         ../02/draft-ietf-httpbis-p7-auth-02.txt
     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
    336
    34 # rfcdiff ../02/draft-ietf-httpbis-p1-messaging-02.txt \
    35 #         ../03/draft-ietf-httpbis-p1-messaging-03.txt
    36 # rfcdiff ../02/draft-ietf-httpbis-p2-semantics-02.txt \
    37 #         ../03/draft-ietf-httpbis-p2-semantics-03.txt
    38 # rfcdiff ../02/draft-ietf-httpbis-p3-payload-02.txt \
    39 #         ../03/draft-ietf-httpbis-p3-payload-03.txt
    40 # rfcdiff ../02/draft-ietf-httpbis-p4-conditional-02.txt \
    41 #         ../03/draft-ietf-httpbis-p4-conditional-03.txt
    42 # rfcdiff ../02/draft-ietf-httpbis-p5-range-02.txt \
    43 #         ../03/draft-ietf-httpbis-p5-range-03.txt
    44 # rfcdiff ../02/draft-ietf-httpbis-p6-cache-02.txt \
    45 #         ../03/draft-ietf-httpbis-p6-cache-03.txt
    46 # rfcdiff ../02/draft-ietf-httpbis-p7-auth-02.txt \
    47 #         ../03/draft-ietf-httpbis-p7-auth-03.txt
     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' );
    4815
    49 # rfcdiff ../03/draft-ietf-httpbis-p1-messaging-03.txt \
    50 #         ../04/draft-ietf-httpbis-p1-messaging-04.txt
    51 # rfcdiff ../03/draft-ietf-httpbis-p2-semantics-03.txt \
    52 #         ../04/draft-ietf-httpbis-p2-semantics-04.txt
    53 # rfcdiff ../03/draft-ietf-httpbis-p3-payload-03.txt \
    54 #         ../04/draft-ietf-httpbis-p3-payload-04.txt
    55 # rfcdiff ../03/draft-ietf-httpbis-p4-conditional-03.txt \
    56 #         ../04/draft-ietf-httpbis-p4-conditional-04.txt
    57 # rfcdiff ../03/draft-ietf-httpbis-p5-range-03.txt \
    58 #         ../04/draft-ietf-httpbis-p5-range-04.txt
    59 # rfcdiff ../03/draft-ietf-httpbis-p6-cache-03.txt \
    60 #         ../04/draft-ietf-httpbis-p6-cache-04.txt
    61 # rfcdiff ../03/draft-ietf-httpbis-p7-auth-03.txt \
    62 #         ../04/draft-ietf-httpbis-p7-auth-04.txt
     16$oldv = shift;
     17$newv = shift;
    6318
    64 # rfcdiff ../04/draft-ietf-httpbis-p1-messaging-04.txt \
    65 #         ../05/draft-ietf-httpbis-p1-messaging-05.txt
    66 # rfcdiff ../04/draft-ietf-httpbis-p2-semantics-04.txt \
    67 #         ../05/draft-ietf-httpbis-p2-semantics-05.txt
    68 # rfcdiff ../04/draft-ietf-httpbis-p3-payload-04.txt \
    69 #         ../05/draft-ietf-httpbis-p3-payload-05.txt
    70 # rfcdiff ../04/draft-ietf-httpbis-p4-conditional-04.txt \
    71 #         ../05/draft-ietf-httpbis-p4-conditional-05.txt
    72 # rfcdiff ../04/draft-ietf-httpbis-p5-range-04.txt \
    73 #         ../05/draft-ietf-httpbis-p5-range-05.txt
    74 # rfcdiff ../04/draft-ietf-httpbis-p6-cache-04.txt \
    75 #         ../05/draft-ietf-httpbis-p6-cache-05.txt
    76 # rfcdiff ../04/draft-ietf-httpbis-p7-auth-04.txt \
    77 #         ../05/draft-ietf-httpbis-p7-auth-05.txt
     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}
    7828
    79 rfcdiff ../05/draft-ietf-httpbis-p1-messaging-05.txt \
    80         ../06/draft-ietf-httpbis-p1-messaging-06.txt
    81 rfcdiff ../05/draft-ietf-httpbis-p2-semantics-05.txt \
    82         ../06/draft-ietf-httpbis-p2-semantics-06.txt
    83 rfcdiff ../05/draft-ietf-httpbis-p3-payload-05.txt \
    84         ../06/draft-ietf-httpbis-p3-payload-06.txt
    85 rfcdiff ../05/draft-ietf-httpbis-p4-conditional-05.txt \
    86         ../06/draft-ietf-httpbis-p4-conditional-06.txt
    87 rfcdiff ../05/draft-ietf-httpbis-p5-range-05.txt \
    88         ../06/draft-ietf-httpbis-p5-range-06.txt
    89 rfcdiff ../05/draft-ietf-httpbis-p6-cache-05.txt \
    90         ../06/draft-ietf-httpbis-p6-cache-06.txt
    91 rfcdiff ../05/draft-ietf-httpbis-p7-auth-05.txt \
    92         ../06/draft-ietf-httpbis-p7-auth-06.txt
     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}
    9337
    94 # rfcdiff ../00/draft-ietf-httpbis-p1-messaging-00.txt ../latest/p1-messaging.txt
    95 # rfcdiff ../00/draft-ietf-httpbis-p2-semantics-00.txt ../latest/p2-semantics.txt
    96 # rfcdiff ../00/draft-ietf-httpbis-p3-payload-00.txt ../latest/p3-payload.txt
    97 # rfcdiff ../00/draft-ietf-httpbis-p4-conditional-00.txt ../latest/p4-conditional.txt
    98 # rfcdiff ../00/draft-ietf-httpbis-p5-range-00.txt ../latest/p5-range.txt
    99 # rfcdiff ../00/draft-ietf-httpbis-p6-cache-00.txt ../latest/p6-cache.txt
    100 # rfcdiff ../00/draft-ietf-httpbis-p7-auth-00.txt ../latest/p7-auth.txt
     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";
    10146
    102 rfcdiff ../latest/p1-messaging.txt ../latest-roy/p1-messaging.txt
    103 # rfcdiff ../latest/p2-semantics.txt ../latest-roy/p2-semantics.txt
    104 # rfcdiff ../latest/p3-payload.txt ../latest-roy/p3-payload.txt
    105 # rfcdiff ../latest/p4-conditional.txt ../latest-roy/p4-conditional.txt
    106 # rfcdiff ../latest/p5-range.txt ../latest-roy/p5-range.txt
    107 # rfcdiff ../latest/p6-cache.txt ../latest-roy/p6-cache.txt
    108 # rfcdiff ../latest/p7-auth.txt ../latest-roy/p7-auth.txt
     47    foreach $draft (@drafts) {
     48        system $rfcdiff, "$oldf$draft$oldb", "$newf$draft$newb";
     49    }
     50}
     51else {
     52    $oldf = "../$oldv/";
     53    $oldb = '.txt';
     54
     55    foreach $draft (@drafts) {
     56        system $rfcdiff, "$oldf$draft$oldb", "$newf$draft$newb";
     57    }
     58}
     59
     60exit 0;
Note: See TracChangeset for help on using the changeset viewer.