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
No related branches found
No related tags found
No related merge requests found
......@@ -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.SetDimAttributeNode;
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.VectorLengthProfile;
import com.oracle.truffle.r.runtime.RRuntime;
......@@ -80,6 +81,8 @@ final class CachedExtractVectorNode extends CachedVectorNode {
@Child private GetDimNamesAttributeNode getDimNamesNode;
@Child private GetNamesAttributeNode getNamesNode;
@Child private GetNamesAttributeNode getNamesFromDimNamesNode;
@Child private BoxPrimitiveNode boxOldDimNames;
@Child private BoxPrimitiveNode boxNewDimName;
@Children private final CachedExtractVectorNode[] extractNames;
@Children private final CachedExtractVectorNode[] extractNamesAlternative;
......@@ -280,7 +283,17 @@ final class CachedExtractVectorNode extends CachedVectorNode {
} else if (positionsCheckNode.isEmptyPosition(i, positions[i])) {
result = RNull.instance;
} 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;
if (newDimNamesNames != null) {
......
This diff is collapsed.
......@@ -21,7 +21,7 @@
# 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) {
cat(..., "\n")
}
......
......@@ -126,6 +126,7 @@ usage <- function() {
"[--alpha-daily]",
"[--count-daily count]",
"[--ok-only]",
"[--important-pkgs file]",
"[--pkg-pattern package-pattern] \n"))
quit(status=100)
}
......@@ -631,6 +632,17 @@ get.blacklist <- function() {
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) {
if (print.install.status) {
cat("BEGIN install status\n")
......@@ -650,7 +662,10 @@ do.it <- function() {
pkg <- toinstall.pkgs[pkgname, ]
# pretend we are accessing CRAN if list.canonical
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() {
invert.pkgset <<- TRUE
} else if (a == "--find-top100") {
find.top100 <<- TRUE
} else if (a == "--important-pkgs") {
important.pkg.table.file <<- get.argvalue()
if (is.na(important.pkg.table.file)) {
usage()
}
} else {
if (grepl("^-.*", a)) {
usage()
......@@ -1126,6 +1146,8 @@ list.versions <- FALSE
list.canonical <- FALSE
invert.pkgset <- F
find.top100 <- F
important.pkg.table.file <- NA
important.pkg.table <- NULL
if (!interactive()) {
run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment