From 01c2f9c024765a923237522540e891263420720a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 24 Oct 2026 13:21:54 -0500 Subject: [PATCH] Autogenerate OLDTOY() config entries. --- scripts/genconfig.sh | 7 ++++++- toys/lsb/md5sum.c | 30 ------------------------------ toys/net/ftpget.c | 8 +------- toys/posix/chgrp.c | 6 ------ toys/posix/grep.c | 10 ---------- toys/posix/id.c | 8 -------- 6 files changed, 7 insertions(+), 62 deletions(-) diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index ee05d339..2a70ecf1 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -35,7 +35,12 @@ genconfig() do # Grab the config block for Config.in echo "# $i" - $SED -n '/^\*\//q;/^config [A-Z]/,$p' $i || return 1 + $SED -n '/^\*\//q;/^config [A-Z]/,$p' $i && + # add OLDTOY boilerplate config entries + $SED -n 's/^USE_.*(OLDTOY(\([a-z][^,-]*\), *\([^,]*\).*/\1 \2/p' $i | \ + tr a-z A-Z | while read a b; do + printf "\nconfig $a\n bool\n default y\n depends on $b\n" || exit 1 + done echo done diff --git a/toys/lsb/md5sum.c b/toys/lsb/md5sum.c index 5dc891bd..23a14146 100644 --- a/toys/lsb/md5sum.c +++ b/toys/lsb/md5sum.c @@ -36,36 +36,6 @@ config MD5SUM -b Brief (hash only, no filename) -c Check each line of each FILE is the same hash+filename we'd output -s No output, exit status 0 if all hashes match, 1 otherwise - -config SHA1SUM - bool "sha1sum" - default y - help - See md5sum - -config SHA224SUM - bool "sha224sum" - default y - help - See md5sum - -config SHA256SUM - bool "sha256sum" - default y - help - See md5sum - -config SHA384SUM - bool "sha384sum" - default y - help - See md5sum - -config SHA512SUM - bool "sha512sum" - default y - help - See md5sum */ #define FORCE_FLAGS diff --git a/toys/net/ftpget.c b/toys/net/ftpget.c index 6ec55692..ae083db1 100644 --- a/toys/net/ftpget.c +++ b/toys/net/ftpget.c @@ -16,7 +16,7 @@ config FTPGET help usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE - Talk to ftp server. By default get REMOTE file via passive anonymous + Talk to ftp server. By default get/put REMOTE file via passive anonymous transfer, optionally saving under a LOCAL name. Can also send, list, etc. -c Continue partial transfer @@ -34,12 +34,6 @@ config FTPGET -m Move file on server from LOCAL to REMOTE -M mkdir -s Send file - -config FTPPUT - bool "ftpput" - default y - help - An ftpget that defaults to -s instead of -g */ #define FOR_ftpget diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c index a4fc41c0..46e9fe06 100644 --- a/toys/posix/chgrp.c +++ b/toys/posix/chgrp.c @@ -23,12 +23,6 @@ config CHGRP -L With -R change target of symlink, follow all symlinks -P With -R change symlink, do not follow symlinks (default) -v Verbose - -config CHOWN - bool "chown" - default y - help - see: chgrp */ #define FOR_chgrp diff --git a/toys/posix/grep.c b/toys/posix/grep.c index f12918a9..6b9f4bf6 100644 --- a/toys/posix/grep.c +++ b/toys/posix/grep.c @@ -45,16 +45,6 @@ config GREP output prefix (default: filename if checking more than 1 file) -H force filename -b byte offset of match -h hide filename -n line number of match - -config EGREP - bool - default y - depends on GREP - -config FGREP - bool - default y - depends on GREP */ #define FOR_grep diff --git a/toys/posix/id.c b/toys/posix/id.c index f311920b..bed07245 100644 --- a/toys/posix/id.c +++ b/toys/posix/id.c @@ -40,14 +40,6 @@ config LOGNAME help usage: logname - Print the current user name. - -config WHOAMI - bool "whoami" - default y - help - usage: whoami - Print the current user name. */ -- 2.39.5