Thanks to visit codestin.com
Credit goes to code.bioconductor.org

R/updatePackageObjects.R
fd5e1f31
 ### =========================================================================
 ### updatePackageObjects() and updateAllPackageObjects()
 ### -------------------------------------------------------------------------
 
 
7dbca3e3
 ### Return nb of updated files or negative error code.
fd5e1f31
 updatePackageObjects <- function(pkgpath=".", filter=NULL,
                                  dry.run=FALSE, bump.Version=FALSE)
a58acd40
 {
a63d2580
     get_descpath(pkgpath)  # just to get an early check of 'pkgpath'
fd5e1f31
     if (!isTRUEorFALSE(bump.Version))
         stop(wmsg("'bump.Version' must be TRUE or FALSE"))
 
8227f933
     code <- updateSerializedObjects(pkgpath, recursive=TRUE,
                                     filter=filter, dry.run=dry.run)
c9240998
     if (bump.Version && code > 0L) {
a63d2580
         ## bump_pkg_version() calls get_descpath() again so if the above
         ## call to get_descpath() emitted a warning then bump_pkg_version()
8227f933
         ## will emit that same warning again. We use suppressWarnings() to
         ## prevent that.
a63d2580
         suppressWarnings(bump_pkg_version(pkgpath, update.Date=TRUE))
     }
c9240998
     code
a58acd40
 }
 
a73ecb19
 ### Return a named integer vector **parallel** to 'all_pkgpaths'.
 updateAllPackageObjects <- function(all_pkgpaths, skipped_pkgs=NULL,
fd5e1f31
                                     filter=NULL,
                                     dry.run=FALSE, bump.Version=FALSE)
a58acd40
 {
a73ecb19
     vapply(all_pkgpaths,
         function(pkgpath) {
             if (!is.null(skipped_pkgs) && (pkgpath %in% skipped_pkgs)) {
                 message("Skip package ", pkgpath, " ==> ", .SKIPPED_PACKAGE)
8ca3edfb
                 return(.SKIPPED_PACKAGE)
a58acd40
             }
fd5e1f31
             updatePackageObjects(pkgpath, filter=filter,
                                  dry.run=dry.run, bump.Version=bump.Version)
a58acd40
         },
7dbca3e3
         integer(1)
a58acd40
     )
 }