From d16e5dd7d023261c3ec1cc93641e2a7f48ed39c4 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 2 Feb 2022 15:41:50 -0500 Subject: [PATCH] Check for docker manpage existence in %post The post install script should check for prior Dockerfile and dockerignore manpages on the system before creating them and not depend on the existence of /usr/bin/docker or the lack of it. Signed-off-by: Lokesh Mandvekar --- containers-common.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/containers-common.spec b/containers-common.spec index 5615cb2..942c044 100644 --- a/containers-common.spec +++ b/containers-common.spec @@ -128,11 +128,17 @@ ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo %post -if [[ ! -f %{_bindir}/docker ]]; then +if [[ ! -f %{_mandir}/man5/Dockerfile.5.gz ]]; then echo .so %{_mandir}/man5/Containerfile.5 > %{_mandir}/man5/Dockerfile.5 - echo .so %{_mandir}/man5/containerignore.5 > %{_mandir}/man5/.dockerignore.5 + gzip %{_mandir}/man5/Dockerfile.5 +fi +if [[ ! -f %{_mandir}/man5/dockerignore.5.gz ]]; then echo .so %{_mandir}/man5/containerignore.5 > %{_mandir}/man5/dockerignore.5 - gzip %{_mandir}/man5/{Dockerfile,.dockerignore,dockerignore}.5 + gzip %{_mandir}/man5/dockerignore.5 +fi +if [[ ! -f %{_mandir}/man5/.dockerignore.5.gz ]]; then + echo .so %{_mandir}/man5/containerignore.5 > %{_mandir}/man5/.dockerignore.5 + gzip %{_mandir}/man5/.dockerignore.5 fi %files