]> cygwin.com Git - cygwin-apps/cygport.git/commitdiff
dodoc: Skip a file if a compressed version already exists
authorChristian Franke <christian.franke@t-online.de>
Fri, 1 Mar 2024 12:56:45 +0000 (13:56 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Mon, 29 Apr 2024 19:31:57 +0000 (20:31 +0100)
This prevents __prepdoc() (run by default during postinstall unless
RESTRICT=postinst-doc) from also adding the uncompressed version of a
default doc file, if src_install() already explicitly installed a
compressed version.

lib/src_install.cygpart

index 182104889530cb92716cfea86caddc0fdc51444e..7aca673c9047c67c428629fabc80f7fc82ddd04b 100644 (file)
@@ -163,10 +163,11 @@ docinto() {
 #  Installs the given files or directories into $D/usr/share/doc/PN/, or a
 #  subdirectory thereof specified by the previous call to docinto.
 #  If a FILE does not exist, FILE.md, FILE.rst and FILE.txt are also
-#  considered.
+#  considered.  A FILE is skipped if the destination file or a compressed
+#  version (.bz2, .gz, .xz, .zstd) of it already exists.
 #****
 dodoc() {
-       local docdir d f i x
+       local docdir d f i x
 
        case "${_docinto_dir}" in
                '')     docdir=/usr/share/doc/${PN} ;;
@@ -193,6 +194,10 @@ dodoc() {
                        do
                                if [ -s "${i}${x}" -a ! -f "${D}${docdir}/${i}${x}" ]
                                then
+                                       for e in bz2 gz xz zst
+                                       do
+                                               ! [ -f "${D}${docdir}/${i}${x}.${e}" ] || continue 2
+                                       done
                                        __doinstall 0644 "${i}${x}" ${docdir} || error "dodoc ${i} failed"
                                        break
                                fi
This page took 0.056377 seconds and 5 git commands to generate.