Closed mikkeloscar closed 8 years ago
Your fix isn't quite right:
1) You don't want an -n check, since this doesn't care for PKGBUILDs which don't exist on disk. 2) The error message when the PKGBUILD isn't found is no longer accurate if the PKGBUILD path is parsed.
You probably want something like:
if [[ $1 && ! -f $1 ]]; then
die '%s not found' "$1"
elif [[ ! -f PKGBUILD ]]; then
die 'PKGBUILD not found in current directory'
fi
Oh, that's right, thank you. I have updated it with your version.
I am not sure this is correct. If it does not die because the first argument is not a file, it then checks if there is a PKGBUILD file in the current directory. What about something like
if [ ! -f "${1:-$PWD/PKGBUILD}" ]; then
die '%s not found' "${1:-$PWD/PKGBUILD}"
fi
Right. 176dac035184 should fix this.
Annnnd because of pacman 5.0, this is all effectively reverted. See a07cd59cea847d
I actually ended up doing something like this in the tool where I needed this feature so all is good. Thanks for keeping us updated!
Makes sure that
mksrcinfo
doesn't die if the PKGBUILD path is passed as an argument.