Skip to content

Commit

Permalink
Check system dependencies using pkg manager (#117)
Browse files Browse the repository at this point in the history
* #109 extend and document java check tolerance

* #105 stub action

Stub action as generated by github workflow starter

* #105 WIP basic setup

* #105 activate for current branch

* #105 use more recent setup R version

* #105 os matrix, javareconf

* #105 javareconf as root

* Install rJava from package manager

* #105 nonroot javareconf

* #105 java debugging

* #105 more java debugging

* #105 try r version 4 only

* #105 debug PATH

* #105 set vars for javareconf

* #105 alternatives wrong flag syntax

* #105 display javareconf output

* #105 display javareconf output

* #105 set vars before R install

* #105 remove preinstalled JVMs

* issue #105 check java home path

* #105 pass java home explicitly to javareconf

* #105 remove java check, too severe

* #105 add tinytex to build vignettes

* #105 no TeX, same check as travis

* #105 add changes from full example

* #105 param OS + version, skip vignettes

* #105 skip vignettes in build

* #105 upload if fail,  check XLConnect pkg file

* #105 debug check, pkg file not as expected

* #105 more file debugging

* #105 more debugging

* #105 retry with tinytex install

* #105 add LaTeX dependencies

* #105 use R helper functions for TeX deps

* #105 >_<

* #105 R install tinytex to get helper fns

* #105 conditionals, correct step order

* #105 more TeX deps

* #105 still need install tinytex

* #105 typo

* #105 compact vignettes

* #105 test nodoc path

* #105 typo build_args

* #105 more lenient option for no doc check

* #105 nodoc: ignore subdirectory issues

* #105 ignore warnings in nodoc

* issue #105 reduce size of upload, upload built pkg

* #105 more combinations

* #105 add windows + env vars

* #105 no windows, show test output

* #105 fallback to devtools if rcmdcheck not here

* #105 try MRAN snapshot for 3.2.5

* #105 cache incl. repo, temp. only legacy

* #105 avoid fallback on CRAN

* #105 explicit repos

* #105 use legacy-compatible sessionInfo()

* #105 install rcmdcheck from CRAN if available

* #105 no devtools fallback, all builds

* #105 coverage information

* #105 coverage -_-

* #105 covr sys dependencies

* #105 cover only if success, explicit checks

* #105 disable full test suite flag

* #105 effective TZ variation

* #105 reactivate full test suite option

* #105 remove commented out code

* #105 run complete test suite

* #105 install built package to run tests

* #105 correct path to src package

* #105 set RCMDCHECK var explicitly

* #105 working dir for test suite

* #105 correct path to test output

* #105 clean after full tests

* #105 Windows

* #105 typo in conditional

* #105 windows: use cmd shell

* #105 Windows: no javareconf >_<

* #105 windows: set pkg repo as quick fix

* #105 Windows: check java version

* #105 Java: both x64 and x86

* #105 java x86 exception

* #105 restrict to java x64 on macOS

* #105 abridged check witout multi archs

* #105 single arch for full test suite

* #105 temp: check windows only

* #105 reactivate others, multiarch except on win

* #105 typo in R conditional

* fix copy paste error in dependency loading

* Issues #103, #106 - add poi ooxml schemas

* #103, #106 - test xlsx file

* Check system packages - incl. debian names

* Add available RPM package names

* Javadeps: suppress warnings of pkg queries

* Javadeps: suppress system check warnings

* JavaDeps try suppressing pkg messages

* JavaDeps: use capture.output for system calls

* JavaDeps: check distro

* trim immediately after capture.output

* JavaDeps simplify, capture not needed

* JavaDeps remove NOTEs

* JavaDeps - ignore util function in codecov

* JavaDeps fix rpm version check

* JavaDeps - try latest R setup

* JavaDeps - disable macOs not working

* JavaDeps revert r setup to v1

* JavaDeps - patched action for macOs

* Prepare cran comments for upcoming release

* Upgrade java dependencies

* check if non-legacy works

* JavaDeps - PR was merged, set to master actions

* JavaDeps keep previous POI version

* JavaDeps - NEWS update

* JavaDeps: update POI, off by 1 last row of empty

* JavaDeps use backwards compatible XLConnect, revert tests

* JavaDeps - java check before d/l pkg when installing

* JavaDeps - check java version without .jinit

* JavaDeps copyright headers

* PR feedback: java version check message

* PR Feedback: reword CRAN comment

* PR feedback 2nd round of copyright headers

* PR feedback remove wordpress references

* PR feedback install instructions

* JavaDeps final 1.0.2 JAR
  • Loading branch information
spoltier authored Feb 11, 2021
1 parent e5ed1eb commit 9515879
Show file tree
Hide file tree
Showing 198 changed files with 441 additions and 376 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
architecture: x64

- name: Set up R ${{ matrix.config.r-version }}
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r-version }}

Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
if: success() && matrix.config.r-version == 'release' && matrix.config.os-name == 'ubuntu'
run: |
library(covr)
covr::codecov(function_exclusions=c("onLoad", "onAttach", "xlcEnsureDependencies"))
covr::codecov(function_exclusions=c("onLoad", "onAttach", "xlcEnsureDependencies", "checkSystemPackage"))
shell: Rscript {0}

- name: Upload check results
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
XLConnect News
--------------
1.0.2 2021-02-??
* Increase compatibility up to java 15
* fix missing jar dependency: poi-ooxml-schemas.jar
* resolve existing shared jars via package manager instead of via the file system
* upgrade java dependencies: commons compress (1.20) and commons codec (1.15)

1.0.1 2020-03-20
* Add java version check
1.0.0 2020-03-19
Expand Down
2 changes: 1 addition & 1 deletion R/XLConnectSettings.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/aref.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/aref2idx.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.operators.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setBorder.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setDataFormat.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setFillBackgroundColor.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setFillForegroundColor.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setFillPattern.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cellstyle.setWrapText.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
63 changes: 63 additions & 0 deletions R/checkSystemPackage.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################

#############################################################################
#
# XLConnect Package Installation: find system packages by name, including
# installed files, using Debian or Red Hat package managers
#
# Author: Simon Poltier, Mirai Solutions GmbH
#
#############################################################################

checkSystemPackage <- function (debianpkgname, rpmpkgname, versionpattern) {
dpkg <- function(args) {
suppressWarnings(system2("dpkg", args, stdout = TRUE, stderr = TRUE))
}
rpm <- function(args) {
suppressWarnings(system2("rpm", args, stdout = TRUE, stderr = TRUE))
}
distro <- function(distroName) {
releaseLines <- suppressWarnings(system2("cat",c("/etc/*-release"), stdout = TRUE, stderr = TRUE))
sum(grepl(pattern = paste0("ID.*",distroName), x = releaseLines, ignore.case = TRUE), na.rm = TRUE) > 0
}
if (!is.null(rpmpkgname) && distro("rhel")) {
pkgInfo <- rpm(c("-qi", rpmpkgname))
versionStr <- pkgInfo[which(grepl('Version', pkgInfo))]
if(length(versionStr) != 0) {
foundVersion <- strsplit(versionStr, " +: +")[[1]][2]
if(grepl(versionpattern, foundVersion)) {
allFiles <- rpm(c("-ql", rpmpkgname))
allFiles[which(grepl(".*/java.*jar", allFiles))]
} else { c() }
} else { c() }
}
else if(!is.null(debianpkgname) && distro("debian")) {
pkgList <- dpkg(c("-l", debianpkgname))
pkgLine <- pkgList[which(grepl(debianpkgname, pkgList))][1]
foundVersion <- strsplit(pkgLine, " +")[[1]][3]
if(grepl(versionpattern, foundVersion)) {
allFiles <- dpkg(c("--listfiles", debianpkgname))
allFiles[which(grepl(".*/java.*jar", allFiles))]
} else { c() }
}
else { c() }
}

2 changes: 1 addition & 1 deletion R/classToXlcType.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/col2idx.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/constants.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/cref2idx.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/dataframeFromJava.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/dataframeToJava.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/extractRownames.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/extractSheetName.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions R/getColSubset.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -99,4 +99,4 @@ getColSubset <- function(object, sheet, startRow, endRow, startCol, endCol, head
}

globalSubset
}
}
2 changes: 1 addition & 1 deletion R/idx2aref.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/idx2col.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/idx2cref.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/includeRownames.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/jTryCatch.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/jseq.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/jsle.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/loadWorkbook.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/mirai.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/normalizeDataframe.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/onAttach.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
#
# XLConnect
# Copyright (C) 2010-2018 Mirai Solutions GmbH
# Copyright (C) 2010-2021 Mirai Solutions GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 9515879

Please sign in to comment.