From Kurt@Horn|k @end|ng |rom wu@@c@@t  Tue Jul  2 08:32:23 2019
From: Kurt@Horn|k @end|ng |rom wu@@c@@t (Kurt Hornik)
Date: Tue, 2 Jul 2019 08:32:23 +0200
Subject: [Rd] eliminate a partial argument match warning in R CMD check
In-Reply-To: <CANe9BHE9RWCjc-e=BZH7-ow3oWMeS-HeobhEJDN_O-J0g5cenw@mail.gmail.com>
References: <CANe9BHE9RWCjc-e=BZH7-ow3oWMeS-HeobhEJDN_O-J0g5cenw@mail.gmail.com>
Message-ID: <23834.64119.702506.122370@hornik.net>

>>>>> Jennifer Bryan writes:

Thanks: fixed with c76763 in the trunk.

Best
-k

> Hello,
> I'm seeing a nuisance warning when I run `R CMD check --as-cran
> whatever_x.y.z.tar.gz`.

> I generally work with these options set:

> options(
>   warnPartialMatchArgs = TRUE,
>   warnPartialMatchAttr = TRUE,
>   warnPartialMatchDollar = TRUE
> )

> And I see this:

> * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src",
> patt = "[.]c$") :
>   partial argument match of 'patt' to 'pattern'
> Warning in dir("src", patt = "[.](cc|cpp)$") :
>   partial argument match of 'patt' to 'pattern'
> Warning in dir("src", patt = "[.]f$") :
>   partial argument match of 'patt' to 'pattern'
> Warning in dir("src", patt = "[.]f9[05]$") :
>   partial argument match of 'patt' to 'pattern'

> It's not a big deal but it would be nice to silence it. Patch below.

> Thanks,
> Jenny

> diff --git a/src/library/tools/R/check.R b/src/library/tools/R/check.R

> index 21d192af485..199029bda73 100644
> --- a/src/library/tools/R/check.R
> +++ b/src/library/tools/R/check.R
> @@ -2933,10 +2933,10 @@ add_dummies <- function(dir, Log)
>              any <- msg <- character()
>              for (m in makefiles) {
>                  lines <- readLines(m, warn = FALSE)
> -                have_c <- length(dir('src', patt = "[.]c$", recursive
> = TRUE)) > 0L
> -                have_cxx <- length(dir('src', patt = "[.](cc|cpp)$",
> recursive = TRUE)) > 0L
> -                have_f <- length(dir('src', patt = "[.]f$", recursive
> = TRUE)) > 0L
> -                have_f9x <- length(dir('src', patt = "[.]f9[05]$",
> recursive = TRUE)) > 0L
> +                have_c <- length(dir('src', pattern = "[.]c$",
> recursive = TRUE)) > 0L
> +                have_cxx <- length(dir('src', pattern =
> "[.](cc|cpp)$", recursive = TRUE)) > 0L
> +                have_f <- length(dir('src', pattern = "[.]f$",
> recursive = TRUE)) > 0L
> +                have_f9x <- length(dir('src', pattern = "[.]f9[05]$",
> recursive = TRUE)) > 0L
>                  for (f in c("C", "CXX", "F", "FC", "CPP"))  {
>                      this <- paste0(f, "FLAGS")
>                      this2 <- paste0("PKG_", this)

> 	[[alternative HTML version deleted]]

> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] eliminate a partial argument match warning in R CMD check
Kurt Hornik