Annotation of embedaddon/curl/tests/version-scan.pl, revision 1.1

1.1     ! misho       1: #!/usr/bin/env perl
        !             2: #***************************************************************************
        !             3: #                                  _   _ ____  _
        !             4: #  Project                     ___| | | |  _ \| |
        !             5: #                             / __| | | | |_) | |
        !             6: #                            | (__| |_| |  _ <| |___
        !             7: #                             \___|\___/|_| \_\_____|
        !             8: #
        !             9: # Copyright (C) 2010 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
        !            10: #
        !            11: # This software is licensed as described in the file COPYING, which
        !            12: # you should have received as part of this distribution. The terms
        !            13: # are also available at https://curl.haxx.se/docs/copyright.html.
        !            14: #
        !            15: # You may opt to use, copy, modify, merge, publish, distribute and/or sell
        !            16: # copies of the Software, and permit persons to whom the Software is
        !            17: # furnished to do so, under the terms of the COPYING file.
        !            18: #
        !            19: # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
        !            20: # KIND, either express or implied.
        !            21: #
        !            22: ###########################################################################
        !            23: #
        !            24: # Verify that curl_version_info.3 documents all the CURL_VERSION_ bits
        !            25: # from the header.
        !            26: #
        !            27: 
        !            28: use strict;
        !            29: use warnings;
        !            30: 
        !            31: my $manpage=$ARGV[0];
        !            32: my $header=$ARGV[1];
        !            33: my %manversion;
        !            34: my %headerversion;
        !            35: my $error;
        !            36: 
        !            37: open(M, "<$manpage");
        !            38: while(<M>) {
        !            39:     if($_ =~ /^.ip (CURL_VERSION_[A-Z0-9_]+)/i) {
        !            40:         $manversion{$1}++;
        !            41:     }
        !            42: }
        !            43: close(M);
        !            44: 
        !            45: open(H, "<$header");
        !            46: while(<H>) {
        !            47:     if($_ =~ /^\#define (CURL_VERSION_[A-Z0-9_]+)/i) {
        !            48:         $headerversion{$1}++;
        !            49:     }
        !            50: }
        !            51: close(H);
        !            52: 
        !            53: for my $h (keys %headerversion) {
        !            54:     if(!$manversion{$h}) {
        !            55:         print STDERR "$manpage: missing $h\n";
        !            56:         $error++;
        !            57:     }
        !            58: }
        !            59: for my $h (keys %manversion) {
        !            60:     if(!$headerversion{$h}) {
        !            61:         print STDERR "$manpage: $h is not in the header!\n";
        !            62:         $error++;
        !            63:     }
        !            64: }
        !            65: 
        !            66: exit $error;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>