From 0225fd6f7dddc72f59a18d6b72dbb3409656bf3f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 24 Feb 2016 21:24:09 -0500 Subject: [PATCH] Get rid of pattern_match function. This functionality is built into bash through the [[..]] syntax. --- chocpkg/chocpkg_functions.sh | 15 --------------- pkgdef/SDL2.sh | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/chocpkg/chocpkg_functions.sh b/chocpkg/chocpkg_functions.sh index 20b8525..e415a70 100644 --- a/chocpkg/chocpkg_functions.sh +++ b/chocpkg/chocpkg_functions.sh @@ -1,18 +1,3 @@ - -# Check if the specified string matches the glob pattern. -pattern_match() { - pattern="$1" - - case "$2" in - $pattern) - true - ;; - *) - false - ;; - esac -} - # Determine if a given program is in the PATH. have_tool() { tool=$1 diff --git a/pkgdef/SDL2.sh b/pkgdef/SDL2.sh index e155157..003f7ad 100644 --- a/pkgdef/SDL2.sh +++ b/pkgdef/SDL2.sh @@ -11,7 +11,7 @@ if [ $(uname) = "Darwin" ]; then fi # When targeting Windows, we need to install the directx headers first. -if [ $(uname) = "Cygwin" ] || pattern_match "*mingw*" "$BUILD_HOST"; then +if [ $(uname) = "Cygwin" ] || [[ "$BUILD_HOST" = *mingw* ]]; then DEPENDENCIES="directx-devel" config_options+=" --disable-directx" fi