>From d3957b27c205145e026e62fcf23f8bef969edeb8 Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Fri, 24 Feb 2012 18:34:04 +0100 Subject: [PATCH] coverage: test that dist-hook can modify file permission See automake bug#10878. * tests/dist-hook-perms.test: New test, checking that the user can use the 'dist-hook' target to modify permissions of distributed files before putting them in the distribution tarball. * tests/list-of-tests.mk: Add it. --- tests/disthook-perms.test | 59 +++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 1 + 2 files changed, 60 insertions(+), 0 deletions(-) create mode 100755 tests/disthook-perms.test diff --git a/tests/disthook-perms.test b/tests/disthook-perms.test new file mode 100755 index 0000000..a5f0acb --- /dev/null +++ b/tests/disthook-perms.test @@ -0,0 +1,59 @@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# 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, 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 or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that the user can use the 'dist-hook' target to modify +# permissions of distributed files before putting them in the +# distribution tarball. See automake bug#10878. + +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +EXTRA_DIST = write execute +dist-hook: + chmod u+w $(distdir)/write + chmod u+x $(distdir)/execute +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure + +echo Will be clobbered > write +cat > execute <<'END' +#!/bin/sh +echo I run successfully +END + +chmod a-w write +chmod a-x execute + +$MAKE +$MAKE dist + +test -f $distdir.tar.gz +gzip -dc $distdir.tar.gz | tar xvf - + +cd $distdir +echo clobber clobber > write +cat write | grep 'clobber clobber' +./execute +./execute | grep 'I run successfully' + +: diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index eaaa888..0e586d5 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -353,6 +353,7 @@ distcom2.test \ distcom3.test \ distcom4.test \ distcom5.test \ +dist-hook-perms.test \ distcom-subdir.test \ distdir.test \ distlinks.test \ -- 1.7.9