summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-07-10 10:21:16 +0100
committerSam James <sam@gentoo.org>2022-07-10 12:05:59 +0100
commit1e52ba8a7894d7bb6704c745097fd2f66d2a8754 (patch)
treec2d619c7b48c2187de47d59377b3e6451e8253df /app-misc/scrub
parentsys-devel/gcc: add 10.4.1_p20220707 (diff)
downloadgentoo-1e52ba8a7894d7bb6704c745097fd2f66d2a8754.tar.gz
gentoo-1e52ba8a7894d7bb6704c745097fd2f66d2a8754.tar.bz2
gentoo-1e52ba8a7894d7bb6704c745097fd2f66d2a8754.zip
app-misc/scrub: EAPI 8, fix tests with non-bash
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-misc/scrub')
-rw-r--r--app-misc/scrub/files/scrub-2.6.1-bashism-tests.patch85
-rw-r--r--app-misc/scrub/files/scrub-2.6.1-implicit-function-declaration-test.patch22
-rw-r--r--app-misc/scrub/scrub-2.6.1-r1.ebuild (renamed from app-misc/scrub/scrub-2.6.1.ebuild)11
3 files changed, 113 insertions, 5 deletions
diff --git a/app-misc/scrub/files/scrub-2.6.1-bashism-tests.patch b/app-misc/scrub/files/scrub-2.6.1-bashism-tests.patch
new file mode 100644
index 000000000000..17999f341cd2
--- /dev/null
+++ b/app-misc/scrub/files/scrub-2.6.1-bashism-tests.patch
@@ -0,0 +1,85 @@
+https://github.com/chaos/scrub/pull/31
+
+From 545d1b9cae8da18864277ca14a227d4adfafdc32 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 10 Jul 2022 10:23:09 +0100
+Subject: [PATCH] test: fix bashisms in tests
+
+We're using a /bin/sh shebang but the tests aren't
+compatible with a POSIX-compliant /bin/sh (like dash,
+instead of the usual bash).
+
+Switch to = instead of == which works the same but
+works with both Bash and dash.
+
+If desired, we could switch the shebangs to
+/bin/bash which would work.
+
+(Notably, Debian defaults to dash as /bin/sh).
+--- a/test/t09
++++ b/test/t09
+@@ -4,7 +4,7 @@
+
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+
+ EXPFILE=${TEST}-`hostname`.exp
+ TESTDEV=/dev/scrub-testdisk
+--- a/test/t10
++++ b/test/t10
+@@ -4,7 +4,7 @@
+
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+
+ EXPFILE=${TEST}-`hostname`.exp
+ test -f $EXPFILE || exit 77
+--- a/test/t18
++++ b/test/t18
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+
+ TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
+ TESTDIR=`mktemp -d $TMPLATE` || exit 1
+--- a/test/t19
++++ b/test/t19
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+ LOOPFILE=`losetup -f` || exit 77
+ TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
+ TESTFILE=`mktemp $TMPLATE` || exit 1
+--- a/test/t20
++++ b/test/t20
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+ LOOPFILE=`losetup -f` || exit 77
+ TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
+ TESTFILE=`mktemp $TMPLATE` || exit 1
+--- a/test/t21
++++ b/test/t21
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ TEST=`basename $0 | cut -d- -f1`
+ # Test requires root
+-test `id -u` == 0 || exit 77
++test `id -u` = 0 || exit 77
+
+ TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
+
+
diff --git a/app-misc/scrub/files/scrub-2.6.1-implicit-function-declaration-test.patch b/app-misc/scrub/files/scrub-2.6.1-implicit-function-declaration-test.patch
new file mode 100644
index 000000000000..8d6b40a97536
--- /dev/null
+++ b/app-misc/scrub/files/scrub-2.6.1-implicit-function-declaration-test.patch
@@ -0,0 +1,22 @@
+https://github.com/chaos/scrub/commit/188d999e2fb038dc702b47750d235ffd284dd518
+
+From 188d999e2fb038dc702b47750d235ffd284dd518 Mon Sep 17 00:00:00 2001
+From: Jim Garlick <garlick.jim@gmail.com>
+Date: Wed, 21 Jul 2021 13:09:57 -0700
+Subject: [PATCH] test: fix missing include in test program
+
+Problem: tgetsize emits a compiler warning because
+strerror() is not defined.
+
+Include string.h to get the definition of strerror.
+--- a/test/tgetsize.c
++++ b/test/tgetsize.c
+@@ -20,6 +20,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <libgen.h>
++#include <string.h>
+
+ #include "getsize.h"
+
+
diff --git a/app-misc/scrub/scrub-2.6.1.ebuild b/app-misc/scrub/scrub-2.6.1-r1.ebuild
index 547ab898ec2f..a7c1ab7b6ea6 100644
--- a/app-misc/scrub/scrub-2.6.1.ebuild
+++ b/app-misc/scrub/scrub-2.6.1-r1.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
+EAPI=8
DESCRIPTION="Overwrite files with iterative patterns"
HOMEPAGE="https://github.com/chaos/scrub"
@@ -9,8 +9,9 @@ SRC_URI="https://github.com/chaos/${PN}/releases/download/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv ~sparc x86"
-IUSE=""
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~sparc ~x86"
-DEPEND=""
-RDEPEND=""
+PATCHES=(
+ "${FILESDIR}"/${P}-implicit-function-declaration-test.patch
+ "${FILESDIR}"/${PN}-2.6.1-bashism-tests.patch
+)