[elbe-devel] [PATCH 1/1] Remove --force-check-gpg from DEBOOTSTRAPOPTS when <noauth>

Torben Hohn torben.hohn at linutronix.de
Wed Aug 7 11:21:17 CEST 2019


On Fri, Jul 19, 2019 at 03:41:46PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
> 
> Nasty behavior of pbuilder that add --force-check-gpg by default in
> the DEBOOTSTRAPOPTS env variable.
> 
> This should remove it no matter what when <noauth> is set.  It's very
> ugly, but the only way I know to remove an element in a bash array.
> 
> * NOTE
> 
>   pbuilder will _always_ read in that order:
> 
>   1. /etc/pbuildderrc
>   2. /usr/share/pbuilder/pbuilderrc
>   3. ~/.pbuildderrc
>   4. --configfile=file
> 
>   And when meant _always_, I mean there's no way to not read
>   /usr/share/pbuilder/pbuilderrc, even if we provide --configfile.
> 
>   As described by the man page:
>   --------------------------------------------------------------------
>   --configfile [configuration file to load]
>   Additional configuration file to read after all other
>   configuration files have been read.
>   --------------------------------------------------------------------
> 
>   Thus, we might have conflicts between the system wide configuration
>   and the local config file (e.g. this patch).  This is utterly
>   stupid.
> 
>   We should probably overwrite everything mentioned in pbuilderrc(5)
>   ourself in the project's pbuilderrc file to avoid any surprise in
>   the future.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>
> Tested-by: Yegor Yefremov <yegorslists at googlemail.com>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/pbuilder.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
> index b38136de..6bc2945f 100644
> --- a/elbepack/pbuilder.py
> +++ b/elbepack/pbuilder.py
> @@ -50,6 +50,7 @@ def pbuilder_write_config(builddir, xml, _log):
>      if xml.prj.has('noauth'):
>          fp.write(
>              'DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--no-check-gpg")\n')
> +        fp.write("""for i in "${!DEBOOTSTRAPOPTS[@]}"; do if [[ ${DEBOOTSTRAPOPTS[i]} == "--force-check-gpg" ]]; then unset 'DEBOOTSTRAPOPTS[i]'; break; fi done\n""")
>          fp.write('export ALLOWUNTRUSTED="yes"\n')
>  
>      # aptitude segfaults with armhf changeroots, great! :)
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list