aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-05-08 21:15:22 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-05-11 04:02:27 +0000
commit5246e1f211639aed5320fa8f954bd06c83157a80 (patch)
tree930c9471aaf8cd74996bae2c584052a151982de0
parentac3901a292af18917eadb09630603fd43aa12518 (diff)
downloadaports-5246e1f211639aed5320fa8f954bd06c83157a80.tar.bz2
aports-5246e1f211639aed5320fa8f954bd06c83157a80.tar.xz
main/busybox: clean up APKBUILD and enable tests
-rw-r--r--main/busybox/APKBUILD48
-rw-r--r--main/busybox/fix-tests.patch66
2 files changed, 90 insertions, 24 deletions
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 4b29b9ecfe..10897726a0 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -10,6 +10,7 @@ license="GPL2"
makedepends_build=""
makedepends_host="linux-headers"
makedepends="$makedepends_build $makedepends_host"
+checkdepends="zip"
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-static $pkgname-suid"
options="suid"
@@ -30,6 +31,7 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch
0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch
+ fix-tests.patch
location-for-cpio.patch
acpid.logrotate
@@ -38,23 +40,17 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
dad.if-up
nologin.c
"
+builddir="$srcdir"/$pkgname-$pkgver
-_sdir="$srcdir"/$pkgname-$pkgver
_staticdir="$srcdir"/build-static
_dyndir="$srcdir"/build-dynamic
_config="$srcdir"/busyboxconfig
prepare() {
- mkdir -p "$_staticdir" "$_dyndir"
- #patches
- cd "$_sdir"
- for i in $source; do
- local p=${i##*/}
- case $i in
- *.patch) msg $p; patch -p1 -i "$srcdir"/$p || return 1;;
- esac
- done
+ default_prepare
+ cd "$builddir"
+ mkdir -p "$_staticdir" "$_dyndir"
cp "$srcdir"/nologin.c loginutils/
}
@@ -62,7 +58,7 @@ build() {
# build bbsuid
msg "Building bbsuid"
${CC:-${CROSS_COMPILE}gcc} ${CPPFLAGS} ${CFLAGS} \
- ${LDFLAGS} "$srcdir"/bbsuid.c -o "$_dyndir"/bbsuid || return 1
+ ${LDFLAGS} "$srcdir"/bbsuid.c -o "$_dyndir"/bbsuid
# build dynamic
cd "$_dyndir"
@@ -71,8 +67,8 @@ build() {
[ "$CLIBC" = musl ] && sed -i \
-e "s/CONFIG_EXTRA_COMPAT=y/CONFIG_EXTRA_COMPAT=n/" \
.config
- make -C "$_sdir" O="$PWD" silentoldconfig || return 1
- make || return 1
+ make -C "$builddir" O="$PWD" silentoldconfig
+ make
# build static
cd "$_staticdir"
@@ -84,11 +80,16 @@ build() {
[ "$CLIBC" = musl ] && sed -i \
-e "s/CONFIG_EXTRA_COMPAT=y/CONFIG_EXTRA_COMPAT=n/" \
.config
- make -C "$_sdir" O="$PWD" silentoldconfig || return 1
- make || return 1
+ make -C "$builddir" O="$PWD" silentoldconfig
+ make
mv busybox busybox.static
}
+check() {
+ cd "$_dyndir"
+ SKIP_KNOWN_BUGS=1 make -C "$builddir" O="$PWD" V=1 check
+}
+
package() {
cd "$_dyndir"
mkdir -p "$pkgdir"/usr/sbin "$pkgdir"/usr/bin "$pkgdir"/tmp \
@@ -105,17 +106,15 @@ package() {
"$pkgdir"/etc/network/if-post-up.d \
"$pkgdir"/etc/network/if-pre-down.d \
"$pkgdir"/etc/network/if-pre-up.d \
- "$pkgdir"/etc/network/if-up.d \
- || return 1
- install -m775 "$srcdir"/dad.if-up "$pkgdir"/etc/network/if-up.d/dad \
- || return 1
+ "$pkgdir"/etc/network/if-up.d
+ install -m775 "$srcdir"/dad.if-up "$pkgdir"/etc/network/if-up.d/dad
install -Dm644 "$srcdir"/acpid.logrotate \
- "$pkgdir/etc/logrotate.d/acpid" || return 1
+ "$pkgdir/etc/logrotate.d/acpid"
- mkdir -p "$pkgdir"/var/lib/udhcpd || return 1
- install -Dm644 "$_sdir"/examples/udhcp/udhcpd.conf \
- "$pkgdir"/etc/udhcpd.conf || return 1
+ mkdir -p "$pkgdir"/var/lib/udhcpd
+ install -Dm644 "$builddir"/examples/udhcp/udhcpd.conf \
+ "$pkgdir"/etc/udhcpd.conf
cat >"$pkgdir"/etc/securetty <<EOF
console
tty1
@@ -138,7 +137,7 @@ suid() {
cd "$_dyndir"
mkdir -p "$subpkgdir"/bin
- install -m4111 bbsuid "$subpkgdir"/bin/bbsuid || return 1
+ install -m4111 bbsuid "$subpkgdir"/bin/bbsuid
}
static() {
@@ -163,6 +162,7 @@ f82caa1dc4395f266b024a7face267a916a80ead95f3d392b10fd397d0fdf62703e3078357bc7196
361959788bc11b7f20d4029bb0f561759d270983b09c44fe2a01817378c4eb1c98cd8ef73e7ef8c168b7540170f58ddb36b9e4f80a97565f3fe3ba85b593a471 0012-diff-add-support-for-no-dereference.patch
bf3e7c400e718fbc19fda19d7304ed938e5c59f45d5d1ba6eafd8f62a984d40419dbefd9f6840ac7f220d00abfae67e8f31be78b4c2e25310b265bca8beb91a2 0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch
cb7aa4d5d22596bc8c6510cb653599dd8cf4c3a5312e93adfc6411d811376db2ad3b506a111322f46aa9929a5337e22a169da4ea250fd4b39e703adbc8792a2d 0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch
+2adfc6c71cfcc5df12edef13228c92b34c7782615e60effc97e6e7a9aa7e015c24c7b3950a8a9a2bf3ba5efd43a08ad45b16b35b03c90275807380e0600cb70d fix-tests.patch
f26e090f5de0096ba5c4d46989ebe0ab5fa64c8bf54cd37ddec302fddfde23eac914858d86cc52bf3b5780a8e81ea2612ef6e713df2828e52c606f86a6816f39 location-for-cpio.patch
a9b1403c844c51934637215307dd9e2adb9458921047acff0d86dcf229b6e0027f4b2c6cdaa25a58407aad9d098fb5685d58eb5ff8d2aa3de4912cdea21fe54c acpid.logrotate
d4b9f4a09dcf08ec9f7a66c5250465e3a6dd9beb15140a462a1464110824426c732399e4dab4e6a33073626d4db0e76085b218cd0521027e57ce9f918ff1af29 busyboxconfig
diff --git a/main/busybox/fix-tests.patch b/main/busybox/fix-tests.patch
new file mode 100644
index 0000000000..aed099f879
--- /dev/null
+++ b/main/busybox/fix-tests.patch
@@ -0,0 +1,66 @@
+The cpio tests don't search for the right output line correctly,
+using a hardcoded tail offset. Instead, grep for the file entry
+just added.
+
+The reverse-hunk patch tests seem to get the output order wrong,
+and the tests pass when this is corrected.
+--- a/testsuite/cpio.tests
++++ b/testsuite/cpio.tests
+@@ -129,7 +129,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio uses by default uid/gid" \
+-"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ $user/$group
+ 0
+@@ -138,7 +138,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with create" \
+-"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 1234/5678
+ 0
+@@ -147,7 +147,7 @@
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with extract" \
+-"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 8765/4321
+ 0
+
+--- a/testsuite/patch.tests
++++ b/testsuite/patch.tests
+@@ -75,12 +75,12 @@
+ testing "patch detects already applied hunk" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ +def
+ 123
+-patching file input
+ 1
+ abc
+ def
+@@ -103,12 +103,12 @@
+ testing "patch detects already applied hunk at the EOF" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ 123
+ +456
+-patching file input
+ 1
+ abc
+ 123