1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00

redundant-opt-files.sh script: validate PORTSDIR value

Before checking validity of $db_dir, verify $portdir is valid and eject if
it is not.  This provides a better error message when PORTSDIR is invalid.
This commit is contained in:
John Marino 2016-03-17 13:18:21 +00:00
parent 2e28ad5977
commit aafd191750
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=411283

View File

@ -9,6 +9,12 @@
# deleted in order to prevent future configuration check failures.
portsdir=${PORTSDIR:-/usr/ports}
if [ ! -d "${portsdir}" ]; then
echo "The ${portsdir} ports directory does not exist"
echo "There is nothing more to do."
exit
fi
db_dir=$(/usr/bin/make -C ${portsdir}/devel/gmake -V PORT_DBDIR 2>/dev/null)
if [ ! -d "${db_dir}" ]; then