core/mkinitcpio-busybox to 1.32.1-2

This commit is contained in:
Kevin Mihelich 2021-01-11 15:25:08 +00:00
parent f038711fa3
commit 15cf97da38
2 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,50 @@
From 883cdb79a440d0425766f67aaef0cabde0a5060e Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Sat, 9 Jan 2021 08:27:37 +0100
Subject: ash: fix ${unset_var/pattern/repl}
function old new delta
subevalvar 1349 1353 +4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
shell/ash.c | 3 ++-
shell/ash_test/ash-vars/var_bash_repl_empty_var.right | 1 +
shell/ash_test/ash-vars/var_bash_repl_empty_var.tests | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/shell/ash.c b/shell/ash.c
index 37f9dd71b..76bf39ec2 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7015,7 +7015,8 @@ subevalvar(char *start, char *str, int strloc,
slash_pos = -1;
if (repl) {
slash_pos = expdest - ((char *)stackblock() + strloc);
- STPUTC('/', expdest);
+ if (!(flag & EXP_DISCARD))
+ STPUTC('/', expdest);
//bb_error_msg("repl+1:'%s'", repl + 1);
p = argstr(repl + 1, (flag & EXP_DISCARD) | EXP_TILDE); /* EXP_TILDE: echo "${v/x/~}" expands ~ ! */
*repl = '/';
diff --git a/shell/ash_test/ash-vars/var_bash_repl_empty_var.right b/shell/ash_test/ash-vars/var_bash_repl_empty_var.right
index 892916783..cf8f088c1 100644
--- a/shell/ash_test/ash-vars/var_bash_repl_empty_var.right
+++ b/shell/ash_test/ash-vars/var_bash_repl_empty_var.right
@@ -1,2 +1,3 @@
+
Ok:0
diff --git a/shell/ash_test/ash-vars/var_bash_repl_empty_var.tests b/shell/ash_test/ash-vars/var_bash_repl_empty_var.tests
index 73a43d38e..22aaba560 100755
--- a/shell/ash_test/ash-vars/var_bash_repl_empty_var.tests
+++ b/shell/ash_test/ash-vars/var_bash_repl_empty_var.tests
@@ -1,3 +1,5 @@
+unset v
+echo ${v/*/w}
v=''
echo ${v/*/w}
echo Ok:$?
--
cgit v1.2.1

View file

@ -8,7 +8,7 @@
pkgname=mkinitcpio-busybox
pkgver=1.32.1
pkgrel=1
pkgrel=2
pkgdesc='Base initramfs tools'
arch=(x86_64)
url="https://www.busybox.net/"
@ -16,15 +16,19 @@ license=(GPL)
depends=(glibc libxcrypt)
options=(!buildflags)
source=(https://busybox.net/downloads/busybox-$pkgver.tar.bz2{,.sig}
0001-ash-fix-unset_var-pattern-repl.patch
config)
sha256sums=('9d57c4bd33974140fd4111260468af22856f12f5b5ef7c70c8d9b75c712a0dee'
'SKIP'
'4e4fb268c51e378a3ad0a12f903a601a136d31cae8b684a51ebabbc9a6cf9250'
'81843d10a63f3e29f37560ded54a049b45c8a4b38560bf9489ec4124eead170e')
validpgpkeys=('C9E9416F76E610DBD09D040F47B70C55ACC9965B') # Denis Vlasenko <vda.linux@googlemail.com>
prepare() {
cd "busybox-$pkgver"
patch -Np1 < ../0001-ash-fix-unset_var-pattern-repl.patch
if [ ${CARCH} = "aarch64" ]; then
ARMCARCH="armv8-a"
elif [ ${CARCH} = "armv7h" ]; then