Add uudecode/uuencode.

Some firmware flashing scripts rely on sharutils, which rely on
uudecode/uuencode. Since we're several decades too late to expect
anyone to update sharutils to use base64 instead, and POSIX
includes uudecode/uuencode, let's just support them.

Bug: http://b/31913440
Test: manual
Change-Id: Ia3893de08abfe5b8a8f58349bd298b912fa99e6a
This commit is contained in:
Elliott Hughes 2016-10-04 09:27:25 -07:00
parent 591e5474ca
commit eacb349519
4 changed files with 14 additions and 10 deletions

View File

@ -101,8 +101,8 @@ CONFIG_ULIMIT=y
CONFIG_UNAME=y
CONFIG_UNIQ=y
# CONFIG_UNLINK is not set
# CONFIG_UUDECODE is not set
# CONFIG_UUENCODE is not set
CONFIG_UUDECODE=y
CONFIG_UUENCODE=y
# CONFIG_VI is not set
CONFIG_WC=y
# CONFIG_WHO is not set

View File

@ -203,6 +203,8 @@ LOCAL_SRC_FILES := \
toys/posix/ulimit.c \
toys/posix/uname.c \
toys/posix/uniq.c \
toys/posix/uudecode.c \
toys/posix/uuencode.c \
toys/posix/wc.c \
toys/posix/xargs.c \
@ -375,6 +377,8 @@ ALL_TOOLS := \
unix2dos \
uptime \
usleep \
uudecode \
uuencode \
vmstat \
wc \
which \

View File

@ -188,10 +188,10 @@
#define USE_UNIQ(...) __VA_ARGS__
#define CFG_UNLINK 0
#define USE_UNLINK(...)
#define CFG_UUDECODE 0
#define USE_UUDECODE(...)
#define CFG_UUENCODE 0
#define USE_UUENCODE(...)
#define CFG_UUDECODE 1
#define USE_UUDECODE(...) __VA_ARGS__
#define CFG_UUENCODE 1
#define USE_UUENCODE(...) __VA_ARGS__
#define CFG_VI 0
#define USE_VI(...)
#define CFG_WC 1

View File

@ -3005,7 +3005,7 @@
#undef FOR_usleep
#endif
// uudecode >1o:
// uudecode >1o: >1o:
#undef OPTSTR_uudecode
#define OPTSTR_uudecode ">1o:"
#ifdef CLEANUP_uudecode
@ -3014,7 +3014,7 @@
#undef FLAG_o
#endif
// uuencode <1>2m
// uuencode <1>2m <1>2m
#undef OPTSTR_uuencode
#define OPTSTR_uuencode "<1>2m"
#ifdef CLEANUP_uuencode
@ -5689,14 +5689,14 @@
#ifndef TT
#define TT this.uudecode
#endif
#define FLAG_o (FORCED_FLAG<<0)
#define FLAG_o (1<<0)
#endif
#ifdef FOR_uuencode
#ifndef TT
#define TT this.uuencode
#endif
#define FLAG_m (FORCED_FLAG<<0)
#define FLAG_m (1<<0)
#endif
#ifdef FOR_vconfig