Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
a1ec7979
Commit
a1ec7979
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Dumping important flag when listing packages.
parent
eae8679f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
com.oracle.truffle.r.test.packages/r/install.cache.R
+1
-1
1 addition, 1 deletion
com.oracle.truffle.r.test.packages/r/install.cache.R
com.oracle.truffle.r.test.packages/r/install.packages.R
+23
-1
23 additions, 1 deletion
com.oracle.truffle.r.test.packages/r/install.packages.R
with
24 additions
and
2 deletions
com.oracle.truffle.r.test.packages/r/install.cache.R
+
1
−
1
View file @
a1ec7979
...
...
@@ -21,7 +21,7 @@
# questions.
#
# A simple log function; to be replaced by a use
d
of this file.
# A simple log function; to be replaced by a use
r
of this file.
log.message
<-
function
(
...
,
level
=
0
)
{
cat
(
...
,
"\n"
)
}
...
...
This diff is collapsed.
Click to expand it.
com.oracle.truffle.r.test.packages/r/install.packages.R
+
23
−
1
View file @
a1ec7979
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment