Commit bf4d2d86 authored by Peter Korsgaard's avatar Peter Korsgaard
Browse files

busybox: 1.15.2 patches

parent edee1d78
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
2010.02, Not yet released:

	Updated/fixed packages: busybox

2009.11, Released December 1st, 2009:

	Additional fixes and cleanups.
+1136 −0

File added.

Preview size limit exceeded, changes collapsed.

+48 −0
Original line number Diff line number Diff line
diff -urpN busybox-1.15.2/editors/awk.c busybox-1.15.2-awk/editors/awk.c
--- busybox-1.15.2/editors/awk.c	2009-10-08 02:59:09.000000000 +0200
+++ busybox-1.15.2-awk/editors/awk.c	2009-11-30 02:05:12.000000000 +0100
@@ -2393,12 +2393,14 @@ static var *evaluate(node *op, var *res)
 
 		case XC( OC_MOVE ):
 			/* if source is a temporary string, jusk relink it to dest */
-			if (R.v == v1+1 && R.v->string) {
-				res = setvar_p(L.v, R.v->string);
-				R.v->string = NULL;
-			} else {
+//Disabled: if R.v is numeric but happens to have cached R.v->string,
+//then L.v ends up being a string, which is wrong
+//			if (R.v == v1+1 && R.v->string) {
+//				res = setvar_p(L.v, R.v->string);
+//				R.v->string = NULL;
+//			} else {
 				res = copyvar(L.v, R.v);
-			}
+//			}
 			break;
 
 		case XC( OC_TERNARY ):
diff -urpN busybox-1.15.2/testsuite/awk.tests busybox-1.15.2-awk/testsuite/awk.tests
--- busybox-1.15.2/testsuite/awk.tests	2009-09-26 15:14:57.000000000 +0200
+++ busybox-1.15.2-awk/testsuite/awk.tests	2009-11-30 02:05:12.000000000 +0100
@@ -47,4 +47,21 @@ testing "awk NF in BEGIN" \
 	":0::::\n" \
 	"" ""
 
+prg='
+function b(tmp) {
+	tmp = 0;
+	print "" tmp; #this line causes the bug
+	return tmp;
+}
+function c(tmpc) {
+	tmpc = b(); return tmpc;
+}
+BEGIN {
+	print (c() ? "string" : "number");
+}'
+testing "awk string cast (bug 725)" \
+	"awk '$prg'" \
+	"0\nnumber\n" \
+	"" ""
+
 exit $FAILCOUNT
+92 −0
Original line number Diff line number Diff line
diff -urpN busybox-1.15.2/Makefile busybox-1.15.2-buildsys/Makefile
--- busybox-1.15.2/Makefile	2009-10-08 03:06:38.000000000 +0200
+++ busybox-1.15.2-buildsys/Makefile	2009-11-28 23:38:39.000000000 +0100
@@ -358,6 +358,15 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+# bbox: we have helpers in applets/
+# we depend on scripts_basic, since scripts/basic/fixdep
+# must be built before any other host prog
+PHONY += applets_dir
+applets_dir: scripts_basic
+	$(Q)$(MAKE) $(build)=applets
+
+applets/%: applets_dir ;
+
 PHONY += outputmakefile
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
@@ -797,7 +806,7 @@ ifneq ($(KBUILD_MODULES),)
 	$(Q)rm -f $(MODVERDIR)/*
 endif
 
-archprepare: prepare1 scripts_basic
+archprepare: prepare1 scripts_basic applets_dir
 
 prepare0: archprepare FORCE
 	$(Q)$(MAKE) $(build)=.
diff -urpN busybox-1.15.2/scripts/kconfig/Makefile busybox-1.15.2-buildsys/scripts/kconfig/Makefile
--- busybox-1.15.2/scripts/kconfig/Makefile	2009-09-26 15:14:57.000000000 +0200
+++ busybox-1.15.2-buildsys/scripts/kconfig/Makefile	2009-11-28 23:38:39.000000000 +0100
@@ -17,11 +17,28 @@ menuconfig: $(obj)/mconf
 config: $(obj)/conf
 	$< Config.in
 
+# Mtime granularity problem.
+# It was observed that these commands:
+# make allnoconfig; sed -i -e '/CONFIG_TRUE/s/.*/CONFIG_TRUE=y/' .config; make
+# sometimes produce busybox with "true" applet still disabled.
+# This is caused by .config updated by sed having mtime which is still
+# equal to (not bigger than) include/autoconf.h's mtime,
+# and thus 2nd make does not regenerate include/autoconf.h.
+# Waiting for 1 second after non-interactive "make XXXXconfig"
+# prevents this from happening.
+#
+# We'd like to detect whether filesystem we are on has coarse mtimes,
+# but can't do it yet, bbox ls hasn't got --full-time.
+#MTIME_IS_COARSE:=@ls --full-time -ld | grep -F .000 >/dev/null
+MTIME_IS_COARSE:=@true
+
 oldconfig: $(obj)/conf
 	$< -o Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 silentoldconfig: $(obj)/conf
 	$< -s Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 update-po-config: $(obj)/kxgettext
 	xgettext --default-domain=linux \
@@ -46,15 +63,19 @@ PHONY += randconfig allyesconfig allnoco
 
 randconfig: $(obj)/conf
 	$< -r Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 allyesconfig: $(obj)/conf
 	$< -y Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 allnoconfig: $(obj)/conf
 	$< -n Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 allmodconfig: $(obj)/conf
 	$< -m Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
@@ -63,9 +84,11 @@ else
 	@echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
 	$(Q)$< -D $(KBUILD_DEFCONFIG) Config.in
 endif
+	$(MTIME_IS_COARSE) && sleep 1
 
 %_defconfig: $(obj)/conf
 	$(Q)$< -D $@ Config.in
+	$(MTIME_IS_COARSE) && sleep 1
 
 # Help text used by make help
 help:
+5 −25
Original line number Diff line number Diff line
From 86cfb70ca5f2bde11f2d071bc59db75291d8552f Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Fri, 27 Nov 2009 13:26:17 +0100
Subject: [PATCH] flash_eraseall: stop using obsolete mtd/jffs2-user.h; code shrink

function                                             old     new   delta
show_progress                                         68      67      -1
flash_eraseall_main                                 1007     882    -125
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-126)           Total: -126 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 miscutils/flash_eraseall.c |   47 ++++++++++++++++++++++++++++---------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/miscutils/flash_eraseall.c b/miscutils/flash_eraseall.c
index ba0a6b5..ca00a13 100644
--- a/miscutils/flash_eraseall.c
+++ b/miscutils/flash_eraseall.c
diff -urpN busybox-1.15.2/miscutils/flash_eraseall.c busybox-1.15.2-flash/miscutils/flash_eraseall.c
--- busybox-1.15.2/miscutils/flash_eraseall.c	2009-09-26 15:14:57.000000000 +0200
+++ busybox-1.15.2-flash/miscutils/flash_eraseall.c	2009-11-29 00:01:46.000000000 +0100
@@ -12,22 +12,35 @@
 
 #include "libbb.h"
@@ -64,7 +47,7 @@ index ba0a6b5..ca00a13 100644
 
 static uint32_t crc32(uint32_t val, const void *ss, int len,
 		uint32_t *crc32_table)
@@ -40,9 +53,11 @@ static uint32_t crc32(uint32_t val, const void *ss, int len,
@@ -40,9 +53,11 @@ static uint32_t crc32(uint32_t val, cons
 
 static void show_progress(mtd_info_t *meminfo, erase_info_t *erase)
 {
@@ -79,7 +62,7 @@ index ba0a6b5..ca00a13 100644
 	fflush(stdout);
 }
 
@@ -57,17 +72,15 @@ int flash_eraseall_main(int argc UNUSED_PARAM, char **argv)
@@ -57,17 +72,15 @@ int flash_eraseall_main(int argc UNUSED_
 	unsigned int flags;
 	char *mtd_name;
 
@@ -99,6 +82,3 @@ index ba0a6b5..ca00a13 100644
 	xioctl(fd, MEMGETINFO, &meminfo);
 	erase.length = meminfo.erasesize;
 	if (meminfo.type == MTD_NANDFLASH)
-- 
1.6.5
Loading