From: <ges...@us...> - 2008-11-28 09:03:54
|
Revision: 2117 http://ipcop.svn.sourceforge.net/ipcop/?rev=2117&view=rev Author: gespinasse Date: 2008-11-28 09:03:49 +0000 (Fri, 28 Nov 2008) Log Message: ----------- Fix finally the issue with busybox-1.12.2 upgrade Thank to vda for the fix Modified Paths: -------------- ipcop/trunk/lfs/busybox Added Paths: ----------- ipcop/trunk/src/patches/busybox-1.13.0-getopt.patch Removed Paths: ------------- ipcop/trunk/src/patches/busybox-1.12.2_revert.patch Modified: ipcop/trunk/lfs/busybox =================================================================== --- ipcop/trunk/lfs/busybox 2008-11-27 23:40:53 UTC (rev 2116) +++ ipcop/trunk/lfs/busybox 2008-11-28 09:03:49 UTC (rev 2117) @@ -82,7 +82,7 @@ @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && cp -f $(DIR_SRC)/config/busybox/busybox-1.12.x-config .config - cd $(DIR_APP) && patch -Np1 -R -i $(DIR_PATCHES)/$(THISAPP)_revert.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/busybox-1.13.0-getopt.patch ifeq "$(MACHINE)" "alpha" cd $(DIR_APP) && sed -i -e 's/#define BB_INSMOD//' Config.h Deleted: ipcop/trunk/src/patches/busybox-1.12.2_revert.patch =================================================================== --- ipcop/trunk/src/patches/busybox-1.12.2_revert.patch 2008-11-27 23:40:53 UTC (rev 2116) +++ ipcop/trunk/src/patches/busybox-1.12.2_revert.patch 2008-11-28 09:03:49 UTC (rev 2117) @@ -1,60 +0,0 @@ -diff -Nur busybox-1.12.1/libbb/getopt32.c busybox-1.12.2/libbb/getopt32.c ---- busybox-1.12.1/libbb/getopt32.c 2008-09-28 20:04:20.000000000 +0200 -+++ busybox-1.12.2/libbb/getopt32.c 2008-11-09 18:20:37.000000000 +0100 -@@ -515,28 +515,6 @@ - } - } - -- /* In case getopt32 was already called: -- * reset the libc getopt() function, which keeps internal state. -- * -- * BSD-derived getopt() functions require that optind be set to 1 in -- * order to reset getopt() state. This used to be generally accepted -- * way of resetting getopt(). However, glibc's getopt() -- * has additional getopt() state beyond optind, and requires that -- * optind be set to zero to reset its state. So the unfortunate state of -- * affairs is that BSD-derived versions of getopt() misbehave if -- * optind is set to 0 in order to reset getopt(), and glibc's getopt() -- * will core dump if optind is set 1 in order to reset getopt(). -- * -- * More modern versions of BSD require that optreset be set to 1 in -- * order to reset getopt(). Sigh. Standards, anyone? -- */ --#ifdef __GLIBC__ -- optind = 0; --#else /* BSD style */ -- optind = 1; -- /* optreset = 1; */ --#endif -- /* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */ - pargv = NULL; - - /* Note: just "getopt() <= 0" will not work well for -diff -Nur busybox-1.12.1/util-linux/getopt.c busybox-1.12.2/util-linux/getopt.c ---- busybox-1.12.1/util-linux/getopt.c 2008-09-28 20:04:30.000000000 +0200 -+++ busybox-1.12.2/util-linux/getopt.c 2008-11-09 18:20:37.000000000 +0100 -@@ -142,7 +142,8 @@ - * Other settings are found in global variables. - */ - #if !ENABLE_GETOPT_LONG --#define generate_output(argv,argc,optstr,longopts) generate_output(argv,argc,optstr) -+#define generate_output(argv,argc,optstr,longopts) \ -+ generate_output(argv,argc,optstr) - #endif - static int generate_output(char **argv, int argc, const char *optstr, const struct option *longopts) - { -@@ -156,14 +157,6 @@ - if (quiet_errors) /* No error reporting from getopt(3) */ - opterr = 0; - -- /* Reset getopt(3) (see libbb/getopt32.c for long rant) */ --#ifdef __GLIBC__ -- optind = 0; --#else /* BSD style */ -- optind = 1; -- /* optreset = 1; */ --#endif -- - while (1) { - opt = - #if ENABLE_GETOPT_LONG Added: ipcop/trunk/src/patches/busybox-1.13.0-getopt.patch =================================================================== --- ipcop/trunk/src/patches/busybox-1.13.0-getopt.patch (rev 0) +++ ipcop/trunk/src/patches/busybox-1.13.0-getopt.patch 2008-11-28 09:03:49 UTC (rev 2117) @@ -0,0 +1,22 @@ +--- busybox-1.13.0/libbb/getopt32.c Thu Oct 30 08:41:34 2008 ++++ busybox-1.13.0-getopt/libbb/getopt32.c Wed Nov 12 23:04:01 2008 +@@ -515,6 +515,19 @@ + } + } + ++ /* In case getopt32 was already called: ++ * reset the libc getopt() function, which keeps internal state. ++ * run_nofork_applet_prime() does this, but we might end up here ++ * also via gunzip_main() -> gzip_main(). Play safe. ++ */ ++#ifdef __GLIBC__ ++ optind = 0; ++#else /* BSD style */ ++ optind = 1; ++ /* optreset = 1; */ ++#endif ++ /* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */ ++ + pargv = NULL; + + /* Note: just "getopt() <= 0" will not work well for This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |