quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

allversions.pm (1598B)


      1 #***************************************************************************
      2 #                                  _   _ ____  _
      3 #  Project                     ___| | | |  _ \| |
      4 #                             / __| | | | |_) | |
      5 #                            | (__| |_| |  _ <| |___
      6 #                             \___|\___/|_| \_\_____|
      7 #
      8 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      9 #
     10 # This software is licensed as described in the file COPYING, which
     11 # you should have received as part of this distribution. The terms
     12 # are also available at https://curl.se/docs/copyright.html.
     13 #
     14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
     15 # copies of the Software, and permit persons to whom the Software is
     16 # furnished to do so, under the terms of the COPYING file.
     17 #
     18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
     19 # KIND, either express or implied.
     20 #
     21 # SPDX-License-Identifier: curl
     22 #
     23 ###########################################################################
     24 
     25 # populate the has %pastversion hash table with the version number as key and
     26 # release date as value
     27 
     28 sub allversions {
     29     my ($file) = @_;
     30     open(A, "<$file") ||
     31         die "can't open the versions file $file\n";
     32     my $before = 1;
     33     my $relcount;
     34     while(<A>) {
     35         if(/^## Past releases/) {
     36             $before = 0;
     37         }
     38         elsif(!$before &&
     39               /^- ([0-9.]+): (.*)/) {
     40             $pastversion{$1}=$2;
     41             $relcount++;
     42         }
     43     }
     44     close(A);
     45     die "too few releases ($relcount) found in $file" if($relcount < 100);
     46 }
     47 
     48 1;