[R-pkg-team] Bug#942469: r-cran-rmarkdown: directory to symlink conversion not correctly handled on upgrade

Andreas Beckmann anbe at debian.org
Mon Nov 25 23:25:25 GMT 2019


Followup-For: Bug #942469

Hi,

this bug is also reproducible in piuparts on upgrades from buster to
sid.

An upgrade test with piuparts revealed that your package installs files
over existing symlinks and possibly overwrites files owned by other
packages. This usually means an old version of the package shipped a
symlink but that was later replaced by a real (and non-empty)
directory. This kind of overwriting another package's files cannot be
detected by dpkg.

This was observed on the following upgrade paths:

  buster -> sid

For /usr/share/doc/PACKAGE this may not be problematic as long as both
packages are installed, ship byte-for-byte identical files and are
upgraded in lockstep. But once one of the involved packages gets
removed, the other one will lose its documentation files, too,
including the copyright file, which is a violation of Policy 12.5:
https://www.debian.org/doc/debian-policy/ch-docs.html#copyright-information

For other overwritten locations anything interesting may happen.

Note that dpkg intentionally does not replace directories with symlinks
and vice versa, you need the maintainer scripts to do this.
See in particular the end of point 4 in
https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#details-of-unpack-phase-of-installation-or-upgrade

It is recommended to use the dpkg-maintscript-helper commands
'dir_to_symlink' and 'symlink_to_dir' (available since dpkg 1.17.14)
to perform the conversion, ideally using d/$PACKAGE.maintscript.
See dpkg-maintscript-helper(1) and dh_installdeb(1) for details.


>From the attached log (scroll to the bottom...):

1m6.5s ERROR: FAIL: silently overwrites files via directory symlinks:
  /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/shim/html5shiv.min.js (r-cran-rmarkdown) != /usr/lib/R/site-library/shiny/www/shared/bootstrap/shim/html5shiv.min.js (r-cran-shiny)
    /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/shim -> ../../../../shiny/www/shared/bootstrap/shim
  /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/shim/respond.min.js (r-cran-rmarkdown) != /usr/lib/R/site-library/shiny/www/shared/bootstrap/shim/respond.min.js (r-cran-shiny)
    /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/shim -> ../../../../shiny/www/shared/bootstrap/shim


cheers,

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r-cran-rmarkdown_1.17+dfsg-1.log.gz
Type: application/gzip
Size: 34663 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/r-pkg-team/attachments/20191126/bc57152d/attachment-0001.gz>


More information about the R-pkg-team mailing list