aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2020-08-09 15:33:37 -1000
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-08-12 11:08:05 +0200
commit1fdf6b745cc3d85be3743837817a360121554134 (patch)
tree6396426c1b63ceb0b21c486a3158ded303eebe3e /package/base-files
parent4165232c45df224f32a94f43b9938d13d643b2a8 (diff)
downloadupstream-1fdf6b745cc3d85be3743837817a360121554134.tar.gz
upstream-1fdf6b745cc3d85be3743837817a360121554134.tar.bz2
upstream-1fdf6b745cc3d85be3743837817a360121554134.zip
treewide: replace `which` with `command -v`
Fix shellcheck SC2230 > which is non-standard. Use builtin 'command -v' instead. Using `command -v` is POSIX compliant while `which` is not. Also to mention, `command -v` is a shell builtin whereas `which` is a separate busybox applet. Once applied to everything concerning OpenWrt we can disable the busybox feature `which` and save 3.8kB. Acked-by: Stijn Tintel <stijn@linux-ipv6.be> Signed-off-by: Paul Spooren <mail@aparcar.org> [also replace cases in zram-swap] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/upgrade/stage22
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index dbb33e8958..a4fef42134 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -45,7 +45,7 @@ switch_to_ramfs() {
snapshot snapshot_tool \
$RAMFS_COPY_BIN
do
- local file="$(which "$binary" 2>/dev/null)"
+ local file="$(command -v "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh $RAMFS_COPY_DATA