maint: assume 'test -x' is portable
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 23 Feb 2012 21:47:42 +0000 (22:47 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 23 Feb 2012 23:12:11 +0000 (00:12 +0100)
* lib/Makefile.am (installcheck-local): To verify that the installed
scripts are actually executable, simply use 'test -x', instead of
resorting to perl and its '-x' file operator.  Today, 'test -x'
should today be portable to any non-museum system.  Since we are at
it, improve diagnostic in case of failure.

lib/Makefile.am

index 422544e..fb80351 100644 (file)
@@ -54,9 +54,10 @@ install-data-hook:
          chmod +x "$(DESTDIR)$(scriptdir)/$$prog"; \
        done
 
-## 'test -x' is not portable.  So we use Perl instead.  If Perl
-## doesn't exist, then this test is meaningless anyway.
 installcheck-local:
-       for file in $(dist_script_DATA); do \
-         $(PERL) -e "exit ! -x '$(pkgvdatadir)/$$file';" || exit 1; \
-       done
+       @for file in $(dist_script_DATA); do \
+         path="$(pkgvdatadir)/$$file"; \
+         test -x "$$path" || echo $$path; \
+       done \
+         | sed 's/$$/: not executable/' \
+         | grep . && exit 1; exit 0