[elbe-devel] [PATCH 1/1] cdroms: do not fail without /var/cache/elbe/initvm-bin-repo
Torben Hohn
torben.hohn at linutronix.de
Wed Nov 28 15:07:59 CET 2018
Sorry, but this patch is wrong.
V2 coming up.
On Wed, Nov 28, 2018 at 01:38:08PM +0100, Torben Hohn wrote:
> when /var/cache/elbe/initvm-bin-repo has not been generated
> by "elbe fetch_initvm_pkgs" during initvm installation,
> the copying would fail.
>
> ----------------------------------------------------------------------------------------------------------------------------
> running cmd +cp -av /var/cache/elbe/initvm-bin-repo "/var/cache/elbe/ae76f5ae-a300-43a9-bed6-a76387b5d255/binrepo"+
> ------------------------------------------------------------------------------
> cp: cannot stat '/var/cache/elbe/initvm-bin-repo': No such file or directory
> ------------------------------------------------------------------------------
>
> Command failed with errorcode 1
> Build failed
> Traceback (most recent call last):
> File "/var/cache/elbe/devel/elbepack/asyncworker.py", line 158, in execute
> skip_pbuild=self.skip_pbuilder)
> File "/var/cache/elbe/devel/elbepack/elbeproject.py", line 572, in build
> self.build_cdroms(build_bin, build_sources, cdrom_size)
> File "/var/cache/elbe/devel/elbepack/elbeproject.py", line 395, in build_cdroms
> cdrom_size=cdrom_size)
> File "/var/cache/elbe/devel/elbepack/cdroms.py", line 134, in mk_binary_cdrom
> log.do('cp -av /var/cache/elbe/initvm-bin-repo "%s"' % repo_path)
> File "/var/cache/elbe/devel/elbepack/asciidoclog.py", line 62, in do
> raise CommandError(cmd, ret)
> CommandError
>
>
> Exception:
> ----------------------------------------------------------------------------------------------------------------------------
>
> This error is not fatal. This only means, that the generated bin-cdrom.iso
> does not allow building an initvm from it.
>
> Log an Error and continue with an empty directory, when that happens.
> ---
> elbepack/cdroms.py | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/elbepack/cdroms.py b/elbepack/cdroms.py
> index 3c1bd6dc..aa67bdaf 100644
> --- a/elbepack/cdroms.py
> +++ b/elbepack/cdroms.py
> @@ -16,6 +16,7 @@ from elbepack.repomanager import CdromBinRepo
> from elbepack.repomanager import CdromInitRepo
> from elbepack.aptpkgutils import XMLPackage
> from elbepack.filesystem import Filesystem, hostfs
> +from elbepack.shellhelper import CommandError
>
> CDROM_SIZE = 640 * 1000 * 1000
>
> @@ -131,7 +132,16 @@ def mk_binary_cdrom(
> # initvm repo has been built upon initvm creation
> # just copy it. the repo __init__() afterwards will
> # not touch the repo config, nor generate a new key.
> - log.do('cp -av /var/cache/elbe/initvm-bin-repo "%s"' % repo_path)
> + try:
> + log.do('cp -av /var/cache/elbe/initvm-bin-repo "%s"' % repo_path)
> + except CommandError:
> + # When /var/cache/elbe/initvm-bin-repo has not been created
> + # (because the initvm install was an old version or somthing,
> + # log an error, and continue with an empty directory.
> + log.printo('ERROR: /var/cache/elbe/initvm-bin-repo does not exist')
> + log.printo(' The generated CDROM will not contain initvm pkgs')
> + log.do('mkdir -p "%s"' % repo_path)
> +
> repo = CdromInitRepo(init_codename, repo_path, log, cdrom_size, mirror)
>
> target_repo = CdromBinRepo(arch, codename, None,
> --
> 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
-------------- 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/20181128/439f8e0d/attachment.sig>
More information about the elbe-devel
mailing list