Skip to content

Commit

Permalink
getting package name from package
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Jul 18, 2024
1 parent adda297 commit 9c4738b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion containers/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ WORKDIR target/
# Get the package name based on the repository from the Description file
RUN PACKAGE_NAME=$(R -s -e "package<-desc::desc(file=file.path('${PACKAGE_PATH}','DESCRIPTION'))\$get_field('Package');writeLines(package)")
# Install all dependencies of PACKAGE_NAME but not the package it self
RUN R -e "renv::deactivate();pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == '$PACKAGE_NAME')])"
RUN R -e "renv::deactivate()"
RUN R -e "package<-desc::desc(package='$PACKAGE_PATH')\$get_field('Package');pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == package)])"
3 changes: 2 additions & 1 deletion containers/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,5 @@ WORKDIR target/
# Get the package name based on the repository from the Description file
RUN PACKAGE_NAME=$(R -s -e "package<-desc::desc(file=file.path('${PACKAGE_PATH}','DESCRIPTION'))\$get_field('Package');writeLines(package)")
# Install all dependencies of PACKAGE_NAME but not the package it self
RUN R -e "renv::deactivate();pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == '$PACKAGE_NAME')])"
RUN R -e "renv::deactivate()"
RUN R -e "package<-desc::desc(package='$PACKAGE_PATH')\$get_field('Package');pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == package)])"
2 changes: 2 additions & 0 deletions containers/valgrind/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ WORKDIR target/
# get a list of all dependencies; install remaining packages
# escape=\
RUN R -e "renv::deactivate();pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs)])"
RUN R -e "renv::deactivate()"
RUN R -e "package<-desc::desc(package='$PACKAGE_PATH')\$get_field('Package');pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == package)])"

0 comments on commit 9c4738b

Please sign in to comment.