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
14d8d305
Commit
14d8d305
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Do not compute transitive dependencies if cache disabled.
parent
0286b7b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.test.packages/r/install.cache.R
+23
-19
23 additions, 19 deletions
com.oracle.truffle.r.test.packages/r/install.cache.R
with
23 additions
and
19 deletions
com.oracle.truffle.r.test.packages/r/install.cache.R
+
23
−
19
View file @
14d8d305
...
...
@@ -327,26 +327,30 @@ transitive.dependencies <- function(pkg, lib, pl = available.packages(), deptype
# Fetches the package from the cache or installs it. This is also done for all transitive dependencies.
pkg.cache.internal.install
<-
function
(
pkg.cache.env
,
pkgname
,
contriburl
,
lib.install
)
{
tryCatch
({
# determine available packages
pkg.list
<-
available.packages
(
contriburl
=
contriburl
)
# compute transitive dependencies of the package to install
log.message
(
"Computing transitive package dependencies for "
,
pkgname
,
level
=
1
)
transitive.pkg.list
<-
c
(
transitive.dependencies
(
pkgname
,
lib
=
lib.install
,
pl
=
pkg.list
),
pkgname
)
log.message
(
"transitive deps: "
,
transitive.pkg.list
,
level
=
1
)
# apply pkg cache to fetch cached packages first
cached.pkgs
<-
sapply
(
transitive.pkg.list
,
function
(
pkgname
)
pkg.cache.get
(
pkg.cache.env
,
pkgname
,
lib.install
))
log.message
(
"Number of uncached pacakges:"
,
length
(
transitive.pkg.list
[
!
cached.pkgs
]),
level
=
1
)
# if there was at least one non-cached package
if
(
any
(
!
cached.pkgs
)
||
length
(
cached.pkgs
)
==
0L
)
{
# install the package (and the transitive dependencies implicitly)
if
(
pkg.cache.env
$
enabled
)
{
# determine available packages
pkg.list
<-
available.packages
(
contriburl
=
contriburl
)
# compute transitive dependencies of the package to install
log.message
(
"Computing transitive package dependencies for "
,
pkgname
,
level
=
1
)
transitive.pkg.list
<-
c
(
transitive.dependencies
(
pkgname
,
lib
=
lib.install
,
pl
=
pkg.list
),
pkgname
)
log.message
(
"transitive deps: "
,
transitive.pkg.list
,
level
=
1
)
# apply pkg cache to fetch cached packages first
cached.pkgs
<-
sapply
(
transitive.pkg.list
,
function
(
pkgname
)
pkg.cache.get
(
pkg.cache.env
,
pkgname
,
lib.install
))
log.message
(
"Number of uncached packages:"
,
length
(
transitive.pkg.list
[
!
cached.pkgs
]),
level
=
1
)
# if there was at least one non-cached package
if
(
any
(
!
cached.pkgs
)
||
length
(
cached.pkgs
)
==
0L
)
{
# install the package (and the transitive dependencies implicitly)
install.packages
(
pkgname
,
contriburl
=
contriburl
,
type
=
"source"
,
lib
=
lib.install
,
INSTALL_opts
=
"--install-tests"
)
# cache packages that were not in the cache before
log.message
(
"Caching uncached dependencies:"
,
transitive.pkg.list
[
!
cached.pkgs
],
level
=
1
)
lapply
(
transitive.pkg.list
[
!
cached.pkgs
],
function
(
pkgname
)
pkg.cache.insert
(
pkg.cache.env
,
pkgname
,
lib.install
))
}
}
else
{
install.packages
(
pkgname
,
contriburl
=
contriburl
,
type
=
"source"
,
lib
=
lib.install
,
INSTALL_opts
=
"--install-tests"
)
# cache packages that were not in the cache before
log.message
(
"Caching uncached dependencies:"
,
transitive.pkg.list
[
!
cached.pkgs
],
level
=
1
)
lapply
(
transitive.pkg.list
[
!
cached.pkgs
],
function
(
pkgname
)
pkg.cache.insert
(
pkg.cache.env
,
pkgname
,
lib.install
))
}
# if we reach here, installation was a success
...
...
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