← Commit list

fff11f1ab

Glenn L McGrath
Glenn L McGrath
2001-11-18
FAILED Duration: 381s

Subject

bzcat and bunzip -c support from Thomas Lundquist

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

$ git checkout -f fff11f1ab7ec7cc67087231361f3bde8ecff115f
HEAD is now at fff11f1ab bzcat and bunzip -c support from Thomas Lundquist

$ git clean -fdx
Removing .menuconfig.log
Removing MCmenu0
Removing MCmenu1
Removing MCmenu2
Removing MCmenu3
Removing MCmenu4
Removing include/config/
Removing scripts/lxdialog/checklist.o
Removing scripts/lxdialog/inputbox.o
Removing scripts/lxdialog/lxdialog
Removing scripts/lxdialog/lxdialog.o
Removing scripts/lxdialog/menubox.o
Removing scripts/lxdialog/msgbox.o
Removing scripts/lxdialog/textbox.o
Removing scripts/lxdialog/util.o
Removing scripts/lxdialog/yesno.o

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh defconfig
make: *** No rule to make target 'defconfig'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh allnoconfig
make: *** No rule to make target 'allnoconfig'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh include/bb_config.h
make: *** No rule to make target 'include/bb_config.h'.  Stop.

$ make SHELL=/bin/bash CC=/root/asi_db/compat/cc-wrapper.sh HOSTCC=/root/asi_db/compat/cc-wrapper.sh -j3 V=1
mkdir -p /root/asi_db/builds/busybox/_worktrees/w0/include/config
make -C scripts/lxdialog all
make[1]: Entering directory '/root/asi_db/builds/busybox/_worktrees/w0/scripts/lxdialog'
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o checklist.o checklist.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o menubox.o menubox.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o textbox.o textbox.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o yesno.o yesno.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o inputbox.o inputbox.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o util.o util.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o lxdialog.o lxdialog.c
/root/asi_db/compat/cc-wrapper.sh -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="<ncurses.h>" -c -o msgbox.o msgbox.c
/root/asi_db/compat/cc-wrapper.sh -o lxdialog checklist.o menubox.o textbox.o yesno.o inputbox.o util.o lxdialog.o msgbox.o -lncurses
make[1]: Leaving directory '/root/asi_db/builds/busybox/_worktrees/w0/scripts/lxdialog'
/bin/bash scripts/Menuconfig sysdeps/linux/config.in
Using defaults found in sysdeps/linux/defconfig
Preparing scripts: functions, parsingAwk died with error code 137. Giving up.
.....done.


Your BusyBox configuration changes were NOT saved.

textbox.c: In function ‘dialog_textbox’:
textbox.c:42:10: warning: variable ‘search_term’ set but not used [-Wunused-but-set-variable]
   42 |     char search_term[MAX_LEN + 1];
      |          ^~~~~~~~~~~
textbox.c: In function ‘print_line’:
textbox.c:462:12: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
  462 |     int y, x;
      |            ^
textbox.c:462:9: warning: variable ‘y’ set but not used [-Wunused-but-set-variable]
  462 |     int y, x;
      |         ^
lxtemp.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | main() {}
      | ^~~~
inputbox.c: In function ‘dialog_inputbox’:
inputbox.c:107:17: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign]
  107 |         strcpy (instr, init);
      |                 ^~~~~
      |                 |
      |                 unsigned char *
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/sys/sysmacros.h:22,
                 from /root/asi_db/compat/compat_stime.h:9,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:77:1: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’
   77 | __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
      | ^~~~~
inputbox.c:109:23: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
  109 |     input_x = strlen (instr);
      |                       ^~~~~
      |                       |
      |                       unsigned char *
In file included from dialog.h:27,
                 from inputbox.c:22:
/usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
In file included from dialog.h:29,
                 from inputbox.c:22:
inputbox.c:117:26: warning: pointer targets in passing argument 2 of ‘waddnstr’ differ in signedness [-Wpointer-sign]
  117 |         waddstr (dialog, instr);
      |                          ^~~~~
      |                          |
      |                          unsigned char *
/usr/include/curses.h:830:47: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
  830 | extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int);        /* implemented */
      |                                               ^~~~~~~~~~~~
inputbox.c:147:43: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
  147 |                         input_x = strlen (instr) - scroll;
      |                                           ^~~~~
      |                                           |
      |                                           unsigned char *
In file included from dialog.h:27,
                 from inputbox.c:22:
/usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
lxdialog.c: In function ‘j_inputbox’:
lxdialog.c:211:25: warning: pointer targets in passing argument 2 of ‘fprintf’ differ in signedness [-Wpointer-sign]
  211 |         fprintf(stderr, dialog_input_result);
      |                         ^~~~~~~~~~~~~~~~~~~
      |                         |
      |                         unsigned char *
In file included from /usr/include/stdio.h:894,
                 from /usr/include/curses.h:232,
                 from dialog.h:29,
                 from lxdialog.c:22:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:103:60: note: expected ‘const char * restrict’ but argument is of type ‘unsigned char *’
  103 | fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...)
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
lxdialog.c:211:25: warning: format not a string literal and no format arguments [-Wformat-security]
  211 |         fprintf(stderr, dialog_input_result);
      |                         ^~~~~~~~~~~~~~~~~~~
scripts/Menuconfig: line 559: 2987212 Killed                  awk "$1"
Error opening terminal: unknown.

Commit Diff GitHub →

archival/bunzip2.c+34 -4
@@ -1,4 +1,5 @@
/* Modified for busybox by Glenn McGrath <[email protected]> */
+/* Added support output to stdout by Thomas Lundquist <[email protected]> */
/*--
This file is a part of bzip2 and/or libbzip2, a program and
library for lossless, block-sorting data compression.
@@ -56,6 +57,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <getopt.h>
#include <busybox.h>
//#define TRUE 1
@@ -2316,15 +2318,38 @@ errhandler_io:
int bunzip2_main(int argc, char **argv)
{
+ const int bunzip_to_stdout = 1;
+ int flags = 0;
+ int opt = 0;
+
FILE *src_stream;
FILE *dst_stream;
char *save_name;
char *save_name_ptr;
- if (argc != 2) {
+
+ /* if called as bzcat */
+ if (strcmp(applet_name, "bzcat") == 0)
+ flags |= bunzip_to_stdout;
+
+ while ((opt = getopt(argc, argv, "ch")) != -1) {
+ switch (opt) {
+ case 'c':
+ flags |= bunzip_to_stdout;
+ break;
+ case 'h':
+ default:
+ show_usage(); /* exit's inside usage */
+ }
+ }
+
+ save_name = xstrdup(argv[optind]);
+
+ if (save_name == NULL) {
show_usage();
}
- src_stream = xfopen(argv[1], "r");
- save_name = xstrdup(argv[1]);
+
+ src_stream = xfopen(argv[optind], "r");
+
save_name_ptr = strrchr(save_name, '.');
if (save_name_ptr == NULL) {
return(FALSE);
@@ -2333,7 +2358,12 @@ int bunzip2_main(int argc, char **argv)
error_msg("Invalid extension, expected .bz2");
}
*save_name_ptr = '\0';
- dst_stream = xfopen(save_name, "w");
+
+ if (flags & bunzip_to_stdout) {
+ dst_stream = stdout;
+ } else {
+ dst_stream = xfopen(save_name, "w");
+ }
uncompressStream(src_stream, dst_stream);
return(TRUE);
include/applets.h+3 -0
@@ -68,6 +68,9 @@
APPLET(bunzip2, bunzip2_main, _BB_DIR_USR_BIN)
#endif
APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN)
+#ifdef CONFIG_BUNZIP2
+ APPLET(bzcat, bunzip2_main, _BB_DIR_USR_BIN)
+#endif
#ifdef CONFIG_CAT
APPLET(cat, cat_main, _BB_DIR_BIN)
#endif
include/usage.h+7 -1
@@ -52,11 +52,17 @@
"bar"
#define bunzip2_trivial_usage \
- "FILE"
+ "[-c] FILE"
#define bunzip2_full_usage \
"Uncompress FILE to current directory, stripping its .bz2 extension.\n"\
+ " -c output to stdout\n"\
" -k is assumed"
+#define bzcat_trivial_usage \
+ "FILE"
+#define bzcat_full_usage \
+ "Uncompress to stdout."
+
#define cat_trivial_usage \
"[FILE]..."
#define cat_full_usage \