«R -e <expr>» генерирует код выхода 0 даже в случае сбоя выражения (установка RODBC) - PullRequest
0 голосов
/ 03 октября 2019

При попытке выполнить команду

R -e 'devtools::install_version(c("RODBC"), quiet = FALSE, repos = c("https://cran.r-project.org"), dependencies = TRUE)'

на терминале во время установки возникла ошибка, и код возврата, возвращаемый командой, равен 0. Ниже приведены журналы.

R version 3.5.1 (2018-07-02) – "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

devtools::install_version(c("RODBC"), quiet = FALSE, repos = c("https://cran.r-project.org"), dependencies = TRUE)
trying URL 'https://cran.r-project.org/src/contrib/RODBC_1.3-16.tar.gz'
Content type 'application/x-gzip' length 1172291 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

installing source package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
checking for gcc... x86_64-conda_cos6-linux-gnu-cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-conda_cos6-linux-gnu-cc accepts -g... yes
checking for x86_64-conda_cos6-linux-gnu-cc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/lib/environs/e-a-2019.03-r-3.5.1/bin/x86_64-conda_cos6-linux-gnu-cpp
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... yes
checking sql.h presence... yes
checking for sql.h... yes
checking sqlext.h usability... yes
checking sqlext.h presence... yes
checking for sqlext.h... yes
checking for library containing SQLTables... no
configure: error: "no ODBC driver manager found"
ERROR: configuration failed for package ‘RODBC’
removing ‘/usr/lib/environs/e-a-2019.03-r-3.5.1/lib/R/library/RODBC’
The downloaded source packages are in
‘/tmp/RtmpWrVyjl/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(package, repos = repos, contriburl = contriburl, :
installation of package ‘RODBC’ had non-zero exit status

Я не уверен, связана ли эта ошибка с rodbc или R или связана с обработкой ошибок R. Если возникает какая-то другая ошибка, например PackageNotFound, код выхода равен 1. Я запускаю указанную выше команду через скрипт и проверяю код выхода после ее завершения. Что нужно сделать для проверки кода выхода?

...