X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Fgnutar.pl;h=ac1b654ac11046bf4e2cf149ae3f5cf8822a0769;hb=HEAD;hp=886fd089c0e7c35719b78a90d801d437f6c5fe6c;hpb=b221e8dc16f345f8c8d7df8df71f4d36daaabb4c;p=debian%2Famanda diff --git a/installcheck/gnutar.pl b/installcheck/gnutar.pl index 886fd08..ac1b654 100644 --- a/installcheck/gnutar.pl +++ b/installcheck/gnutar.pl @@ -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 @@ -99,8 +118,10 @@ my %version_classes = ( '>=1.23' => $numeric_version >= 12300, '*' => 1, '1.23' => ($numeric_version >= 12290 and $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. + '>=1.25' => $numeric_version >= 12500, + 'fc15' => ($numeric_version >= 12500 and $fc15), ); # include and exclude all use the same set of patterns and filenames @@ -135,28 +156,29 @@ my $named_expectations = [ 'epsilon', 'zeta', 'eta', - 'empty', ], - # al be ga de ep ze et empty - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './A*A' => 'A*A', - [ 1, 1, 1, 1, 0, 1, 1, 0, ], # './A*A' => 'AxA', - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './B?B' => 'B?B', - [ 1, 1, 1, 1, 0, 1, 1, 0, ], # './B?B' => 'BxB', - [ 0, 0, 0, 0, 1, 1, 1, 1, ], # './C[C' => 'C[C', - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './D]D' => 'D]D', - [ 1, 0, 0, 1, 1, 0, 0, 1, ], # './E\\E' => 'E\\E', - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './F\'F' => 'F\'F', - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './G"G' => 'G"G', - [ 1, 1, 1, 1, 1, 1, 1, 1, ], # './H H' => 'H H', - [ 1, 1, 1, 0, 0, 1, 1, 0, ], # './A\\*A' => 'A*A', - [ 0, 0, 0, 0, 0, 0, 0, 0, ], # './A\\*A' => 'AxA', - [ 0, 0, 1, 0, 0, 0, 1, 0, ], # './B\\?B' => 'B?B', - [ 0, 0, 0, 0, 0, 0, 0, 0, ], # './B\\?B' => 'BxB', - [ 1, 1, 1, 0, 0, 1, 1, 0, ], # './C\\[C' => 'C[C', - [ 0, 1, 1, 0, 0, 1, 1, 0, ], # './D\\]D' => 'D]D', - [ 1, 0, 1, 0, 1, 0, 1, 0, ], # './E\\\\E' => 'E\\E', - [ 0, 1, 1, 0, 0, 1, 1, 0, ], # './F\\\'F' => 'F\'F', - [ 0, 1, 1, 0, 0, 1, 1, 0, ], # './G\\"G' => 'G"G', - [ 0, 1, 1, 0, 0, 1, 1, 0, ], # './H\\ H' => 'H H', + '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 { @@ -187,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; @@ -313,54 +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..<1.25' => 'beta', - '>=1.25' => 'zeta', - }, + 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..<1.25' => 'gamma', - '>=1.25' => 'eta', - }, + 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) @@ -467,19 +497,20 @@ sub test_gnutar_exclusion { # --wildcards test_gnutar_exclusion( extra_args => [], - expectations => { - '!1.23' => 'gamma', - '1.23' => 'delta', - '>=1.25' => 'eta', - }, + 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)