Previously if you did: fw_update otus-firmware-1.0p1.tgz
and that firmware didn't exist in the current directory,
we would download that firmware into the current directory.
Which is not the expected outcome.
#!/bin/ksh
-# $OpenBSD: fw_update.sh,v 1.47 2023/08/31 21:29:53 afresh1 Exp $
+# $OpenBSD: fw_update.sh,v 1.48 2023/09/28 00:45:22 afresh1 Exp $
#
# Copyright (c) 2021,2023 Andrew Hewus Fresh <afresh1@openbsd.org>
#
fi
continue
fi
- f="$LOCALSRC/$f"
elif ! "$INSTALL" && ! grep -Fq "($f)" "$CFILE" ; then
warn "Cannot download local file $f"
exit 1
fi
fi
+ # Fetch an unqualified file into LOCALSRC
+ # if it doesn't exist in the current directory.
+ if [ "$f" = "${f##/}" ] && [ ! -e "$f" ]; then
+ f="$LOCALSRC/$f"
+ fi
+
if "$verify_existing" && [ -e "$f" ]; then
pending_status=false
if ((VERBOSE == 1)); then