On Wednesday, October 23, 2019 at 10:36:12 PM UTC+2, Baurzhan Ismagulov wrote:
On Wed, Oct 23, 2019 at 01:42:20PM +0200, Henning Schild wrote:
> Cosmetic and not functional. Let us not reinvet the wheel and possibly
> make mistakes.
...
> --- a/meta/classes/base-apt-helper.bbclass
> +++ b/meta/classes/base-apt-helper.bbclass
> @@ -26,7 +26,7 @@ populate_base_apt() {
>          # robust than querying reprepro by name.
>  
>          # Check if this package is taken from Isar-apt, if so - ingore it.
> -        base_name=${package##*/}
> +        base_name=$( basename "${package}")

I'm not in favor of this one. The suggested replacement spawns a subshell and
executes a binary, which is much more expensive than shell's builtin operation,
and that is executed in a loop. The current code is correct. The variable name
explains what it does.

there is a typo in the explanation by the way (ingore => ignore)
the parameter expansion appears to work OK with dash and bash
(we always need to be careful with bashisms, we seem to be OK here)


With kind regards,
Baurzhan.