Skip to content

Commit

Permalink
dodoc: Skip a file if a compressed version already exists
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrfranke authored and jon-turney committed Apr 29, 2024
1 parent 4edc8a4 commit 7eb4cfc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/src_install.cygpart
Original file line number Diff line number Diff line change
Expand Up @@ -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 e f i x

case "${_docinto_dir}" in
'') docdir=/usr/share/doc/${PN} ;;
Expand All @@ -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
Expand Down

0 comments on commit 7eb4cfc

Please sign in to comment.