[pacman-dev] [PATCH] makepkg: Added checks in check_software for distcc, ccache, strip and gzip
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> --- I thought about adding checks for the PKGEXT and SRCEXT compression utilities but I'm not sure as it might be overkill. Anyway, they could always be added later on in another patch. BTW, I didn't test this patch as it seemed quite straightforward. scripts/makepkg.sh.in | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 239bb64..e9b8c56 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1485,6 +1485,38 @@ check_software() { fi fi + # distcc - compilation with distcc + if [[ $(check_buildenv distcc) = "y" && $(check_option distcc) != "n" ]]; then + if ! type -p distcc >/dev/null; then + error "$(gettext "Cannot find the %s binary required for distributed compilation.")" "distcc" + ret=1 + fi + fi + + # ccache - compilation with ccache + if [[ $(check_buildenv ccache) = "y" && $(check_option ccache) != "n" ]]; then + if ! type -p ccache >/dev/null; then + error "$(gettext "Cannot find the %s binary required for compilation with compiler cache.")" "ccache" + ret=1 + fi + fi + + # strip - strip symbols from binaries/libraries + if [[ $(check_option strip) = y ]]; then + if ! type -p strip >/dev/null; then + error "$(gettext "Cannot find the %s binary required for stripping unneeded symbols from binaries and libraries.")" "strip" + ret=1 + fi + fi + + # gzip - compressig man and info pages + if [[ $(check_option zipman) = "y" ]]; then + if ! type -p gzip >/dev/null; then + error "$(gettext "Cannot find the %s binary required for compressing man and info pages.")" "gzip" + ret=1 + fi + fi + return $ret } -- 1.7.5.4
On Thu, Jun 23, 2011 at 12:02 AM, Eric Bélanger <snowmaniscool@gmail.com> wrote:
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> ---
I thought about adding checks for the PKGEXT and SRCEXT compression utilities but I'm not sure as it might be overkill. Anyway, they could always be added later on in another patch. BTW, I didn't test this patch as it seemed quite straightforward.
I forgot to mention it but this patch changes a bit how makepkg use distcc and ccache. Currently, if the distcc or ccache options are used and they are not installed, makepkg simply doesn't enable the support and build the package like normal. However, with this patch, makepkg will aborts. To keep current behavoir, the error message for distcc and ccache will need to be replaced by a warning message.
On Wed, Jun 22, 2011 at 11:48 PM, Eric Bélanger <snowmaniscool@gmail.com> wrote:
On Thu, Jun 23, 2011 at 12:02 AM, Eric Bélanger <snowmaniscool@gmail.com> wrote:
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> ---
I thought about adding checks for the PKGEXT and SRCEXT compression utilities but I'm not sure as it might be overkill. Anyway, they could always be added later on in another patch. BTW, I didn't test this patch as it seemed quite straightforward.
I forgot to mention it but this patch changes a bit how makepkg use distcc and ccache. Currently, if the distcc or ccache options are used and they are not installed, makepkg simply doesn't enable the support and build the package like normal. However, with this patch, makepkg will aborts. To keep current behavoir, the error message for distcc and ccache will need to be replaced by a warning message.
This seems fine to me. Allan, thoughts? The only other thing I could think of doing is fail if set in BUILDENV and not available, but don't fail if specified in PKGBUILD options. -Dan
participants (2)
-
Dan McGee
-
Eric Bélanger