From 154156d86036624f7380c1e4c9a250158c2d0321 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 31 Oct 2023 18:02:44 +0100 Subject: [PATCH] images/fedora: Ensure that documentation and translations are present This should finally ensure that the fedora-toolbox image doesn't have any package that had its content, such as documentation or translations, stripped out by the fedora base image. Until now, missing-docs had a hand-maintained list of packages that had their content stripped out by the fedora base image. These packages are reinstalled when building the fedora-toolbox image to restore the lost content. Unfortunately, this list was incomplete because it was only updated when someone noticed that something is missing. Now, the list is generated with: $ rpm --all --query --state --queryformat "PACKAGE: %{NAME}\n" ... to ensure that it's always complete. The existing built-in test to ensure that the desired files are actually present in the final image was extended to cover some of those that were absent. A new built-in test, based on the above rpm(1) command, was added as a fallback to ensure that the final image doesn't have any package with missing content. Only the images for currently maintained Fedoras (ie., 37, 38 and 39) were updated. As suggested by Brian Campbell. https://github.com/containers/toolbox/issues/603 --- images/fedora/f37/Containerfile | 10 +++++ images/fedora/f37/ensure-files | 13 ++++++ images/fedora/f37/missing-docs | 70 +++++++++++++++++++++++++++++++++ images/fedora/f38/Containerfile | 10 +++++ images/fedora/f38/ensure-files | 13 ++++++ images/fedora/f38/missing-docs | 70 +++++++++++++++++++++++++++++++++ images/fedora/f39/Containerfile | 10 +++++ images/fedora/f39/ensure-files | 13 ++++++ images/fedora/f39/missing-docs | 69 ++++++++++++++++++++++++++++++++ 9 files changed, 278 insertions(+) diff --git a/images/fedora/f37/Containerfile b/images/fedora/f37/Containerfile index a58be5b..f7c57bd 100644 --- a/images/fedora/f37/Containerfile +++ b/images/fedora/f37/Containerfile @@ -41,4 +41,14 @@ RUN ret_val=0; \ fi RUN rm /ensure-files +RUN broken_packages="$(rpm --all --query --state --queryformat "PACKAGE: %{NAME}\n" \ + | sed --quiet --regexp-extended '/PACKAGE: /{s/PACKAGE: // ; h ; b }; /^not installed/ { g; p }' \ + | uniq \ + | sort)"; \ + if [ "$broken_packages" != "" ]; then \ + echo "Packages with missing files:" >&2; \ + echo "$broken_packages" >&2; \ + false; \ + fi + RUN dnf clean all diff --git a/images/fedora/f37/ensure-files b/images/fedora/f37/ensure-files index a9a5425..b9227a9 100644 --- a/images/fedora/f37/ensure-files +++ b/images/fedora/f37/ensure-files @@ -6,13 +6,26 @@ /usr/share/man/man1/cp.1* /usr/share/man/man1/ls.1* +/usr/share/man/man8/dnf.8* +/usr/share/man/man5/dnf.conf.5* + +/usr/share/locale/de/LC_MESSAGES/elfutils.mo +/usr/share/locale/ja/LC_MESSAGES/elfutils.mo + /usr/share/man/man1/gpg2.1* /usr/share/man/man7/gnupg2.7* +/usr/share/info/nettle.info* + +/usr/share/locale/fr/LC_MESSAGES/popt.mo +/usr/share/locale/ja/LC_MESSAGES/popt.mo + /usr/share/man/fr/man1/pstree.1* /usr/share/man/ru/man1/pstree.1* /usr/share/man/man1/pstree.1* +/usr/share/info/history.info* + /usr/share/man/fr/man8/rpm.8* /usr/share/man/ja/man8/rpm.8* /usr/share/man/man8/rpm.8* diff --git a/images/fedora/f37/missing-docs b/images/fedora/f37/missing-docs index 887d9ba..f7b041b 100644 --- a/images/fedora/f37/missing-docs +++ b/images/fedora/f37/missing-docs @@ -1,21 +1,91 @@ acl +alternatives +audit-libs +authselect +authselect-libs bash +ca-certificates coreutils-common +cracklib +crypto-policies curl +cyrus-sasl-lib +dnf +dnf-data +elfutils-libelf +expat +file-libs +filesystem findutils gawk +glib2 +gmp gnupg2 +gnutls +gpgme grep gzip +ima-evm-utils +keyutils-libs +krb5-libs +libarchive +libassuan +libblkid libcap +libcap-ng +libdb +libdnf +libeconf +libevent +libffi +libgcrypt +libgomp +libgpg-error +libidn2 +libksba +libmodulemd +libpwquality +librepo +libsemanage +libsigsegv +libsolv +libssh +libtasn1 +libtirpc +libunistring +libverto +libxcrypt +libxml2 +libyaml +lz4-libs +mpfr +ncurses-base +nettle +openldap openssl p11-kit pam +pcre +pcre2-syntax +popt python3 +python3-gpg +python3-libs +python3-rpm +readline rpm sed +setup shadow-utils +sqlite-libs sudo systemd +systemd-libs tar +tpm2-tss +tzdata util-linux-core +vim-minimal +yum +zchunk-libs +zlib diff --git a/images/fedora/f38/Containerfile b/images/fedora/f38/Containerfile index f99e2dc..51b2bc5 100644 --- a/images/fedora/f38/Containerfile +++ b/images/fedora/f38/Containerfile @@ -41,4 +41,14 @@ RUN ret_val=0; \ fi RUN rm /ensure-files +RUN broken_packages="$(rpm --all --query --state --queryformat "PACKAGE: %{NAME}\n" \ + | sed --quiet --regexp-extended '/PACKAGE: /{s/PACKAGE: // ; h ; b }; /^not installed/ { g; p }' \ + | uniq \ + | sort)"; \ + if [ "$broken_packages" != "" ]; then \ + echo "Packages with missing files:" >&2; \ + echo "$broken_packages" >&2; \ + false; \ + fi + RUN dnf clean all diff --git a/images/fedora/f38/ensure-files b/images/fedora/f38/ensure-files index 411f436..f1bdcf6 100644 --- a/images/fedora/f38/ensure-files +++ b/images/fedora/f38/ensure-files @@ -6,13 +6,26 @@ /usr/share/man/man1/cp.1* /usr/share/man/man1/ls.1* +/usr/share/man/man8/dnf.8* +/usr/share/man/man5/dnf.conf.5* + +/usr/share/locale/de/LC_MESSAGES/elfutils.mo +/usr/share/locale/ja/LC_MESSAGES/elfutils.mo + /usr/share/man/man1/gpg2.1* /usr/share/man/man7/gnupg2.7* +/usr/share/info/nettle.info* + +/usr/share/locale/fr/LC_MESSAGES/popt.mo +/usr/share/locale/ja/LC_MESSAGES/popt.mo + /usr/share/man/fr/man1/pstree.1* /usr/share/man/ko/man1/pstree.1* /usr/share/man/man1/pstree.1* +/usr/share/info/history.info* + /usr/share/man/fr/man8/rpm.8* /usr/share/man/ja/man8/rpm.8* /usr/share/man/man8/rpm.8* diff --git a/images/fedora/f38/missing-docs b/images/fedora/f38/missing-docs index 887d9ba..e1c7763 100644 --- a/images/fedora/f38/missing-docs +++ b/images/fedora/f38/missing-docs @@ -1,21 +1,91 @@ acl +alternatives +audit-libs +authselect +authselect-libs bash +ca-certificates coreutils-common +cracklib +crypto-policies curl +cyrus-sasl-lib +dnf +dnf-data +elfutils-libelf +expat +file-libs +filesystem findutils gawk +glib2 +gmp gnupg2 +gnutls +gpgme grep gzip +ima-evm-utils +keyutils-libs +krb5-libs +libarchive +libassuan +libblkid libcap +libcap-ng +libdb +libdnf +libeconf +libevent +libffi +libgcrypt +libgomp +libgpg-error +libidn2 +libksba +libmodulemd +libpwquality +librepo +libsemanage +libsigsegv +libsolv +libssh +libtasn1 +libtirpc +libunistring +libunistring1.0 +libverto +libxcrypt +libxml2 +libyaml +lz4-libs +mpfr +ncurses-base +nettle +openldap openssl p11-kit pam +pcre2-syntax +popt python3 +python3-libs +python3-rpm +readline rpm +rpm-sequoia sed +setup shadow-utils +sqlite-libs sudo systemd +systemd-libs tar +tpm2-tss +tzdata util-linux-core +vim-minimal +yum +zchunk-libs +zlib diff --git a/images/fedora/f39/Containerfile b/images/fedora/f39/Containerfile index b4d45b3..771edc2 100644 --- a/images/fedora/f39/Containerfile +++ b/images/fedora/f39/Containerfile @@ -41,4 +41,14 @@ RUN ret_val=0; \ fi RUN rm /ensure-files +RUN broken_packages="$(rpm --all --query --state --queryformat "PACKAGE: %{NAME}\n" \ + | sed --quiet --regexp-extended '/PACKAGE: /{s/PACKAGE: // ; h ; b }; /^not installed/ { g; p }' \ + | uniq \ + | sort)"; \ + if [ "$broken_packages" != "" ]; then \ + echo "Packages with missing files:" >&2; \ + echo "$broken_packages" >&2; \ + false; \ + fi + RUN dnf clean all diff --git a/images/fedora/f39/ensure-files b/images/fedora/f39/ensure-files index 69457a5..1e39f69 100644 --- a/images/fedora/f39/ensure-files +++ b/images/fedora/f39/ensure-files @@ -6,13 +6,26 @@ /usr/share/man/man1/cp.1* /usr/share/man/man1/ls.1* +/usr/share/man/man8/dnf.8* +/usr/share/man/man5/dnf.conf.5* + +/usr/share/locale/de/LC_MESSAGES/elfutils.mo +/usr/share/locale/ja/LC_MESSAGES/elfutils.mo + /usr/share/man/man1/gpg2.1* /usr/share/man/man7/gnupg2.7* +/usr/share/info/nettle.info* + +/usr/share/locale/fr/LC_MESSAGES/popt.mo +/usr/share/locale/ja/LC_MESSAGES/popt.mo + /usr/share/man/fr/man1/pstree.1* /usr/share/man/ko/man1/pstree.1* /usr/share/man/man1/pstree.1* +/usr/share/info/history.info* + /usr/share/man/man8/rpm.8* /usr/share/man/man8/rpm2cpio.8* diff --git a/images/fedora/f39/missing-docs b/images/fedora/f39/missing-docs index 887d9ba..98f1395 100644 --- a/images/fedora/f39/missing-docs +++ b/images/fedora/f39/missing-docs @@ -1,21 +1,90 @@ acl +alternatives +audit-libs +authselect +authselect-libs bash +ca-certificates coreutils-common +cracklib +crypto-policies curl +cyrus-sasl-lib +dnf +dnf-data +elfutils-libelf +expat +file-libs +filesystem findutils gawk +glib2 +gmp gnupg2 +gnutls grep gzip +ima-evm-utils +keyutils-libs +krb5-libs +libarchive +libassuan +libblkid libcap +libcap-ng +libcomps +libdb +libdnf +libeconf +libevent +libffi +libgcrypt +libgomp +libgpg-error +libidn2 +libksba +libmodulemd +libpwquality +librepo +libsemanage +libsigsegv +libsolv +libssh +libtasn1 +libtirpc +libunistring +libverto +libxcrypt +libxml2 +libyaml +lz4-libs +mpfr +ncurses-base +nettle +openldap openssl p11-kit pam +pcre2-syntax +popt python3 +python3-libs +python3-rpm +readline rpm +rpm-sequoia sed +setup shadow-utils +sqlite-libs sudo systemd +systemd-libs tar +tpm2-tss +tzdata util-linux-core +vim-minimal +yum +zchunk-libs +zlib