Skip to content

Commit 0883bf1

Browse files
committed
GNUmakefile: Do not depend on system tr for Gentoo
1 parent bc58d3d commit 0883bf1

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,13 @@ feat_require_unix_core = [
295295
]
296296
# "feat_require_unix_utmpx" == set of utilities requiring unix utmp/utmpx support
297297
# * ref: <https://wiki.musl-libc.org/faq.html#Q:-Why-is-the-utmp/wtmp-functionality-only-implemented-as-stubs?>
298-
feat_require_unix_utmpx = ["pinky", "uptime", "users", "who"]
298+
feat_require_unix_utmpx = [
299+
# block linter to extract utils at make by sed
300+
"users",
301+
"uptime",
302+
"who",
303+
"pinky",
304+
]
299305
# "feat_require_unix_hostid" == set of utilities requiring gethostid in libc (only some unixes provide)
300306
feat_require_unix_hostid = ["hostid"]
301307
# "feat_require_selinux" == set of utilities depending on SELinux.

GNUmakefile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,14 @@ LN ?= ln -sf
7979

8080
# Possible programs
8181
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')
82+
$(shell sed -n '/feat_Tier1 = \[/,/\]/{s/[,"]//g;/common_core/d;/^ /p}' Cargo.toml)\
83+
$(shell sed -n '/feat_common_core = \[/,/\]/{s/[,"]//g;/^ /p}' Cargo.toml)
8484

8585
UNIX_PROGS := \
86-
$(shell sed -n '/feat_require_unix_core = \[/,/\]/p' Cargo.toml | sed '1d' |tr -d '],"\n') \
86+
$(shell sed -n '/feat_require_unix_core = \[/,/\]/{s/[,"]//g;/^ /p}' Cargo.toml) \
87+
$(shell sed -n -e 's/.*#.*//' -e '/feat_require_unix_utmpx = \[/,/\]/{s/[,"]//g;/^ /p}' Cargo.toml) \
8788
hostid \
88-
pinky \
89-
stdbuf \
90-
uptime \
91-
users \
92-
who
89+
stdbuf
9390

9491
SELINUX_PROGS := \
9592
chcon \

0 commit comments

Comments
 (0)