You are not logged in.
When creating a PKGBUILD, is there a way to return an error manually?
In my situation, my package requires a specific font, so I want my PKGBUILD to check whether that font is installed. Since a number of different packages include this font, and also because these packages conflict with each other, I cannot add one of them to the 'requires' part of the PKGBUILD. As a work around, I was going to include in the PKGBUILD a manual check for this font, and if it is not installed, then I would return an error message with a list of packages which include it.
Is there a way to do this? Or does anyone know of a better solution?
Offline
It's bash. Just do the check, print the error, then return 1.
Offline
So just a `return 1` will stop makepkg from continuing?
Offline
any error at all will stop makepkg from continuing. You could just run "false" if you wanted.
Edit: shoot, in Bash it would be "exit 1", not "return 1". Been looking at C lately.
Last edited by Scimmia (2015-04-22 17:01:18)
Offline
Cool thanks! I just found this on the wiki too, under the explanation for the `prepare()` function. I must have missed it earlier.
Note: (From man PKGBUILD) The function is run in bash -e mode, meaning any command that exits with a non-zero status will cause the function to exit.
Also, I found out that the PKGBUILD command for an error is called `error`. The other ones are `msg`, `msg2`, and `warning`.
Last edited by GreenRaccoon23 (2015-04-22 17:39:49)
Offline
Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.
Offline