Skip to content

Commit 4439f2a

Browse files
committed
Reduce duplicated management of supported utils
1 parent 3026d0d commit 4439f2a

File tree

3 files changed

+6
-98
lines changed

3 files changed

+6
-98
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ feat_common_core = [
154154
# "feat_Tier1" == expanded set of utilities which can be built/run on the usual rust "Tier 1" target platforms (ref: <https://forge.rust-lang.org/release/platform-support.html>)
155155
feat_Tier1 = [
156156
"feat_common_core",
157-
#
158157
"arch",
159158
"hostname",
160159
"nproc",

GNUmakefile

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -78,106 +78,15 @@ endif
7878
LN ?= ln -sf
7979

8080
# Possible programs
81-
PROGS := \
82-
arch \
83-
base32 \
84-
base64 \
85-
basenc \
86-
basename \
87-
cat \
88-
cksum \
89-
comm \
90-
cp \
91-
csplit \
92-
cut \
93-
date \
94-
dd \
95-
df \
96-
dir \
97-
dircolors \
98-
dirname \
99-
du \
100-
echo \
101-
env \
102-
expand \
103-
expr \
104-
factor \
105-
false \
106-
fmt \
107-
fold \
108-
hashsum \
109-
head \
110-
hostname \
111-
join \
112-
link \
113-
ln \
114-
ls \
115-
mkdir \
116-
mktemp \
117-
more \
118-
mv \
119-
nl \
120-
numfmt \
121-
nproc \
122-
od \
123-
paste \
124-
pr \
125-
printenv \
126-
printf \
127-
ptx \
128-
pwd \
129-
readlink \
130-
realpath \
131-
rm \
132-
rmdir \
133-
seq \
134-
shred \
135-
shuf \
136-
sleep \
137-
sort \
138-
split \
139-
sum \
140-
sync \
141-
tac \
142-
tail \
143-
tee \
144-
test \
145-
touch \
146-
tr \
147-
true \
148-
truncate \
149-
tsort \
150-
uname \
151-
unexpand \
152-
uniq \
153-
unlink \
154-
vdir \
155-
wc \
156-
whoami \
157-
yes
81+
PROGS := \
82+
$(shell sed -n '/feat_Tier1 = \[/,/\]/p' Cargo.toml | sed '1d;2d' |tr -d '],"\n')\
83+
$(shell sed -n '/feat_common_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n')
15884

15985
UNIX_PROGS := \
160-
chgrp \
161-
chmod \
162-
chown \
163-
chroot \
164-
groups \
86+
$(shell sed -n '/feat_require_unix_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n') \
16587
hostid \
166-
id \
167-
install \
168-
kill \
169-
logname \
170-
mkfifo \
171-
mknod \
172-
nice \
173-
nohup \
174-
pathchk \
17588
pinky \
176-
stat \
17789
stdbuf \
178-
stty \
179-
timeout \
180-
tty \
18190
uptime \
18291
users \
18392
who

util/show-utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ME_parent_dir_abs="$("${REALPATH}" -mP -- "${ME_parent_dir}" || "${REALPATH}" --
1414

1515
# refs: <https://forge.rust-lang.org/release/platform-support.html> , <https://docs.rs/platforms/0.2.1/platforms/platform/tier1/index.html>
1616

17-
# default ("Tier 1" cross-platform) utility list
18-
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"
17+
# default utility list
18+
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?
1919

2020
project_main_dir="${ME_parent_dir_abs}"
2121
# printf 'project_main_dir="%s"\n' "${project_main_dir}"

0 commit comments

Comments
 (0)