summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-11 19:54:56 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-11 19:54:56 +0000
commit82260b6d5b38d7ed9f0d21397258b6ae8e399fd2 (patch)
treec8d37f341bc6ee7108d7406c3334259e601268de /sys-apps
parentStub out des_crypt for now #370713 by Nicolas Schlumberger, fix building with... (diff)
downloadhistorical-82260b6d5b38d7ed9f0d21397258b6ae8e399fd2.tar.gz
historical-82260b6d5b38d7ed9f0d21397258b6ae8e399fd2.tar.bz2
historical-82260b6d5b38d7ed9f0d21397258b6ae8e399fd2.zip
Version bump, disable a bunch of utils and devfs support #371059 by Kirill Elagin, and start using libtirpc for nfs support to replace glibc #371129 by Diego Elio Pettenò.
Package-Manager: portage-2.2.0_alpha37/cvs/Linux x86_64
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/busybox/ChangeLog11
-rw-r--r--sys-apps/busybox/Manifest14
-rw-r--r--sys-apps/busybox/busybox-1.18.4.ebuild276
-rw-r--r--sys-apps/busybox/files/busybox-1.18.4-fuser.patch11
-rw-r--r--sys-apps/busybox/files/busybox-1.18.4-hush.patch183
-rw-r--r--sys-apps/busybox/metadata.xml1
6 files changed, 490 insertions, 6 deletions
diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog
index d227c98f349d..6b5e30d79073 100644
--- a/sys-apps/busybox/ChangeLog
+++ b/sys-apps/busybox/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-apps/busybox
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.271 2011/03/27 04:48:38 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.272 2011/06/11 19:54:56 vapier Exp $
+
+*busybox-1.18.4 (11 Jun 2011)
+
+ 11 Jun 2011; Mike Frysinger <vapier@gentoo.org> +busybox-1.18.4.ebuild,
+ +files/busybox-1.18.4-fuser.patch, +files/busybox-1.18.4-hush.patch,
+ metadata.xml:
+ Version bump, disable a bunch of utils and devfs support #371059 by Kirill
+ Elagin, and start using libtirpc for nfs support to replace glibc #371129 by
+ Diego Elio Pettenò.
27 Mar 2011; Mike Frysinger <vapier@gentoo.org> busybox-1.18.3.ebuild:
We respect $CC, and LD in build defaults to $CC, so dont force LD directly
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index 937f9f84e44b..9ddf9f20a5ff 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -11,6 +11,8 @@ AUX busybox-1.18.1-warning.patch 913 RMD160 6b688c0561d7d059c7693b24575a103bb9bf
AUX busybox-1.18.3-buildsys.patch 320 RMD160 5591dc086f5c2d060b0c6e8496df8515ec1dccc8 SHA1 12bd93ead0022a8e80a7d3c40f1f6b166cc3942f SHA256 cb438f0a5c46125387187b4a2389d56f7aa8db5a308aed314f5866cf9a09b72b
AUX busybox-1.18.3-modutils24.patch 949 RMD160 5c7aef4dd8195a6432a8c7e6e865eff1bc73bdd4 SHA1 445c5e662c2bea616b327744d4e9b6b2fd7a645a SHA256 134ed86867784348f484810464df5bc97589e7aa41079c90e35b8d12b9284df8
AUX busybox-1.18.3-wget.patch 3805 RMD160 e3846336786aa825da96ff9b2cf08829c81482a9 SHA1 cb9227a3d9783e4222fbe2f42cb769c7ff1e14e3 SHA256 22538ebee96f66916104b8143cfd16e21568da4c5a89128b9daa60d83a59120b
+AUX busybox-1.18.4-fuser.patch 405 RMD160 44df4d30c0e3ce7a9d391b9b7e9c2c6da8a09bc4 SHA1 c825dc8d2b3b979118eff5aaf68008fd6ce6fddc SHA256 b8b83f442e09a721293d6c23c5a44014bb6009d40950385ee7a9fbe7bf7c880a
+AUX busybox-1.18.4-hush.patch 7400 RMD160 e284357d8364aee6a134e6e0d308387668ee0ad1 SHA1 a0ecb618850b326a0bf3b76857e1c881d708d350 SHA256 e76da947c40784c9a0527c38b1e9edb615c80cfe911d28b9d8a5d67a492bf67c
AUX mdev-start.sh 2758 RMD160 c177aac4940b177bd857bc98ff2ac031e0489bbc SHA1 5a5b95da36c489cd12820513434a7a17ac3bffd1 SHA256 9904263c8dfe2b8c3e968a9b4245fa0c162a2413110c037cdd797ac3773587d7
AUX mdev.rc 282 RMD160 6a11e23fbed92acd24088a7885bdc52b9c845fac SHA1 46f1a0494e009332e83b62599842f8213b60ba60 SHA256 e52abbc3399fc85ce1f097e8f12b25a5ca7fe2e3d648bee60c061b547ba39dc5
AUX mdev/dvbdev 356 RMD160 db7f546ae6e47b59cca9712f1e218cdbc3985c78 SHA1 993c0ab79fa41912f84db95e7dd09aa0965aa8c7 SHA256 ef091bb4c8943a99b9a97b556cdc15ddd20275f5afa8287e201419b08c4e71de
@@ -19,14 +21,16 @@ AUX mdev/usbdev 1624 RMD160 a448558f058566223072c993cb4ae52f9aa43da3 SHA1 4d1a7a
AUX mdev/usbdisk_link 984 RMD160 9b86d85f5f27f03f894a062c9f00d3583c4db3ae SHA1 690290b25fa1b90f6d9d7b8947a55746920991a4 SHA256 4957f6991e0cb988b263b5276b582f1757deecad19cddebe3c615b381df9f858
DIST busybox-1.17.4.tar.bz2 2093389 RMD160 abb7e3ceebac4fdf48b0e717367e64456749016e SHA1 9a2be1e709dd0703d78bed620439bac069d19254 SHA256 0c6b80f007e665228d1b271354b7e80450dcaa67c9162a30eebf936c7cdfcbdc
DIST busybox-1.18.3.tar.bz2 2119251 RMD160 b38e5bc8ca9d586dd1528080b6a866ad8719a31a SHA1 4debdbdf8abb7ae54e0c0e2650cb03d957400533 SHA256 83f112ee88b7eb85bea1cac0b1af33f61387a1036f1898c5ecd79813191a619b
+DIST busybox-1.18.4.tar.bz2 2130598 RMD160 db21d00498b155f950a3f2fb63fa339253e536c2 SHA1 d285855e5770b0fb7caf477dd41ce0863657b975 SHA256 4d24d37bd6f1bd153e8cf9a984ec2f32f18464f73ca535e2cc2e8be9694097fa
EBUILD busybox-1.17.4.ebuild 7921 RMD160 2b3306d4c4b21f4fa246e4963f15ad75707d6fe1 SHA1 7808c464cb6e0d2efd4bd24f3aecaef4ce3c40c4 SHA256 31ee8f50c3123db62879b2209e96e020ae143a5e5f960138924a467eef8f7c8a
EBUILD busybox-1.18.3.ebuild 7841 RMD160 6fbecabd528d25db31d82408100b42c2eeb72712 SHA1 7978d3b3e80b08196edfbc320e7f8ae96f0c10d5 SHA256 3f1dafc13a2662312aa7bb51c95a13524a6891c154b1c4905afb75b498618744
-MISC ChangeLog 40199 RMD160 72c09b24f1d20f6743ef0e33a01e070f8b09bd59 SHA1 ab23442c4be212c5133cbc07d456cfc00b1e6d96 SHA256 7ba126b6c094701c5fdde9e666130e89b670db83ee94e389b33062fa6ddb7881
-MISC metadata.xml 368 RMD160 2facee7f44b7469c85383961c2dd4338ea6fffcb SHA1 eae78f6b5eb3a21aeae692f9a7420ab536be3739 SHA256 033b1cb2abe759f73b184ce43b5c791454716638090767c2bc70cc52b4ef187f
+EBUILD busybox-1.18.4.ebuild 8183 RMD160 1677c131e83ca23da071bb8cf987896b1adbb6a5 SHA1 b2b4af4bc2512cd289bf1d6d05d3bed258eb8802 SHA256 62ba4e8bbbd7d89b11bf67ac03ce90de51fdc52090ed1e058a9fc5439ef3906c
+MISC ChangeLog 40571 RMD160 8e7a03321761cb4b8dddd59a1688ada382ae1b6a SHA1 0b63a1930f1f591e0e6fe4721a560cbc3859dc6f SHA256 06d84f8c0e2f42d2afe0783a4e6f21af679319da9f5888b36ba3389904a34a7e
+MISC metadata.xml 420 RMD160 a3d9cd7689418647525460862b05d3adfb9cd4f4 SHA1 c67d73ae61fb0180060ff7d3d13b1b5e9ef2c56c SHA256 1d2b931bd8b4026d665b485a21263438fe5892bf81af7139e409bfd61a68d55c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iF4EAREIAAYFAk2OwZEACgkQaC/OocHi7JYJ9gD+P9JWdMRwbtm4zFqKc8lvXxHi
-znHwrsZVl9WNUyDACdUA/R3PRpmHLcmJZ6YTe5RDSaEk42NcxmEfK+K8+W2sk5GQ
-=7Moj
+iF4EAREIAAYFAk3zyBcACgkQaC/OocHi7JZv6AD/Y5HclWIfrZ/6gl3M4N3Y5KRS
+VeIUGnbTdT7heX7u0BIBAI2osmyX4fgssF4lCuO1cNDdPdOzCQZyg9oEToe0KnRn
+=FR5m
-----END PGP SIGNATURE-----
diff --git a/sys-apps/busybox/busybox-1.18.4.ebuild b/sys-apps/busybox/busybox-1.18.4.ebuild
new file mode 100644
index 000000000000..8d40e8223cab
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.18.4.ebuild
@@ -0,0 +1,276 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.18.4.ebuild,v 1.1 2011/06/11 19:54:56 vapier Exp $
+
+EAPI="2"
+inherit eutils flag-o-matic savedconfig toolchain-funcs
+
+################################################################################
+# BUSYBOX ALTERNATE CONFIG MINI-HOWTO
+#
+# Busybox can be modified in many different ways. Here's a few ways to do it:
+#
+# (1) Emerge busybox with FEATURES=keepwork so the work directory won't
+# get erased afterwards. Add a definition like ROOT=/my/root/path to the
+# start of the line if you're installing to somewhere else than the root
+# directory. This command will save the default configuration to
+# ${PORTAGE_CONFIGROOT} (or ${ROOT} if ${PORTAGE_CONFIGROOT} is not
+# defined), and it will tell you that it has done this. Note the location
+# where the config file was saved.
+#
+# FEATURES=keepwork USE=savedconfig emerge busybox
+#
+# (2) Go to the work directory and change the configuration of busybox using its
+# menuconfig feature.
+#
+# cd /var/tmp/portage/busybox*/work/busybox-*
+# make menuconfig
+#
+# (3) Save your configuration to the default location and copy it to the
+# one of the locations listed in /usr/portage/eclass/savedconfig.eclass
+#
+# (4) Emerge busybox with USE=savedconfig to use the configuration file you
+# just generated.
+#
+################################################################################
+#
+# (1) Alternatively skip the above steps and simply emerge busybox without
+# USE=savedconfig.
+#
+# (2) Edit the file it saves by hand. ${ROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF}
+#
+# (3) Remerge busybox as using USE=savedconfig.
+#
+################################################################################
+
+#SNAPSHOT=20040726
+SNAPSHOT=""
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ -n ${SNAPSHOT} ]] ; then
+ MY_P=${PN}
+ SRC_URI="http://www.busybox.net/downloads/snapshots/${PN}-${SNAPSHOT}.tar.bz2"
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+fi
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="debug ipv6 make-symlinks +mdev nfs -pam selinux static elibc_glibc"
+RESTRICT="test"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ nfs? ( || ( <sys-libs/glibc-2.13 >=net-libs/libtirpc-0.2.2-r1 ) )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ case $1 in
+ y) sed -i -e "s:.*\<CONFIG_$2\>.*set:CONFIG_$2=y:g" .config;;
+ n) sed -i -e "s:CONFIG_$2=y:# CONFIG_$2 is not set:g" .config;;
+ *) use $1 \
+ && busybox_config_option y $2 \
+ || busybox_config_option n $2
+ return 0
+ ;;
+ esac
+ einfo $(grep "CONFIG_$2[= ]" .config || echo Could not find CONFIG_$2 ...)
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ append-cppflags $($(tc-getPKG_CONFIG) libtirpc --cflags)
+
+ # patches go here!
+ epatch "${FILESDIR}"/busybox-1.18.0-bb.patch
+ epatch "${FILESDIR}"/busybox-${PV}-*.patch
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ Makefile || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n NOMMU
+ busybox_config_option n MONOTONIC_SYSCALL
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option nfs FEATURE_MOUNT_NFS
+ use static \
+ && busybox_config_option n PAM \
+ || busybox_config_option pam PAM
+ busybox_config_option static STATIC
+ busybox_config_option debug DEBUG
+ use debug \
+ && busybox_config_option y NO_DEBUG_LIB \
+ && busybox_config_option n DMALLOC \
+ && busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFS{,D} DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LASH LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake busybox || die "build failed"
+ if ! use static ; then
+ cp .config{,.bak}
+ mv busybox_unstripped{,.bak}
+ use pam && busybox_config_option n PAM
+ emake CONFIG_STATIC=y busybox || die "static build failed"
+ mv busybox_unstripped bb
+ mv busybox_unstripped{.bak,}
+ mv .config{.bak,}
+ fi
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ newbin busybox_unstripped busybox || die
+ if use static ; then
+ dosym busybox /bin/bb || die
+ dosym bb /bin/busybox.static || die
+ else
+ dobin bb || die
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${D}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ insinto /$(get_libdir)/rcscripts/addons
+ doins "${FILESDIR}"/mdev-start.sh || die
+ newinitd "${FILESDIR}"/mdev.rc mdev || die
+ fi
+
+ # bundle up the symlink files for use later
+ emake install || die
+ rm _install/bin/busybox
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ doins busybox-links.tar || die
+ newins .config ${PF}.config || die
+
+ dodoc AUTHORS README TODO
+
+ cd docs || die
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd bootfloppy || die
+ docinto bootfloppy
+ dodoc $(find . -type f)
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is realy what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${D}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ echo
+ einfo "This ebuild has support for user defined configs"
+ einfo "Please read this ebuild for more details and re-emerge as needed"
+ einfo "if you want to add or remove functionality for ${PN}"
+ echo
+}
diff --git a/sys-apps/busybox/files/busybox-1.18.4-fuser.patch b/sys-apps/busybox/files/busybox-1.18.4-fuser.patch
new file mode 100644
index 000000000000..838d9acca28b
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.18.4-fuser.patch
@@ -0,0 +1,11 @@
+--- busybox-1.18.4/procps/fuser.c
++++ busybox-1.18.4-fuser/procps/fuser.c
+@@ -271,7 +271,7 @@ Find processes which use FILEs or PORTs
+ if (sscanf(*pp, "%u/%4s", &port, tproto) != 2)
+ goto file;
+ sprintf(path, "/proc/net/%s", tproto);
+- if (access(path, R_OK) != 0) { /* PORT/PROTO */
++ if (access(path, R_OK) == 0) { /* PORT/PROTO */
+ scan_proc_net(path, port);
+ } else { /* FILE */
+ file:
diff --git a/sys-apps/busybox/files/busybox-1.18.4-hush.patch b/sys-apps/busybox/files/busybox-1.18.4-hush.patch
new file mode 100644
index 000000000000..1e5a5cfcb4be
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.18.4-hush.patch
@@ -0,0 +1,183 @@
+--- busybox-1.18.4/shell/hush.c
++++ busybox-1.18.4-hush/shell/hush.c
+@@ -427,6 +427,15 @@ enum {
+ /* Used for initialization: o_string foo = NULL_O_STRING; */
+ #define NULL_O_STRING { NULL }
+
++#ifndef debug_printf_parse
++static const char *const assignment_flag[] = {
++ "MAYBE_ASSIGNMENT",
++ "DEFINITELY_ASSIGNMENT",
++ "NOT_ASSIGNMENT",
++ "WORD_IS_KEYWORD",
++};
++#endif
++
+ /* I can almost use ordinary FILE*. Is open_memstream() universally
+ * available? Where is it documented? */
+ typedef struct in_str {
+@@ -2885,24 +2894,24 @@ static const struct reserved_combo* matc
+ */
+ static const struct reserved_combo reserved_list[] = {
+ # if ENABLE_HUSH_IF
+- { "!", RES_NONE, NOT_ASSIGNMENT , 0 },
+- { "if", RES_IF, WORD_IS_KEYWORD, FLAG_THEN | FLAG_START },
+- { "then", RES_THEN, WORD_IS_KEYWORD, FLAG_ELIF | FLAG_ELSE | FLAG_FI },
+- { "elif", RES_ELIF, WORD_IS_KEYWORD, FLAG_THEN },
+- { "else", RES_ELSE, WORD_IS_KEYWORD, FLAG_FI },
+- { "fi", RES_FI, NOT_ASSIGNMENT , FLAG_END },
++ { "!", RES_NONE, NOT_ASSIGNMENT , 0 },
++ { "if", RES_IF, MAYBE_ASSIGNMENT, FLAG_THEN | FLAG_START },
++ { "then", RES_THEN, MAYBE_ASSIGNMENT, FLAG_ELIF | FLAG_ELSE | FLAG_FI },
++ { "elif", RES_ELIF, MAYBE_ASSIGNMENT, FLAG_THEN },
++ { "else", RES_ELSE, MAYBE_ASSIGNMENT, FLAG_FI },
++ { "fi", RES_FI, NOT_ASSIGNMENT , FLAG_END },
+ # endif
+ # if ENABLE_HUSH_LOOPS
+- { "for", RES_FOR, NOT_ASSIGNMENT , FLAG_IN | FLAG_DO | FLAG_START },
+- { "while", RES_WHILE, WORD_IS_KEYWORD, FLAG_DO | FLAG_START },
+- { "until", RES_UNTIL, WORD_IS_KEYWORD, FLAG_DO | FLAG_START },
+- { "in", RES_IN, NOT_ASSIGNMENT , FLAG_DO },
+- { "do", RES_DO, WORD_IS_KEYWORD, FLAG_DONE },
+- { "done", RES_DONE, NOT_ASSIGNMENT , FLAG_END },
++ { "for", RES_FOR, NOT_ASSIGNMENT , FLAG_IN | FLAG_DO | FLAG_START },
++ { "while", RES_WHILE, MAYBE_ASSIGNMENT, FLAG_DO | FLAG_START },
++ { "until", RES_UNTIL, MAYBE_ASSIGNMENT, FLAG_DO | FLAG_START },
++ { "in", RES_IN, NOT_ASSIGNMENT , FLAG_DO },
++ { "do", RES_DO, MAYBE_ASSIGNMENT, FLAG_DONE },
++ { "done", RES_DONE, NOT_ASSIGNMENT , FLAG_END },
+ # endif
+ # if ENABLE_HUSH_CASE
+- { "case", RES_CASE, NOT_ASSIGNMENT , FLAG_MATCH | FLAG_START },
+- { "esac", RES_ESAC, NOT_ASSIGNMENT , FLAG_END },
++ { "case", RES_CASE, NOT_ASSIGNMENT , FLAG_MATCH | FLAG_START },
++ { "esac", RES_ESAC, NOT_ASSIGNMENT , FLAG_END },
+ # endif
+ };
+ const struct reserved_combo *r;
+@@ -2968,6 +2977,7 @@ static int reserved_word(o_string *word,
+ ctx->ctx_res_w = r->res;
+ ctx->old_flag = r->flag;
+ word->o_assignment = r->assignment_flag;
++ debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]);
+
+ if (ctx->old_flag & FLAG_END) {
+ struct parse_context *old;
+@@ -3034,18 +3044,6 @@ static int done_word(o_string *word, str
+ debug_printf_parse("word stored in rd_filename: '%s'\n", word->data);
+ ctx->pending_redirect = NULL;
+ } else {
+- /* If this word wasn't an assignment, next ones definitely
+- * can't be assignments. Even if they look like ones. */
+- if (word->o_assignment != DEFINITELY_ASSIGNMENT
+- && word->o_assignment != WORD_IS_KEYWORD
+- ) {
+- word->o_assignment = NOT_ASSIGNMENT;
+- } else {
+- if (word->o_assignment == DEFINITELY_ASSIGNMENT)
+- command->assignment_cnt++;
+- word->o_assignment = MAYBE_ASSIGNMENT;
+- }
+-
+ #if HAS_KEYWORDS
+ # if ENABLE_HUSH_CASE
+ if (ctx->ctx_dsemicolon
+@@ -3065,8 +3063,9 @@ static int done_word(o_string *word, str
+ && ctx->ctx_res_w != RES_CASE
+ # endif
+ ) {
+- debug_printf_parse("checking '%s' for reserved-ness\n", word->data);
+- if (reserved_word(word, ctx)) {
++ int reserved = reserved_word(word, ctx);
++ debug_printf_parse("checking for reserved-ness: %d\n", reserved);
++ if (reserved) {
+ o_reset_to_empty_unquoted(word);
+ debug_printf_parse("done_word return %d\n",
+ (ctx->ctx_res_w == RES_SNTX));
+@@ -3087,6 +3086,23 @@ static int done_word(o_string *word, str
+ "groups and arglists don't mix\n");
+ return 1;
+ }
++
++ /* If this word wasn't an assignment, next ones definitely
++ * can't be assignments. Even if they look like ones. */
++ if (word->o_assignment != DEFINITELY_ASSIGNMENT
++ && word->o_assignment != WORD_IS_KEYWORD
++ ) {
++ word->o_assignment = NOT_ASSIGNMENT;
++ } else {
++ if (word->o_assignment == DEFINITELY_ASSIGNMENT) {
++ command->assignment_cnt++;
++ debug_printf_parse("++assignment_cnt=%d\n", command->assignment_cnt);
++ }
++ debug_printf_parse("word->o_assignment was:'%s'\n", assignment_flag[word->o_assignment]);
++ word->o_assignment = MAYBE_ASSIGNMENT;
++ }
++ debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]);
++
+ if (word->has_quoted_part
+ /* optimization: and if it's ("" or '') or ($v... or `cmd`...): */
+ && (word->data[0] == '\0' || word->data[0] == SPECIAL_VAR_SYMBOL)
+@@ -4105,6 +4121,7 @@ static struct pipe *parse_stream(char **
+ && is_well_formed_var_name(dest.data, '=')
+ ) {
+ dest.o_assignment = DEFINITELY_ASSIGNMENT;
++ debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]);
+ }
+ continue;
+ }
+@@ -4154,6 +4171,7 @@ static struct pipe *parse_stream(char **
+ heredoc_cnt = 0;
+ }
+ dest.o_assignment = MAYBE_ASSIGNMENT;
++ debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]);
+ ch = ';';
+ /* note: if (is_blank) continue;
+ * will still trigger for us */
+@@ -4203,6 +4221,7 @@ static struct pipe *parse_stream(char **
+ }
+ done_pipe(&ctx, PIPE_SEQ);
+ dest.o_assignment = MAYBE_ASSIGNMENT;
++ debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]);
+ /* Do we sit outside of any if's, loops or case's? */
+ if (!HAS_KEYWORDS
+ IF_HAS_KEYWORDS(|| (ctx.ctx_res_w == RES_NONE && ctx.old_flag == 0))
+@@ -4309,6 +4328,7 @@ static struct pipe *parse_stream(char **
+ /* ch is a special char and thus this word
+ * cannot be an assignment */
+ dest.o_assignment = NOT_ASSIGNMENT;
++ debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]);
+ }
+
+ /* Note: nommu_addchr(&ctx.as_string, ch) is already done */
+@@ -4406,6 +4426,7 @@ static struct pipe *parse_stream(char **
+ /* We just finished a cmd. New one may start
+ * with an assignment */
+ dest.o_assignment = MAYBE_ASSIGNMENT;
++ debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]);
+ break;
+ case '&':
+ if (done_word(&dest, &ctx)) {
+@@ -7292,7 +7313,10 @@ static int run_list(struct pipe *pi)
+ #endif
+ #if ENABLE_HUSH_LOOPS
+ /* Beware of "while false; true; do ..."! */
+- if (pi->next && pi->next->res_word == RES_DO) {
++ if (pi->next
++ && (pi->next->res_word == RES_DO || pi->next->res_word == RES_DONE)
++ /* (the second check above is needed for "while ...; do \n done" case) */
++ ) {
+ if (rword == RES_WHILE) {
+ if (rcode) {
+ /* "while false; do...done" - exitcode 0 */
+--- busybox-1.18.4/shell/hush_test/hush-misc/while3.right
++++ busybox-1.18.4-hush/shell/hush_test/hush-misc/while3.right
+@@ -0,0 +1 @@
++OK:0
+--- busybox-1.18.4/shell/hush_test/hush-misc/while3.tests
++++ busybox-1.18.4-hush/shell/hush_test/hush-misc/while3.tests
+@@ -0,0 +1,4 @@
++while false; do
++ # bash will require at least ":" here...
++done
++echo OK:$?
diff --git a/sys-apps/busybox/metadata.xml b/sys-apps/busybox/metadata.xml
index 38a4c15a0b94..dba645e38ea8 100644
--- a/sys-apps/busybox/metadata.xml
+++ b/sys-apps/busybox/metadata.xml
@@ -5,5 +5,6 @@
<use>
<flag name="make-symlinks">Create all the appropriate symlinks in /bin and /sbin.</flag>
<flag name="mdev">Create the appropriate symlink in /sbin and install mdev.conf and support files</flag>
+<flag name="nfs">Support mounting nfs shares</flag>
</use>
</pkgmetadata>