[libvirt] [jenkins-ci PATCH v2 5/9] lcitool: force non-interactive apt-get frontend

Daniel P. Berrangé posted 9 patches 7 years ago
There is a newer version of this series
[libvirt] [jenkins-ci PATCH v2 5/9] lcitool: force non-interactive apt-get frontend
Posted by Daniel P. Berrangé 7 years ago
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 guests/lcitool | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 4fb0008..1d5cbd0 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -542,11 +542,14 @@ class Application:
 
         if package_format == "deb":
             sys.stdout.write(textwrap.dedent("""
-                RUN apt-get update && \\
-                    apt-get dist-upgrade -y && \\
-                    apt-get install -y ${PACKAGES} && \\
-                    apt-get autoremove -y && \\
-                    apt-get autoclean -y
+                RUN DEBIAN_FRONTEND=noninteractive && \\
+                    ( \\
+                        apt-get update && \\
+                        apt-get dist-upgrade -y && \\
+                        apt-get install -y ${PACKAGES} && \\
+                        apt-get autoremove -y && \\
+                        apt-get autoclean -y \\
+                    )
             """))
         elif package_format == "rpm":
             if os_name == "Fedora" and os_version == "Rawhide":
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH v2 5/9] lcitool: force non-interactive apt-get frontend
Posted by Andrea Bolognani 7 years ago
On Tue, 2019-02-05 at 17:53 +0000, Daniel P. Berrangé wrote:
[...]
>          if package_format == "deb":
>              sys.stdout.write(textwrap.dedent("""
> -                RUN apt-get update && \\
> -                    apt-get dist-upgrade -y && \\
> -                    apt-get install -y ${PACKAGES} && \\
> -                    apt-get autoremove -y && \\
> -                    apt-get autoclean -y
> +                RUN DEBIAN_FRONTEND=noninteractive && \\
> +                    ( \\
> +                        apt-get update && \\
> +                        apt-get dist-upgrade -y && \\
> +                        apt-get install -y ${PACKAGES} && \\
> +                        apt-get autoremove -y && \\
> +                        apt-get autoclean -y \\
> +                    )

Wouldn't

  RUN export DEBIAN_FRONTEND=noninteractive && \\
      apt-get update && \\
      ...

work as well, without requiring the extra indentation (and shell)?

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH v2 5/9] lcitool: force non-interactive apt-get frontend
Posted by Daniel P. Berrangé 6 years, 11 months ago
On Wed, Feb 06, 2019 at 05:21:36PM +0100, Andrea Bolognani wrote:
> On Tue, 2019-02-05 at 17:53 +0000, Daniel P. Berrangé wrote:
> [...]
> >          if package_format == "deb":
> >              sys.stdout.write(textwrap.dedent("""
> > -                RUN apt-get update && \\
> > -                    apt-get dist-upgrade -y && \\
> > -                    apt-get install -y ${PACKAGES} && \\
> > -                    apt-get autoremove -y && \\
> > -                    apt-get autoclean -y
> > +                RUN DEBIAN_FRONTEND=noninteractive && \\
> > +                    ( \\
> > +                        apt-get update && \\
> > +                        apt-get dist-upgrade -y && \\
> > +                        apt-get install -y ${PACKAGES} && \\
> > +                        apt-get autoremove -y && \\
> > +                        apt-get autoclean -y \\
> > +                    )
> 
> Wouldn't
> 
>   RUN export DEBIAN_FRONTEND=noninteractive && \\
>       apt-get update && \\
>       ...
> 
> work as well, without requiring the extra indentation (and shell)?

Oh, true, I could have done that

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list