Skip to content

Commit

Permalink
linux.d/debian: use correct string match syntax
Browse files Browse the repository at this point in the history
The test(1) command (also known as '[') does not use
the '==' syntax for testing equality, which is a
feature of bash's '[[' builtin. String equality
is tested with '=', and numeric equality with '-eq'.
This eliminates a series of warnings when running
BuildLinux.sh on Debian-derived systems:

[schwarzgerat](0) $ ./BuildLinux.sh -u
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 42: [: ==: unary operator expected
  • Loading branch information
dankamongmen authored and lanewei120 committed Oct 31, 2024
1 parent a184ba9 commit 733531b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linux.d/debian
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ if [[ -n "$UPDATE_LIB" ]]
then
# for ubuntu 22+ and 23+:
ubu_major_version="$(grep VERSION_ID /etc/os-release | cut -d "=" -f 2 | cut -d "." -f 1 | tr -d /\"/)"
if [ $ubu_major_version == "22" ] || [ $ubu_major_version == "23" ]
if [ $ubu_major_version = "22" ] || [ $ubu_major_version = "23" ]
then
REQUIRED_DEV_PACKAGES+=(libwebkit2gtk-4.0-dev curl libfuse-dev libssl-dev libcurl4-openssl-dev m4)
elif [ $ubu_major_version == "24" ]
elif [ $ubu_major_version = "24" ]
then
REQUIRED_DEV_PACKAGES+=(libwebkit2gtk-4.1-dev)
else
Expand All @@ -59,4 +59,4 @@ then
exit 0
fi

FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev || echo '')
FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev || echo '')

0 comments on commit 733531b

Please sign in to comment.