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

Vincent Danjean vdanjean at debian.org
Wed Oct 16 22:21:02 BST 2019


Package: r-cran-rmarkdown
Version: 1.16+dfsg-1
Severity: normal

  Hi,

  While trying to reproduce a bug in another package (r-cran-dt, I will
submit it after this one), I notice an error while pandoc is invoked:
[...]
/usr/bin/pandoc +RTS -K512m -RTS small_test.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output small_test.html --email-obfuscation none --self-contained --standalone --section-divs --template /usr/lib/R/site-library/rmarkdown/rmd/h/default.html --highlight-style tango --css style.css --variable 'theme:cerulean' --include-in-header /tmp/Rtmpo7H2Mq/rmarkdown-str53cc33e4db8.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --lua-filter /usr/lib/R/site-library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /usr/lib/R/site-library/rmarkdown/rmd/lua/latex-div.lua 
pandoc: /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/css/../fonts/glyphicons-halflings-regular.eot: openBinaryFile: does not exist (No such file or directory)
Erreur : pandoc document conversion failed with error 1
Exécution arrêtée

Looking with apt-file, I see that /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/css/../fonts/glyphicons-halflings-regular.eot
was provided by r-cran-rmarkdown.
Looking at the git history of r-cran-rmarkdown, I see that in 7bd53b7c34
these files where removed and replaced by a symlink. However,
for file in fonts/ subdir, this is the whole subdir that is
symlinked and not the files themselves.

dpkg do not correctly handle dir to symlink when upgrading
(due to the fact that the sysadmin can decide to replace
dir by symlinks to manage its disks if I remember).
So support in preinst/postinst is required.

And indeed, on my machine, I can see that
/usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts
is still a (empty) real directory :
$ ls -ld /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts
drwxr-xr-x 2 root root 4096 juil.  9 15:20 /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts

I fix the bug by removing the directory and reinstalling the
package :
$ sudo rmdir /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts
$ sudo apt install --reinstall r-cran-rmarkdown
[...]
Dépaquetage de r-cran-rmarkdown (1.16+dfsg-1) sur (1.16+dfsg-1) ...
[...]
$ ls -ld /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts
lrwxrwxrwx 1 root root 53 oct.   7 15:00 /usr/lib/R/site-library/rmarkdown/rmd/h/bootstrap/fonts -> ../../../../../../../share/javascript/bootstrap/fonts

  So, for people upgrading the package, you will have to
fix this dir to symlink conversion in a pre/post-inst script.

  Regards,
    Vincent


-- System Information:
Debian Release: bullseye/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel, mipsel

Kernel: Linux 5.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8), LANGUAGE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages r-cran-rmarkdown depends on:
ii  fonts-font-awesome       5.0.10+really4.7.0~dfsg-1
ii  libjs-bootstrap          3.4.1+dfsg-1
ii  libjs-highlight.js       9.12.0+dfsg1-4
ii  libjs-jquery             3.3.1~dfsg-3
ii  libjs-jquery-ui          1.12.1+dfsg-5
ii  libjs-modernizr          2.6.2+ds1-3
ii  libjs-prettify           2015.12.04+dfsg-1.1
ii  pandoc                   2.5-2+b1
ii  r-base-core [r-api-3.5]  3.6.1-6
ii  r-cran-base64enc         0.1-3-2
ii  r-cran-evaluate          0.14-1
ii  r-cran-htmltools         0.4.0-1
ii  r-cran-jsonlite          1.6+dfsg-1
ii  r-cran-knitr             1.25+dfsg-1
ii  r-cran-mime              0.7-1
ii  r-cran-shiny             1.3.2+dfsg-1
ii  r-cran-stringr           1.4.0-1
ii  r-cran-tinytex           0.16-1
ii  r-cran-xfun              0.10-1
ii  r-cran-yaml              2.2.0-1

Versions of packages r-cran-rmarkdown recommends:
ii  r-cran-testthat  2.2.1-1

Versions of packages r-cran-rmarkdown suggests:
ii  r-cran-callr     3.3.2-1
ii  r-cran-digest    0.6.21-1
pn  r-cran-dygraphs  <none>
ii  r-cran-fs        1.3.1+dfsg-1
ii  r-cran-shiny     1.3.2+dfsg-1
ii  r-cran-tibble    2.1.3-1
pn  r-cran-tufte     <none>

-- no debconf information


More information about the R-pkg-team mailing list