update changelog to reflect new upstream version
[debian/amanda] / installcheck / gnutar.pl
index a7eaecd9332566ae5541cd88ccfe698d4a9dd506..ac1b654ac11046bf4e2cf149ae3f5cf8822a0769 100644 (file)
@@ -1,8 +1,9 @@
-# Copyright (c) 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2009-2012 Zmanda, Inc.  All Rights Reserved.
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -76,6 +77,24 @@ my ($v, $numeric_version);
     $numeric_version += $maj * 10000 if $maj;
     $numeric_version += $min * 100 if $min;
     $numeric_version += $mic if $mic;
+
+}
+
+my ($fc14, $fc15);
+{
+    my $uname = `uname -a`;
+    if ($uname =~ /\.fc14\./) {
+       $fc14 = 1;
+    }
+    if ($uname =~ /\.fc15\./) {
+       $fc15 = 1;
+    }
+    if ($uname =~ /\.fc16\./) { #like fc15
+       $fc15 = 1;
+    }
+    if ($uname =~ /\.fc17\./) { #like fc15
+       $fc15 = 1;
+    }
 }
 
 # see if the default for --wildcards during inclusion has been changed
@@ -93,12 +112,16 @@ my %version_classes = (
     '>=1.16' => $numeric_version >= 11591,
     '>=1.16-no-wc' => $numeric_version >= 11591 && !$wc_default_changed, # normal
     '>=1.16-wc' => $numeric_version >= 11591 && $wc_default_changed, # stupid distros screw things up!
+    '1.16..<1.25' => $numeric_version >= 11591 && $numeric_version < 12500,
 
     '<1.23' => $numeric_version < 12300,
     '>=1.23' => $numeric_version >= 12300,
     '*' => 1,
     '1.23' => ($numeric_version >= 12290 and $numeric_version <= 12300),
-    '!1.23' => ($numeric_version < 12290 || $numeric_version > 12300),
+    '1.23fc14' => ($numeric_version == 12300 and $fc14),
+    '!1.23' => ($numeric_version < 12290 || ($numeric_version > 12300 && $numeric_version < 12500)),
+    '>=1.25' => $numeric_version >= 12500,
+    'fc15' => ($numeric_version >= 12500 and $fc15),
 );
 
 # include and exclude all use the same set of patterns and filenames
@@ -131,28 +154,31 @@ my $named_expectations = [
            'gamma',
               'delta',
                  'epsilon',
-                    'empty', ],
-    #  al be ga de ep empty
-    [  1, 1, 1, 1, 1, 1,     ], # './A*A' =>   'A*A',
-    [  1, 1, 1, 1, 0, 0,     ], # './A*A' =>   'AxA',
-    [  1, 1, 1, 1, 1, 1,     ], # './B?B' =>   'B?B',
-    [  1, 1, 1, 1, 0, 0,     ], # './B?B' =>   'BxB',
-    [  0, 0, 0, 0, 1, 1,     ], # './C[C' =>   'C[C',
-    [  1, 1, 1, 1, 1, 1,     ], # './D]D' =>   'D]D',
-    [  1, 0, 0, 1, 1, 1,     ], # './E\\E' =>  'E\\E',
-    [  1, 1, 1, 1, 1, 1,     ], # './F\'F' =>  'F\'F',
-    [  1, 1, 1, 1, 1, 1,     ], # './G"G' =>   'G"G',
-    [  1, 1, 1, 1, 1, 1,     ], # './H H' =>   'H H',
-    [  1, 1, 1, 0, 0, 0,     ], # './A\\*A' => 'A*A',
-    [  0, 0, 0, 0, 0, 0,     ], # './A\\*A' => 'AxA',
-    [  0, 0, 1, 0, 0, 0,     ], # './B\\?B' => 'B?B',
-    [  0, 0, 0, 0, 0, 0,     ], # './B\\?B' => 'BxB',
-    [  1, 1, 1, 0, 0, 0,     ], # './C\\[C' => 'C[C',
-    [  0, 1, 1, 0, 0, 0,     ], # './D\\]D' => 'D]D',
-    [  1, 0, 1, 0, 1, 0,     ], # './E\\\\E' =>        'E\\E',
-    [  0, 1, 1, 0, 0, 0,     ], # './F\\\'F' =>        'F\'F',
-    [  0, 1, 1, 0, 0, 0,     ], # './G\\"G' => 'G"G',
-    [  0, 1, 1, 0, 0, 0,     ], # './H\\ H' => 'H H',
+                    'zeta',
+                       'eta',
+                          'iota',
+                              'empty', ],
+    #  al be ga de ep ze et io empty
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './A*A' =>  'A*A',
+    [  1, 1, 1, 1, 0, 1, 1, 1, 0,     ], # './A*A' =>  'AxA',
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './B?B' =>  'B?B',
+    [  1, 1, 1, 1, 0, 1, 1, 1, 0,     ], # './B?B' =>  'BxB',
+    [  0, 0, 0, 0, 1, 1, 1, 1, 1,     ], # './C[C' =>  'C[C',
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './D]D' =>  'D]D',
+    [  1, 0, 0, 1, 1, 0, 0, 1, 1,     ], # './E\\E' => 'E\\E',
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './F\'F' => 'F\'F',
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './G"G' =>  'G"G',
+    [  1, 1, 1, 1, 1, 1, 1, 1, 1,     ], # './H H' =>  'H H',
+    [  1, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './A\\*A' =>        'A*A',
+    [  0, 0, 0, 0, 0, 0, 0, 0, 0,     ], # './A\\*A' =>        'AxA',
+    [  0, 0, 1, 0, 0, 0, 1, 0, 0,     ], # './B\\?B' =>        'B?B',
+    [  0, 0, 0, 0, 0, 0, 0, 0, 0,     ], # './B\\?B' =>        'BxB',
+    [  1, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './C\\[C' =>        'C[C',
+    [  0, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './D\\]D' =>        'D]D',
+    [  1, 0, 1, 0, 1, 0, 1, 0, 0,     ], # './E\\\\E' =>       'E\\E',
+    [  0, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './F\\\'F' =>       'F\'F',
+    [  0, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './G\\"G' =>        'G"G',
+    [  0, 1, 1, 0, 0, 1, 1, 0, 0,     ], # './H\\ H' =>        'H H',
 ];
 
 sub get_expectation {
@@ -183,9 +209,11 @@ sub get_matching_type {
     my ($expectations) = @_;
 
     # find the type for the first matching version
-    for (keys %$expectations) {
-       if ($version_classes{$_}) {
-           return $expectations->{$_};
+    foreach my $exp (@$expectations) {
+       foreach (keys %$exp) {
+           if ($version_classes{$_}) {
+               return $exp->{$_};
+           }
        }
     }
     return undef;
@@ -309,52 +337,60 @@ sub test_gnutar_inclusion {
 
 test_gnutar_inclusion(
     extra_args => [],
-    expectations => {
-       '<1.16' => 'alpha',
-       '>=1.16-no-wc' => 'epsilon',
-       '>=1.16-wc' => 'beta', # acts like --wildcards
-    },
+    expectations => [
+       {'<1.16' => 'alpha'},
+        {'1.23fc14' => 'zeta'},
+        {'fc15' => 'zeta'},
+       {'>=1.16-no-wc' => 'epsilon'},
+       {'>=1.16-wc' => 'beta'}, # acts like --wildcards
+    ],
 );
 
 test_gnutar_inclusion(
     extra_args => [ '--no-wildcards' ],
-    expectations => {
-       '<1.16' => 'alpha',
-       '>=1.16' => 'epsilon',
-    },
+    expectations => [
+       {'<1.16' => 'alpha'},
+       {'>=1.16' => 'epsilon'},
+    ],
 );
 
 test_gnutar_inclusion(
     extra_args => [ '--no-unquote' ],
-    expectations => {
-       '<1.16' => undef,
-       '>=1.16-no-wc' => 'empty',
-       '>=1.16-wc' => 'gamma', # acts like --wildcards --no-unquote
-    },
+    expectations => [
+       {'<1.16' => undef},
+       {'1.23fc14' => 'eta'},
+       {'fc15' => 'eta'},
+       {'>=1.16-no-wc' => 'empty'},
+       {'>=1.16-wc' => 'gamma'}, # acts like --wildcards --no-unquote
+    ],
 );
 
 test_gnutar_inclusion(
     extra_args => [ '--no-wildcards', '--no-unquote' ],
-    expectations => {
-       '<1.16' => undef,
-       '>=1.16' => 'empty',
-    },
+    expectations => [
+       {'<1.16' => undef},
+       {'>=1.16' => 'empty'},
+    ],
 );
 
 test_gnutar_inclusion(
     extra_args => [ '--wildcards' ],
-    expectations => {
-       '<1.16' => 'alpha',
-       '>=1.16' => 'beta',
-    },
+    expectations => [
+       {'<1.16' => 'alpha'},
+        {'1.23fc14' => 'zeta'},
+       {'1.16..<1.25' => 'beta'},
+       {'>=1.25' => 'zeta'},
+    ],
 );
 
 test_gnutar_inclusion(
     extra_args => [ '--wildcards', '--no-unquote' ],
-    expectations => {
-       '<1.16' => undef,
-       '>=1.16' => 'gamma',
-    },
+    expectations => [
+       {'<1.16' => undef},
+       {'1.23fc14' => 'eta'},
+       {'1.16..<1.25' => 'gamma'},
+       {'>=1.25' => 'eta'},
+    ],
 );
 
 ## exclusion tests (using -t and filenames on the command line)
@@ -461,18 +497,20 @@ sub test_gnutar_exclusion {
 # --wildcards
 test_gnutar_exclusion(
     extra_args => [],
-    expectations => {
-       '!1.23' => 'gamma',
-       '1.23' => 'delta',
-    },
+    expectations => [
+       {'!1.23' => 'gamma'},
+       {'1.23fc14' => 'iota'},
+       {'1.23' => 'delta'},
+       {'>=1.25' => 'eta'},
+    ],
 );
 
 # --no-wildcards
 test_gnutar_exclusion(
     extra_args => [ '--no-wildcards' ],
-    expectations => {
-       '*' => 'empty',
-    },
+    expectations => [
+       {'*' => 'empty'},
+    ],
 );
 
 ## list (-t)