FS#18709 - makepkg -q parameter
Attached to Project:
Pacman
Opened by Albert Vaca Cintora (elvaka) - Tuesday, 16 March 2010, 15:53 GMT
Last edited by Allan McRae (Allan) - Tuesday, 16 March 2010, 21:50 GMT
Opened by Albert Vaca Cintora (elvaka) - Tuesday, 16 March 2010, 15:53 GMT
Last edited by Allan McRae (Allan) - Tuesday, 16 March 2010, 21:50 GMT
|
Details
I needed an option for makepkg similar to the make -q
parameter, so I just added it.
-q or --question definition from make manual: ``Question mode''. Do not run any commands, or print anything; just return an exit status that is zero if the specified targets are already up to date, nonzero otherwise. It's very useful for scripts! Patch attached. |
This task depends upon
Is there anything wrong with using this?
makepkg
if [ $? -eq 13 ]; then
echo "the package was already built"
fi
Failing that, makepkg --packagelist now lets you print a list of expected outputs, and is guaranteed to not run pkgver() and to produce no other output. You could iterate over these to see if they exist, and it's slightly more logic but actually fewer lines of bash:
while IFS= read -r line; do
[[ -f $line ]] || echo "not fully built"
done < <(makepkg --packagelist)
I'm not convinced we need to apply it, thereby depleting us of the -q short option if we ever wanted to use it for something else. Nine years later, it seems like there are better ways to accomplish the underlying goal.
Feel free to close :)
Surprised to see 9 years have passed since this patch :D