From dde1fa0734f3f547953fa3a03a6a93fe63f23323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Zoder?= Date: Mon, 18 Feb 2019 10:15:12 +0100 Subject: [PATCH] images: Restore documentation removed from the base Fedora images https://github.com/debarshiray/toolbox/pull/55 --- gen-docs-list | 80 ++++++++++++++++++++++++++++++++++ images/fedora/f28/Dockerfile | 4 ++ images/fedora/f28/missing-docs | 22 ++++++++++ images/fedora/f29/Dockerfile | 4 ++ images/fedora/f29/missing-docs | 20 +++++++++ images/fedora/f30/Dockerfile | 4 ++ images/fedora/f30/missing-docs | 18 ++++++++ images/fedora/f31/Dockerfile | 4 ++ images/fedora/f31/missing-docs | 18 ++++++++ 9 files changed, 174 insertions(+) create mode 100755 gen-docs-list create mode 100644 images/fedora/f28/missing-docs create mode 100644 images/fedora/f29/missing-docs create mode 100644 images/fedora/f30/missing-docs create mode 100644 images/fedora/f31/missing-docs diff --git a/gen-docs-list b/gen-docs-list new file mode 100755 index 0000000..1e30944 --- /dev/null +++ b/gen-docs-list @@ -0,0 +1,80 @@ +#!/bin/sh +# +# Copyright © 2019 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +collect() +( + if $1; then + postfix="_toolbox" + else + postfix="" + fi + + manpages_list="" + for dir in /usr/share/man/man*/ ; do + for docs in $dir*; do + package=$(rpm -qf $docs --qf "%{NAME}\n") + if ! [[ $package = *"is not owned by any"* ]]; then + manpages_list="$manpages_list$package\n" + fi + done + done + + mkdir -p tmp + echo -e "$manpages_list" | sort | uniq > tmp/docs_list$postfix + rpm -qa --qf "%{NAME}\n" | sort | uniq > tmp/rpm_list$postfix +) + + +generate() +( + diff -c tmp/rpm_list_toolbox tmp/rpm_list | grep -E "^\+" | tr -d '+ ' > tmp/missing_packages + diff -c tmp/docs_list_toolbox tmp/docs_list | grep -E "^\+" | tr -d '+ ' > tmp/missing_manpages + manpages_list=$(comm -1 -3 tmp/missing_packages tmp/missing_manpages) + manpages_final="" + while read -r line; do + if [ "$(man $line)" != "" ]; then + manpages_final="$manpages_final$line\n" + fi + done <<< "$manpages_list" + echo -e "$manpages_final" >> missing-docs +) + + +case $1 in + collect ) + shift + toolbox=false + case $1 in + -t | --toolbox ) + toolbox=true + ;; + esac + collect "$toolbox" + exit + ;; + generate ) + generate + exit + ;; + clean ) + rm -rf tmp + exit + ;; + * ) + exit 1 +esac \ No newline at end of file diff --git a/images/fedora/f28/Dockerfile b/images/fedora/f28/Dockerfile index 1a11f26..f142b89 100644 --- a/images/fedora/f28/Dockerfile +++ b/images/fedora/f28/Dockerfile @@ -13,6 +13,10 @@ COPY README.md / RUN sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf RUN dnf -y swap coreutils-single coreutils-full +COPY missing-docs / +RUN dnf -y reinstall $(