diff --git a/src/library/tools/R/Rd2HTML.R b/src/library/tools/R/Rd2HTML.R
index 7a068bae30c..c4635b8edfd 100644
--- a/src/library/tools/R/Rd2HTML.R
+++ b/src/library/tools/R/Rd2HTML.R
@@ -1376,18 +1376,15 @@ function(dir)
## License file pointers.
##
## For now only hyperlink for dynamic help.
- ## Once httpd() knows about packageLicenseFileRegexp
re <- "(.*[^[:space:]])?(([[:space:]]*\\+[[:space:]]*)?file )(LICEN[CS]E)"
ind <- grepl(re, expansions)
if(any(ind)) {
y[ind] <-
sub(re,
- ##
- ## packageLicenseFileRegexp
- ## sprintf("\\2\\4",
- ## p),
- "\\2\\4",
- ##
+ if(dynamic) {
+ sprintf("\\2\\4",
+ p)
+ } else "\\2\\4",
expansions[ind])
expansions[ind] <- sub(re, "\\1", expansions[ind])
}
@@ -1396,20 +1393,19 @@ function(dir)
## Components with labels in the R license db.
## For dynamic help, use the common licenses shipped with R
## instead of the R-project.org license URLs.
- ## Once httpd() knows about commonLicenseFilesRegexp.
ldb <- R_license_db()
pos <- match(expansions, ldb$Labels)
ind <- !is.na(pos)
if(any(ind)) {
pos <- pos[ind]
- ##
- ## commonLicenseFilesRegexp
- ## paths <- ldb[pos, "File"]
- ## urls <- ifelse(nzchar(paths),
- ## sprintf("../../licenses/%s", basename(paths)),
- ## ldb[pos, "URL"])
- urls <- ldb[pos, "URL"]
- ##
+ urls <- if(dynamic) {
+ paths <- ldb[pos, "File"]
+ ifelse(nzchar(paths),
+ sprintf("/licenses/%s",
+ basename(paths)),
+ ldb[pos, "URL"])
+ } else
+ urls <- ldb[pos, "URL"]
texts <- if(expanded) {
expansions[ind]
} else {
diff --git a/src/library/tools/R/dynamicHelp.R b/src/library/tools/R/dynamicHelp.R
index f6d69a47f73..c632aa37b61 100644
--- a/src/library/tools/R/dynamicHelp.R
+++ b/src/library/tools/R/dynamicHelp.R
@@ -314,7 +314,7 @@ httpd <- function(path, query, ...)
.HTML_package_description <- function(descfile) {
pkg <- basename(dirname(descfile))
out <- c(HTMLheader(sprintf("Package ‘%s’", pkg)),
- .DESCRIPTION_to_HTML(descfile),
+ .DESCRIPTION_to_HTML(descfile, dynamic = TRUE),
"