Fix permissions and #! lines for some tests in the upstream build system

d/rules: remove workarounds for script permissions.
The upstream build system now uses the intended permissions throughout.

Retain explicit chmod for *.js, which dh_fixperms assumes should not be executable.
This commit is contained in:
Simon McVittie 2017-01-19 10:04:29 +00:00
parent f0785125c2
commit 7855081a11
5 changed files with 130 additions and 7 deletions

8
debian/changelog vendored
View File

@ -10,6 +10,14 @@ ostree (2016.15-3) UNRELEASED; urgency=medium
* debian/tests/gnome-desktop-testing: Fail if no tests were found
- debian/tests/test-local-pull: Run the unreliable test separately,
repeated 3 times to assess how often it fails
* d/p/Sourced-test-snippets-remove-shebang-and-make-non-executa.patch,
d/p/Make-corrupt-repo-ref.js-executable.patch:
Fix permissions and #! lines for some tests in the upstream build
system
* d/rules: remove workarounds for script permissions.
The upstream build system now uses the intended permissions throughout.
- Retain explicit chmod for *.js, which dh_fixperms assumes should
not be executable.
-- Simon McVittie <smcv@debian.org> Sun, 15 Jan 2017 14:37:12 +0000

View File

@ -0,0 +1,42 @@
From: Simon McVittie <smcv@debian.org>
Date: Thu, 19 Jan 2017 11:34:57 +0000
Subject: Make corrupt-repo-ref.js executable
Debian's Lintian packaging consistency check complains that it isn't
executable but has a #! line. In fact it's reasonable to run this
script directly, so make it executable, and put it in a _scripts
variable so it will be installed executable.
---
Makefile-tests.am | 8 +++++---
tests/corrupt-repo-ref.js | 0
2 files changed, 5 insertions(+), 3 deletions(-)
mode change 100644 => 100755 tests/corrupt-repo-ref.js
diff --git a/Makefile-tests.am b/Makefile-tests.am
index 02668ed3..202e108a 100644
--- a/Makefile-tests.am
+++ b/Makefile-tests.am
@@ -119,15 +119,17 @@ dist_installed_test_data = tests/archive-test.sh \
tests/pull-test.sh \
tests/admin-test.sh \
tests/basic-test.sh \
- tests/corrupt-repo-ref.js \
tests/pre-endian-deltas-repo-big.tar.xz \
tests/pre-endian-deltas-repo-little.tar.xz \
$(NULL)
EXTRA_DIST += tests/libtest.sh
-dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \
- tests/ostree-grub-generator
+dist_test_extra_scripts = \
+ tests/bootloader-entries-crosscheck.py \
+ tests/corrupt-repo-ref.js \
+ tests/ostree-grub-generator \
+ $(NULL)
# We can't use nobase_ as we need to strip off the tests/, can't
# use plain installed_ as we do need the gpghome/ prefix.
diff --git a/tests/corrupt-repo-ref.js b/tests/corrupt-repo-ref.js
old mode 100644
new mode 100755

View File

@ -0,0 +1,75 @@
From: Simon McVittie <smcv@debian.org>
Date: Thu, 19 Jan 2017 11:23:30 +0000
Subject: Sourced test snippets: remove shebang and make non-executable
They are installed non-executable, which makes Debian's Lintian
packaging consistency check complain that #! is only useful
in executable scripts. But in fact they are not useful to execute
directly (they rely on setup being done in the script that sources
them), so just chmod them -x.
---
tests/admin-test.sh | 3 ++-
tests/archive-test.sh | 4 ++--
tests/basic-test.sh | 4 ++--
tests/pull-test.sh | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
mode change 100755 => 100644 tests/admin-test.sh
mode change 100755 => 100644 tests/archive-test.sh
mode change 100755 => 100644 tests/basic-test.sh
mode change 100755 => 100644 tests/pull-test.sh
diff --git a/tests/admin-test.sh b/tests/admin-test.sh
old mode 100755
new mode 100644
index 76fc8b85..cc06fe6f
--- a/tests/admin-test.sh
+++ b/tests/admin-test.sh
@@ -1,4 +1,5 @@
-#!/bin/bash
+# This file is to be sourced, not executed
+
# Copyright (C) 2011,2014 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
diff --git a/tests/archive-test.sh b/tests/archive-test.sh
old mode 100755
new mode 100644
index e6f67cf5..9c5f8a47
--- a/tests/archive-test.sh
+++ b/tests/archive-test.sh
@@ -1,5 +1,5 @@
-#!/bin/bash
-#
+# This file is to be sourced, not executed
+
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
old mode 100755
new mode 100644
index bb387501..f3e37239
--- a/tests/basic-test.sh
+++ b/tests/basic-test.sh
@@ -1,5 +1,5 @@
-#!/bin/bash
-#
+# This file is to be sourced, not executed
+
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
diff --git a/tests/pull-test.sh b/tests/pull-test.sh
old mode 100755
new mode 100644
index 56258b6c..56b24a0c
--- a/tests/pull-test.sh
+++ b/tests/pull-test.sh
@@ -1,5 +1,5 @@
-#!/bin/bash
-#
+# This file is to be sourced, not executed
+
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
Sourced-test-snippets-remove-shebang-and-make-non-executa.patch
Make-corrupt-repo-ref.js-executable.patch

10
debian/rules vendored
View File

@ -25,8 +25,6 @@ override_dh_auto_configure:
--with-grub2-mkconfig-path=/usr/sbin/grub-mkconfig \
--with-systemdsystemunitdir=/lib/systemd/system \
$(NULL)
chmod +x tests/*.js
chmod +x tests/*.sh
override_dh_auto_test:
debian/test.sh
@ -63,12 +61,10 @@ override_dh_makeshlibs:
dh_makeshlibs -Xinstalled-tests/ostree/libreaddir-rand.so
override_dh_fixperms-arch:
# dh_fixperms assumes *.js are for browsers and makes them 0644.
dh_fixperms -X'*.js'
chmod -v 0755 debian/ostree-tests/usr/lib/installed-tests/ostree/*.js
chmod -v 0755 debian/ostree-tests/usr/lib/installed-tests/ostree/*.py
chmod -v 0755 debian/ostree-tests/usr/lib/installed-tests/ostree/*.sh
# this one is a library, not a script
chmod -v 0644 debian/ostree-tests/usr/lib/installed-tests/ostree/libtest.sh
find debian/tmp -type f -name '*.js' -print0 | \
xargs -0r chmod -v go=rX,u+rw,a-s
override_dh_systemd_start:
dh_systemd_start --no-start