Skip to content

Commit

Permalink
Merge pull request #39 from furrer-lab/33-remove-abn-from-the-install…
Browse files Browse the repository at this point in the history
…ed-packages

33 remove abn from the installed packages
  • Loading branch information
matteodelucchi authored Jun 25, 2024
2 parents 72f5063 + 75dfd0b commit ea87abb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
.Rprofile
renv.lock
renv/
*.code-workspace
5 changes: 4 additions & 1 deletion containers/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ RUN git clone --depth=1 https://$REPO_PATH target
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)])"
# 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')])"
5 changes: 4 additions & 1 deletion containers/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,7 @@ RUN git clone --depth=1 https://$REPO_PATH target
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)])"
# 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')])"

0 comments on commit ea87abb

Please sign in to comment.