From 53d3176f6ca8d4eff5454ebea5b89ba2e3c066df Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Wed, 21 Jan 2026 18:36:19 +0900 Subject: [PATCH] Reduce duplicated management of supported utils --- Cargo.toml | 1 - GNUmakefile | 99 ++-------------------------------------------- util/show-utils.sh | 4 +- 3 files changed, 6 insertions(+), 98 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e1f7083cdf5..7af13f510e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -154,7 +154,6 @@ feat_common_core = [ # "feat_Tier1" == expanded set of utilities which can be built/run on the usual rust "Tier 1" target platforms (ref: ) feat_Tier1 = [ "feat_common_core", - # "arch", "hostname", "nproc", diff --git a/GNUmakefile b/GNUmakefile index fa824d62680..cae34803b33 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -78,106 +78,15 @@ endif LN ?= ln -sf # Possible programs -PROGS := \ - arch \ - base32 \ - base64 \ - basenc \ - basename \ - cat \ - cksum \ - comm \ - cp \ - csplit \ - cut \ - date \ - dd \ - df \ - dir \ - dircolors \ - dirname \ - du \ - echo \ - env \ - expand \ - expr \ - factor \ - false \ - fmt \ - fold \ - hashsum \ - head \ - hostname \ - join \ - link \ - ln \ - ls \ - mkdir \ - mktemp \ - more \ - mv \ - nl \ - numfmt \ - nproc \ - od \ - paste \ - pr \ - printenv \ - printf \ - ptx \ - pwd \ - readlink \ - realpath \ - rm \ - rmdir \ - seq \ - shred \ - shuf \ - sleep \ - sort \ - split \ - sum \ - sync \ - tac \ - tail \ - tee \ - test \ - touch \ - tr \ - true \ - truncate \ - tsort \ - uname \ - unexpand \ - uniq \ - unlink \ - vdir \ - wc \ - whoami \ - yes +PROGS := \ + $(shell sed -n '/feat_Tier1 = \[/,/\]/p' Cargo.toml | sed '1d;2d' |tr -d '],"\n')\ + $(shell sed -n '/feat_common_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n') UNIX_PROGS := \ - chgrp \ - chmod \ - chown \ - chroot \ - groups \ + $(shell sed -n '/feat_require_unix_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n') \ hostid \ - id \ - install \ - kill \ - logname \ - mkfifo \ - mknod \ - nice \ - nohup \ - pathchk \ pinky \ - stat \ stdbuf \ - stty \ - timeout \ - tty \ uptime \ users \ who diff --git a/util/show-utils.sh b/util/show-utils.sh index 3cc48794030..66266e7a992 100755 --- a/util/show-utils.sh +++ b/util/show-utils.sh @@ -14,8 +14,8 @@ ME_parent_dir_abs="$("${REALPATH}" -mP -- "${ME_parent_dir}" || "${REALPATH}" -- # refs: , -# default ("Tier 1" cross-platform) utility list -default_utils="base32 base64 basename cat cksum comm cp cut date dircolors dirname echo env expand expr factor false fmt fold hashsum head join link ln ls mkdir mktemp more mv nl od paste printenv printf ptx pwd readlink realpath rm rmdir seq shred shuf sleep sort split sum tac tail tee test tr true truncate tsort unexpand uniq wc yes" +# default utility list +default_utils=$(sed -n '/feat_common_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n') # $(sed -n '/feat_Tier1 = \[/,/\]/p' Cargo.toml | sed '1d;2d' |tr -d '],"\n') too? project_main_dir="${ME_parent_dir_abs}" # printf 'project_main_dir="%s"\n' "${project_main_dir}"