From 4082a07611d1eff4556296d99c985ee068c15acc Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Wed, 25 Mar 2020 16:28:00 +0100 Subject: Drop tmpfile's getopts code Having this broke installation of modules on FreeBSD, and seeing as it's not used in the current codebase, the safest option is to just drop it. --- lib/util.bash | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/util.bash b/lib/util.bash index c2d717b..1cf84f4 100644 --- a/lib/util.bash +++ b/lib/util.bash @@ -128,21 +128,9 @@ tmpdir() { # however, it will apply additional checks to ensure everything is going # correctly, and the files will be cleaned up automatically at the end. tmpfile() { - local OPTIND - local extension="tmp" local file - while getopts ":x:" opt - do - case "$opt" in - x) extension=$OPTARG ;; - *) alert "Unused argument specified: $opt" ;; - esac - done - - shift $(( OPTIND -1 )) - - file="$(mktemp --suffix ".$extension")" + file="$(mktemp)" # Ensure the file was created succesfully if [[ ! -f "$file" ]] -- cgit v1.1