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
3d1fdcc8
Commit
3d1fdcc8
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Remove system installation mode.
parent
cabd5e6d
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.package.R
+0
-89
0 additions, 89 deletions
com.oracle.truffle.r.test.packages/r/install.package.R
com.oracle.truffle.r.test.packages/r/install.packages.R
+5
-17
5 additions, 17 deletions
com.oracle.truffle.r.test.packages/r/install.packages.R
with
5 additions
and
106 deletions
com.oracle.truffle.r.test.packages/r/install.package.R
deleted
100644 → 0
+
0
−
89
View file @
cabd5e6d
#
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# A script to do a single package installation (+dependents), called from install.packages.R.
# It exists as a separate script only to avoid internal FastR errors from killing the
# entire installation process for multiple package installation tests.
# args:
# pkgname, contriburl, lib, pkg.cache.enabled [, api.version, cache.dir ]
log.message
<-
function
(
...
,
level
=
0L
)
{
# TODO: verbosity
if
(
level
==
0L
)
{
cat
(
...
,
"\n"
)
}
}
args
<-
commandArgs
(
TRUE
)
parse.args
<-
function
()
{
if
(
length
(
args
))
{
pkgname
<<-
args
[[
1
]]
contriburl
<<-
strsplit
(
args
[[
2
]],
","
)[[
1
]]
lib.install
<<-
args
[[
3
]]
pkg.cache
<<-
as.environment
(
list
(
enabled
=
FALSE
,
table.file.name
=
"version.table"
,
size
=
2L
))
pkg.cache
$
enabled
<-
as.logical
(
args
[[
4
]])
cat
(
"system.install, cache enabled: "
,
pkg.cache
$
enabled
,
"\n"
)
if
(
pkg.cache
$
enabled
)
{
pkg.cache
$
version
<-
args
[[
5
]]
pkg.cache
$
dir
<-
args
[[
6
]]
}
}
}
# return code: sucess == 0L, error == 1L
run
<-
function
()
{
parse.args
()
pkg.cache.internal.install
(
pkg.cache
,
pkgname
,
contriburl
,
lib.install
)
}
# Determines the directory of the script assuming that there is a "--file=" argument on the command line.
getCurrentScriptDir
<-
function
()
{
cmdArgs
<-
commandArgs
()
res
<-
startsWith
(
cmdArgs
,
'--file='
)
fileArg
<-
cmdArgs
[
res
]
if
(
length
(
fileArg
)
>
0L
)
{
p
<-
strsplit
(
fileArg
,
"="
)[[
1
]][[
2
]]
dirname
(
p
)
}
else
{
NULL
}
}
# load package cache code
curScriptDir
<-
getCurrentScriptDir
()
if
(
!
is.null
(
curScriptDir
))
{
source
(
file.path
(
curScriptDir
,
"install.cache.R"
))
}
else
{
log.message
(
"Cannot use package cache since script directory cannot be determined"
)
pkg.cache.get
<<-
function
(
...
)
FALSE
pkg.cache.insert
<<-
function
(
...
)
FALSE
}
if
(
!
interactive
())
{
status.code
<-
run
()
quit
(
status
=
status.code
)
}
This diff is collapsed.
Click to expand it.
com.oracle.truffle.r.test.packages/r/install.packages.R
+
5
−
17
View file @
3d1fdcc8
...
@@ -741,23 +741,11 @@ fastr_error_log_size <- function() {
...
@@ -741,23 +741,11 @@ fastr_error_log_size <- function() {
# installs a single package or retrieves it from the cache
# installs a single package or retrieves it from the cache
install.pkg
<-
function
(
pkgname
)
{
install.pkg
<-
function
(
pkgname
)
{
error_log_size
<-
fastr_error_log_size
()
error_log_size
<-
fastr_error_log_size
()
if
(
run.mode
==
"system"
)
{
rc
<-
pkg.cache.internal.install
(
pkg.cache
,
pkgname
,
contrib.url
(
getOption
(
"repos"
),
"source"
)[[
1
]],
lib.install
)
tryCatch
(
if
(
rc
==
0L
)
{
system.install
(
pkgname
)
# be paranoid and also check file system and log
,
error
=
function
(
e
)
{
rc
<-
installed.ok
(
pkgname
,
error_log_size
)
log.message
(
e
$
message
)
}
1L
},
warning
=
function
(
e
)
{
log.message
(
e
$
message
)
# According to the documentation of 'system2', a warning will provide a status field.
e
$
status
})
}
else
if
(
run.mode
==
"internal"
)
{
pkg.cache.internal.install
(
pkg.cache.env
=
pkg.cache
,
pkgname
=
pkgname
,
lib.install
=
lib.install
)
}
else
if
(
run.mode
==
"context"
)
{
stop
(
"context run-mode not implemented\n"
)
}
rc
<-
installed.ok
(
pkgname
,
error_log_size
)
names
(
rc
)
<-
pkgname
names
(
rc
)
<-
pkgname
install.status
<<-
append
(
install.status
,
rc
)
install.status
<<-
append
(
install.status
,
rc
)
return
(
rc
)
return
(
rc
)
...
...
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