From d0ecd4b7313e9bc6b00d9a4fe62ad5787bc197ae Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 8 Jan 2024 17:08:11 -0800 Subject: [PATCH] Cleanup comments and remove unnecessary conditional Also, switch to using `set -eux` + `;` chains consistently (no more `&&`). --- Dockerfile-scm.template | 9 ++++++--- Dockerfile.template | 11 +---------- debian/bookworm/Dockerfile | 11 +---------- debian/bookworm/scm/Dockerfile | 9 ++++++--- debian/bullseye/Dockerfile | 11 +---------- debian/bullseye/scm/Dockerfile | 9 ++++++--- debian/buster/Dockerfile | 11 +---------- debian/buster/scm/Dockerfile | 9 ++++++--- debian/sid/Dockerfile | 11 +---------- debian/sid/scm/Dockerfile | 9 ++++++--- debian/trixie/Dockerfile | 11 +---------- debian/trixie/scm/Dockerfile | 9 ++++++--- ubuntu/focal/Dockerfile | 11 +---------- ubuntu/focal/scm/Dockerfile | 9 ++++++--- ubuntu/jammy/Dockerfile | 11 +---------- ubuntu/jammy/scm/Dockerfile | 9 ++++++--- ubuntu/lunar/Dockerfile | 11 +---------- ubuntu/lunar/scm/Dockerfile | 9 ++++++--- ubuntu/mantic/Dockerfile | 11 +---------- ubuntu/mantic/scm/Dockerfile | 9 ++++++--- ubuntu/noble/Dockerfile | 11 +---------- ubuntu/noble/scm/Dockerfile | 9 ++++++--- 22 files changed, 77 insertions(+), 143 deletions(-) diff --git a/Dockerfile-scm.template b/Dockerfile-scm.template index a3161f04..708c8fbc 100644 --- a/Dockerfile-scm.template +++ b/Dockerfile-scm.template @@ -1,7 +1,8 @@ FROM buildpack-deps:{{ env.codename }}-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ {{ if [ "focal", "groovy" @@ -14,5 +15,7 @@ if [ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.template b/Dockerfile.template index 0e5c34f4..ef2cdeb8 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -6,6 +6,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -43,15 +44,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/bookworm/Dockerfile b/debian/bookworm/Dockerfile index 718d58a6..7e952410 100644 --- a/debian/bookworm/Dockerfile +++ b/debian/bookworm/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/bookworm/scm/Dockerfile b/debian/bookworm/scm/Dockerfile index cea1525e..6e202769 100644 --- a/debian/bookworm/scm/Dockerfile +++ b/debian/bookworm/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:bookworm-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/debian/bullseye/Dockerfile b/debian/bullseye/Dockerfile index 61f21054..3f92317c 100644 --- a/debian/bullseye/Dockerfile +++ b/debian/bullseye/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/bullseye/scm/Dockerfile b/debian/bullseye/scm/Dockerfile index 0710bf20..8044a85f 100644 --- a/debian/bullseye/scm/Dockerfile +++ b/debian/bullseye/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:bullseye-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/debian/buster/Dockerfile b/debian/buster/Dockerfile index 7a26fc91..7f6ea0e0 100644 --- a/debian/buster/Dockerfile +++ b/debian/buster/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/buster/scm/Dockerfile b/debian/buster/scm/Dockerfile index 878c5c1c..43eccdba 100644 --- a/debian/buster/scm/Dockerfile +++ b/debian/buster/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:buster-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/debian/sid/Dockerfile b/debian/sid/Dockerfile index 3728012c..b28b53ad 100644 --- a/debian/sid/Dockerfile +++ b/debian/sid/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/sid/scm/Dockerfile b/debian/sid/scm/Dockerfile index 9a512a5b..7f6f0ed0 100644 --- a/debian/sid/scm/Dockerfile +++ b/debian/sid/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:sid-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/debian/trixie/Dockerfile b/debian/trixie/Dockerfile index 9af772e0..b579eb04 100644 --- a/debian/trixie/Dockerfile +++ b/debian/trixie/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/debian/trixie/scm/Dockerfile b/debian/trixie/scm/Dockerfile index 0983cce7..3f829368 100644 --- a/debian/trixie/scm/Dockerfile +++ b/debian/trixie/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:trixie-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/focal/Dockerfile b/ubuntu/focal/Dockerfile index 31e2b4af..32043a56 100644 --- a/ubuntu/focal/Dockerfile +++ b/ubuntu/focal/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/focal/scm/Dockerfile b/ubuntu/focal/scm/Dockerfile index 42d5952e..9c0de0dc 100644 --- a/ubuntu/focal/scm/Dockerfile +++ b/ubuntu/focal/scm/Dockerfile @@ -6,13 +6,16 @@ FROM buildpack-deps:focal-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ bzr \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/jammy/Dockerfile b/ubuntu/jammy/Dockerfile index 7e5f447c..d31b7fe8 100644 --- a/ubuntu/jammy/Dockerfile +++ b/ubuntu/jammy/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/jammy/scm/Dockerfile b/ubuntu/jammy/scm/Dockerfile index e1fc3246..ce120573 100644 --- a/ubuntu/jammy/scm/Dockerfile +++ b/ubuntu/jammy/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:jammy-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/lunar/Dockerfile b/ubuntu/lunar/Dockerfile index 6e8ad471..5113091e 100644 --- a/ubuntu/lunar/Dockerfile +++ b/ubuntu/lunar/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/lunar/scm/Dockerfile b/ubuntu/lunar/scm/Dockerfile index 5ba8e8dd..6ad7b7e1 100644 --- a/ubuntu/lunar/scm/Dockerfile +++ b/ubuntu/lunar/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:lunar-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/mantic/Dockerfile b/ubuntu/mantic/Dockerfile index 51df1a80..da7dcefb 100644 --- a/ubuntu/mantic/Dockerfile +++ b/ubuntu/mantic/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/mantic/scm/Dockerfile b/ubuntu/mantic/scm/Dockerfile index 57892913..24d7a22e 100644 --- a/ubuntu/mantic/scm/Dockerfile +++ b/ubuntu/mantic/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:mantic-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/noble/Dockerfile b/ubuntu/noble/Dockerfile index 77d82cff..4d69db6e 100644 --- a/ubuntu/noble/Dockerfile +++ b/ubuntu/noble/Dockerfile @@ -12,6 +12,7 @@ RUN set -ex; \ autoconf \ automake \ bzip2 \ + default-libmysqlclient-dev \ dpkg-dev \ file \ g++ \ @@ -49,15 +50,5 @@ RUN set -ex; \ unzip \ xz-utils \ zlib1g-dev \ - \ -# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html - $( \ -# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep - if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ - echo 'default-libmysqlclient-dev'; \ - else \ - echo 'libmysqlclient-dev'; \ - fi \ - ) \ ; \ rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/noble/scm/Dockerfile b/ubuntu/noble/scm/Dockerfile index 4b19e700..6fa085c0 100644 --- a/ubuntu/noble/scm/Dockerfile +++ b/ubuntu/noble/scm/Dockerfile @@ -6,12 +6,15 @@ FROM buildpack-deps:noble-curl -# procps is very common in build systems, and is a reasonably small package -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ git \ mercurial \ openssh-client \ subversion \ \ +# procps is very common in build systems, and is a reasonably small package procps \ - && rm -rf /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/*