[elbe-devel] [PATCH 3/3] init/initvm: add --ignore-pinning option
Torben Hohn
torben.hohn at linutronix.de
Fri Sep 21 11:08:34 CEST 2018
On Fri, Sep 14, 2018 at 03:06:25PM +0200, Manuel Traut wrote:
> If cd2aptly was used to generate a single repository containing all
> packages, 'elbe init' needs to ignore the pinning (as done by
> rebuilding from cdrom). Therefore a new parameter is added, that is
> also enabled if --cdrom was given. Use this parameter in the makofile
> instead of the heuristics on the XML file.
the name confused the hell out of me.
we only ignore the release pinning. version pinning
will stay active.
looks good, besides the name maybe: ignore-release or something.
man pages are missing.
>
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> ---
> elbepack/commands/init.py | 8 ++++++++
> elbepack/commands/initvm.py | 4 ++++
> elbepack/init/preseed.cfg.mako | 2 +-
> elbepack/initvmaction.py | 3 +++
> 4 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index 140d9e18..1fcd72dc 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -45,6 +45,13 @@ def run_command(argv):
> help="Use FILE as cdrom iso, and use that to build the initvm",
> metavar="FILE")
>
> + oparser.add_option(
> + "--ignore-pinning",
> + action="store_true",
> + dest="ignore_pinning",
> + default=False,
> + help="ignore pinning (this is automatically set if --cdrom is given")
> +
> oparser.add_option("--proxy", dest="proxy",
> help="Override the http Proxy")
>
> @@ -126,6 +133,7 @@ def run_command(argv):
> mirror.clear()
> cdrom = mirror.ensure_child("cdrom")
> cdrom.set_text(os.path.abspath(opt.cdrom))
> + opt.ignore_pinning = True
>
> if not opt.directory:
> path = "./build"
> diff --git a/elbepack/commands/initvm.py b/elbepack/commands/initvm.py
> index c85d8a79..c436be3b 100644
> --- a/elbepack/commands/initvm.py
> +++ b/elbepack/commands/initvm.py
> @@ -25,6 +25,10 @@ def run_command(argv):
> oparser.add_option("--cdrom", dest="cdrom", default=None,
> help="iso image of Binary cdrom")
>
> + oparser.add_option("--ignore-pinning", dest="ignore_pinning",
> + action="store_true", default=False,
> + help="ignore pinning that might be used in the XML")
> +
> oparser.add_option(
> "--devel",
> action="store_true",
> diff --git a/elbepack/init/preseed.cfg.mako b/elbepack/init/preseed.cfg.mako
> index 052be882..f13b107b 100644
> --- a/elbepack/init/preseed.cfg.mako
> +++ b/elbepack/init/preseed.cfg.mako
> @@ -126,7 +126,7 @@ apt-mirror-setup apt-setup/use_mirror boolean false
>
> # for a cdrom build, the pkgrel is reset to None because the
> # cdrom does not have the release information anymore
> - if not prj.has("mirror/primary_host") and prj.node("mirror/cdrom"):
> + if opt.ignore_pinning:
> pkgrel = None
>
> if pkgrel is None:
> diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
> index f7526cb6..9da1e724 100644
> --- a/elbepack/initvmaction.py
> +++ b/elbepack/initvmaction.py
> @@ -502,6 +502,9 @@ class CreateAction(InitVMAction):
> if opt.nesting:
> init_opts += ' --nesting'
>
> + if opt.ignore_pinning:
> + init_opts += ' --ignore-pinning'
> +
> if cdrom:
> system('%s init %s --directory "%s" --cdrom "%s" "%s"' %
> (elbe_exe, init_opts, initvmdir, cdrom, xmlfile))
> --
> 2.19.0.rc2
>
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180921/b12a50b8/attachment.sig>
More information about the elbe-devel
mailing list