]> git.pld-linux.org Git - packages/gd.git/blob - gd-missing.patch
- release 5 (by relup.sh)
[packages/gd.git] / gd-missing.patch
1 --- libgd-2.1.1/config/getver.pl.orig   1970-01-01 01:00:00.000000000 +0100
2 +++ libgd-2.1.1/config/getver.pl        2015-06-19 20:37:05.518385651 +0200
3 @@ -0,0 +1,42 @@
4 +#!/usr/bin/env perl
5 +
6 +# Simple script to extract the version number parts from src/gd.h.  If
7 +# called with the middle word of the version macro, it prints the
8 +# value of that macro.  If called with no argument, it outputs a
9 +# human-readable version string.  This must be run in the project
10 +# root.  It is used by configure.ac and docs/naturaldocs/run_docs.sh.
11 +
12 +use strict;
13 +
14 +my $key = shift;
15 +my @version_parts = ();
16 +
17 +open FH, "<src/gd.h"   # old-style filehandle for max. portability
18 +  or die "Unable to open 'version.h' for reading.\n";
19 +
20 +while(<FH>) {
21 +  next unless m{version605b5d1778};
22 +  next unless /^#define\s+GD_([A-Z0-9]+)_VERSION+\s+(\S+)/;
23 +  my ($lk, $lv) = ($1, $2);
24 +  if ($lk eq $key) {
25 +    chomp $lv;
26 +    $lv =~ s/"//g;
27 +
28 +    print $lv;   # no newline
29 +    exit(0);    # success!
30 +  }
31 +
32 +  push @version_parts, $lv if (!$key);
33 +}
34 +
35 +close(FH);
36 +
37 +if (scalar @version_parts == 4) {
38 +  my $result = join(".", @version_parts[0..2]);
39 +  $result .= $version_parts[3];
40 +  $result =~ s/"//g;
41 +  print $result;
42 +  exit(0);
43 +}
44 +
45 +exit(1);        # failure
This page took 0.145088 seconds and 3 git commands to generate.