Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Zac Medico
On 08/09/2018 02:13 AM, Michał Górny wrote:
> W dniu czw, 09.08.2018 o godzinie 11∶09 +0200, użytkownik Ulrich Mueller
> napisał:
>>> On Thu, 09 Aug 2018, Michał Górny wrote:
 +  if xargs --help | grep -q -- --max-procs=; then
>>> '--help' is not a valid argument on FreeBSD, so this spews errors
>>> to stderr:
>>
>> IIRC, GNU findutils is required by PMS?
>>
> 
> Yes, using gxargs is another option.  I suppose the usual ebuild env
> override is not used in this phase.

The 'alias xargs=gxargs' from profiles/default/bsd/fbsd/profile.bashrc
is ineffective because it doesn't apply to the XARGS variable that
portage defines in isolated-functions.sh:

case ${USERLAND} in
BSD)
export XARGS="xargs"
;;
*)
export XARGS="xargs -r"
;;
esac

I guess it should simply use gxargs if available. However, I don't see
anything in PMS about the 'g' prefix, though I do see this in the
findutils ebuilds:

  program_prefix=$(usex userland_GNU '' g)
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Michał Górny
W dniu czw, 09.08.2018 o godzinie 11∶09 +0200, użytkownik Ulrich Mueller
napisał:
> > > > > > On Thu, 09 Aug 2018, Michał Górny wrote:
> > > + if xargs --help | grep -q -- --max-procs=; then
> > '--help' is not a valid argument on FreeBSD, so this spews errors
> > to stderr:
> 
> IIRC, GNU findutils is required by PMS?
> 

Yes, using gxargs is another option.  I suppose the usual ebuild env
override is not used in this phase.

-- 
Best regards,
Michał Górny


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Ulrich Mueller
> On Thu, 09 Aug 2018, Michał Górny wrote:

>> +if xargs --help | grep -q -- --max-procs=; then

> '--help' is not a valid argument on FreeBSD, so this spews errors
> to stderr:

IIRC, GNU findutils is required by PMS?

Ulrich



Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/60pngfix: parallel support (bug 630292)

2018-08-09 Thread Michał Górny
W dniu śro, 25.07.2018 o godzinie 12∶59 -0700, użytkownik Zac Medico
napisał:
> If xargs supports the --max-procs option then use the makeopts_jobs
> function from helper-functions.sh to generate a --max-procs argument.
> 
> Bug: https://bugs.gentoo.org/630292
> ---
>  bin/install-qa-check.d/60pngfix | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/bin/install-qa-check.d/60pngfix b/bin/install-qa-check.d/60pngfix
> index 8d53040b6..2bf020079 100644
> --- a/bin/install-qa-check.d/60pngfix
> +++ b/bin/install-qa-check.d/60pngfix
> @@ -1,7 +1,17 @@
>  # Check for issues with PNG files
>  
> +source "${PORTAGE_BIN_PATH}/helper-functions.sh" || exit 1
> +
>  pngfix_check() {
> - local pngfix=$(type -P pngfix)
> + local jobs pngfix=$(type -P pngfix) xargs=(${XARGS})
> +
> + if xargs --help | grep -q -- --max-procs=; then

'--help' is not a valid argument on FreeBSD, so this spews errors
to stderr:

 * Final size of build directory: 3655 KiB (3.5 MiB)
 * Final size of installed tree:24 KiB 

xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
 [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]
 [-s size] [utility [argument ...]]
strip: strip --strip-unneeded -R .comment -R .GCC.command.line -R 
.note.gnu.gold-version
   usr/lib/libgraphene-1.0.so.0.800.2

Also note that -P is more portable than --max-procs.

> + jobs=$(makeopts_jobs)
> + if [[ ${jobs} -gt 1 ]]; then
> + xargs+=(--max-procs=${jobs})
> + fi
> + fi
> +
>   if [[ -n ${pngfix} ]] ; then
>   local pngout=()
>   local next
> @@ -25,7 +35,7 @@ pngfix_check() {
>   fi
>   eqawarn "   ${pngout[@]:7}: ${error}"
>   fi
> - done < <(find "${ED}" -type f -name '*.png' -exec "${pngfix}" 
> {} +)
> + done < <(find "${ED}" -type f -name '*.png' -print0 | 
> "${xargs[@]}" -0 "${pngfix}")
>   fi
>  }
>  

-- 
Best regards,
Michał Górny


signature.asc
Description: This is a digitally signed message part