summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-12-06 00:11:14 +0100
committerGuillem Jover <guillem@debian.org>2014-12-23 02:36:20 +0100
commit2a7390d1108b221cc2fa34923f723caff9b0a2d1 (patch)
tree1af757e1ad4861b066f5e032efd1323c5c8845eb /lib
parentad1f3e78510415b26fc27cedf6c0ab4ab4c463b0 (diff)
downloaddpkg-2a7390d1108b221cc2fa34923f723caff9b0a2d1.tar.gz
libdpkg: Skip tar extractor tests if tar is not GNU tar >= 1.27
This allows building on older systems.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/dpkg/test/t-tar.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dpkg/test/t-tar.t b/lib/dpkg/test/t-tar.t
index 4ad62e7b3..69eaf5cf1 100755
--- a/lib/dpkg/test/t-tar.t
+++ b/lib/dpkg/test/t-tar.t
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-use Test::More tests => 12;
+use Test::More;
use Cwd;
use File::Path qw(make_path remove_tree);
use File::Temp qw(tempdir);
@@ -27,11 +27,22 @@ use Dpkg::IPC;
use strict;
use warnings;
+use version;
my $srcdir = $ENV{srcdir} || '.';
my $builddir = $ENV{builddir} || '.';
my $tmpdir = 't.tmp/t-tar';
+# We require GNU tar >= 1.27 for --owner=NAME:ID and --group=NAME:ID.
+my $tar_version = qx(tar --version 2>/dev/null);
+if ($tar_version and $tar_version =~ m/^tar \(GNU tar\) (\d+\.\d+)/ and
+ qv("v$1") >= qv('v1.27'))
+{
+ plan tests => 12;
+} else {
+ plan skip_all => 'needs GNU tar >= 1.27';
+}
+
# Set a known umask.
umask 0022;