commit:     d71cc8025960c1676a42ecc7f5efdc8252c8923b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 29 17:59:50 2020 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 29 17:59:50 2020 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d71cc802

bin/gen-eclass-html.sh: Prevent removal of dirs.

Updating a file doesn't change the modification time of its directory,
therefore scanning for "old directories" produced false positives.
Work around the problem by touching the directory.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/gen-eclass-html.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh
index fc37f03..efa7f12 100755
--- a/bin/gen-eclass-html.sh
+++ b/bin/gen-eclass-html.sh
@@ -102,6 +102,8 @@ for i in $(/usr/bin/qlist eclass-manpages) 
/usr/share/man/man5/ebuild.5*; do
        FINAL="${DIRNAME}/index.html"
        DECOMPRESS=$(guesscompress "${i}")
        [[ -d ${DIRNAME} ]] || mkdir -p ${DIRNAME}
+       # update the dir's mtime to prevent its removal below
+       touch ${DIRNAME}
        # rebuild the man page each time
        echo -n "${HEADER//@TITLE@/${BASENAME}}" > "${FINAL}"
        # generate html pages and fix hyperlinks for eclass and ebuild man pages

Reply via email to