Skip to content

Commit 5152b40

Browse files
committed
build: use shuf if available
1 parent c9e47c1 commit 5152b40

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/make/lib/ls/pkgs/lib.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ list-lib-pkgs:
7373
# make list-random-lib-pkgs RANDOM_SELECTION_SIZE=10
7474
#/
7575
list-random-lib-pkgs:
76-
$(QUIET) make list-lib-pkgs | sort -R | head -n $(RANDOM_SELECTION_SIZE)
76+
@if command -v shuf > /dev/null; then \
77+
make list-lib-pkgs | shuf -n $(RANDOM_SELECTION_SIZE) ; \
78+
else \
79+
make list-lib-pkgs | sort -R | head -n $(RANDOM_SELECTION_SIZE) ; \
80+
fi
7781

7882
.PHONY: list-random-lib-pkgs

0 commit comments

Comments
 (0)