Skip to content
Snippets Groups Projects
Commit 7a98dad8 authored by Florian Angerer's avatar Florian Angerer
Browse files

[GR-7252] Dumping important flag when listing packages.

parents 5cf72ef6 446d18af
Branches
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimNa ...@@ -39,6 +39,7 @@ import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetDimNa
import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode; import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode;
import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimAttributeNode; import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimAttributeNode;
import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimNamesAttributeNode; import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetDimNamesAttributeNode;
import com.oracle.truffle.r.nodes.binary.BoxPrimitiveNode;
import com.oracle.truffle.r.nodes.profile.AlwaysOnBranchProfile; import com.oracle.truffle.r.nodes.profile.AlwaysOnBranchProfile;
import com.oracle.truffle.r.nodes.profile.VectorLengthProfile; import com.oracle.truffle.r.nodes.profile.VectorLengthProfile;
import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RRuntime;
...@@ -80,6 +81,8 @@ final class CachedExtractVectorNode extends CachedVectorNode { ...@@ -80,6 +81,8 @@ final class CachedExtractVectorNode extends CachedVectorNode {
@Child private GetDimNamesAttributeNode getDimNamesNode; @Child private GetDimNamesAttributeNode getDimNamesNode;
@Child private GetNamesAttributeNode getNamesNode; @Child private GetNamesAttributeNode getNamesNode;
@Child private GetNamesAttributeNode getNamesFromDimNamesNode; @Child private GetNamesAttributeNode getNamesFromDimNamesNode;
@Child private BoxPrimitiveNode boxOldDimNames;
@Child private BoxPrimitiveNode boxNewDimName;
@Children private final CachedExtractVectorNode[] extractNames; @Children private final CachedExtractVectorNode[] extractNames;
@Children private final CachedExtractVectorNode[] extractNamesAlternative; @Children private final CachedExtractVectorNode[] extractNamesAlternative;
...@@ -280,7 +283,17 @@ final class CachedExtractVectorNode extends CachedVectorNode { ...@@ -280,7 +283,17 @@ final class CachedExtractVectorNode extends CachedVectorNode {
} else if (positionsCheckNode.isEmptyPosition(i, positions[i])) { } else if (positionsCheckNode.isEmptyPosition(i, positions[i])) {
result = RNull.instance; result = RNull.instance;
} else { } else {
result = extract(i, (RAbstractStringVector) RRuntime.asAbstractVector(dataAt), positions[i], positionProfile[i]); if (boxOldDimNames == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
boxOldDimNames = insert(BoxPrimitiveNode.create());
}
if (boxNewDimName == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
boxNewDimName = insert(BoxPrimitiveNode.create());
}
RAbstractStringVector originalDimName = (RAbstractStringVector) boxOldDimNames.execute(dataAt);
RAbstractStringVector newDimName = (RAbstractStringVector) boxNewDimName.execute(extract(i, originalDimName, positions[i], positionProfile[i]));
result = newDimName.materialize();
} }
newDimNames[dimIndex] = result; newDimNames[dimIndex] = result;
if (newDimNamesNames != null) { if (newDimNamesNames != null) {
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# questions. # questions.
# #
# A simple log function; to be replaced by a used of this file. # A simple log function; to be replaced by a user of this file.
log.message <- function(..., level=0) { log.message <- function(..., level=0) {
cat(..., "\n") cat(..., "\n")
} }
......
...@@ -126,6 +126,7 @@ usage <- function() { ...@@ -126,6 +126,7 @@ usage <- function() {
"[--alpha-daily]", "[--alpha-daily]",
"[--count-daily count]", "[--count-daily count]",
"[--ok-only]", "[--ok-only]",
"[--important-pkgs file]",
"[--pkg-pattern package-pattern] \n")) "[--pkg-pattern package-pattern] \n"))
quit(status=100) quit(status=100)
} }
...@@ -631,6 +632,17 @@ get.blacklist <- function() { ...@@ -631,6 +632,17 @@ get.blacklist <- function() {
blacklist blacklist
} }
is.important.package <- function(pkg.name, pkg.version) {
# lazy-load the important packages table
if (is.null(important.pkg.table) && !is.na(important.pkg.table.file)) {
important.pkg.table <<- read.csv(important.pkg.table.file, header = FALSE, sep = ",", quote = "\"", dec = ".", fill = TRUE, comment.char = "", col.names=c("name","version","url","important"))
}
if (!is.null(important.pkg.table)) {
return (any(important.pkg.table[important.pkg.table$name == pkg.name & important.pkg.table$version == pkg.version, "important"]))
}
return (FALSE)
}
show.install.status <- function(test.pkgnames) { show.install.status <- function(test.pkgnames) {
if (print.install.status) { if (print.install.status) {
cat("BEGIN install status\n") cat("BEGIN install status\n")
...@@ -650,7 +662,10 @@ do.it <- function() { ...@@ -650,7 +662,10 @@ do.it <- function() {
pkg <- toinstall.pkgs[pkgname, ] pkg <- toinstall.pkgs[pkgname, ]
# pretend we are accessing CRAN if list.canonical # pretend we are accessing CRAN if list.canonical
list.contriburl = ifelse(list.canonical, "https://cran.r-project.org/src/contrib", pkg["Repository"]) list.contriburl = ifelse(list.canonical, "https://cran.r-project.org/src/contrib", pkg["Repository"])
cat(pkg["Package"], pkg["Version"], paste0(list.contriburl, "/", pkgname, "_", pkg["Version"], ".tar.gz"), "\n", sep=",") pkg.repo.name <- pkg["Package"]
pkg.version <- pkg["Version"]
important <- tolower(as.character(is.important.package(pkg.repo.name, pkg.version)))
cat(paste(pkg.repo.name, pkg.version, paste0(list.contriburl, "/", pkgname, "_", pkg["Version"], ".tar.gz"), important, sep=","), "\n")
} }
} }
...@@ -943,6 +958,11 @@ parse.args <- function() { ...@@ -943,6 +958,11 @@ parse.args <- function() {
invert.pkgset <<- TRUE invert.pkgset <<- TRUE
} else if (a == "--find-top100") { } else if (a == "--find-top100") {
find.top100 <<- TRUE find.top100 <<- TRUE
} else if (a == "--important-pkgs") {
important.pkg.table.file <<- get.argvalue()
if (is.na(important.pkg.table.file)) {
usage()
}
} else { } else {
if (grepl("^-.*", a)) { if (grepl("^-.*", a)) {
usage() usage()
...@@ -1126,6 +1146,8 @@ list.versions <- FALSE ...@@ -1126,6 +1146,8 @@ list.versions <- FALSE
list.canonical <- FALSE list.canonical <- FALSE
invert.pkgset <- F invert.pkgset <- F
find.top100 <- F find.top100 <- F
important.pkg.table.file <- NA
important.pkg.table <- NULL
if (!interactive()) { if (!interactive()) {
run() run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment