pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/R2pkg/files pkgtools/R2pkg: code cleanup



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5948b2288976
branches:  trunk
changeset: 342098:5948b2288976
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 13 17:23:29 2019 +0000

description:
pkgtools/R2pkg: code cleanup

diffstat:

 pkgtools/R2pkg/files/R2pkg.R |  19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diffs (68 lines):

diff -r 3910209c0bdc -r 5948b2288976 pkgtools/R2pkg/files/R2pkg.R
--- a/pkgtools/R2pkg/files/R2pkg.R      Sun Oct 13 17:20:00 2019 +0000
+++ b/pkgtools/R2pkg/files/R2pkg.R      Sun Oct 13 17:23:29 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: R2pkg.R,v 1.4 2019/10/13 17:20:00 rillig Exp $
+# $NetBSD: R2pkg.R,v 1.5 2019/10/13 17:23:29 rillig Exp $
 #
 # Copyright (c) 2014,2015,2016,2017,2018,2019
 #      Brook Milligan.  All rights reserved.
@@ -31,7 +31,7 @@
 # Create an R package in the current directory
 #
 
-arg.level                <- Sys.getenv('LEVEL')
+arg.level                <- as.integer(Sys.getenv('LEVEL'))
 arg.rpkg                 <- Sys.getenv('RPKG')
 arg.packages_list        <- Sys.getenv('PACKAGES_LIST')
 arg.r2pkg                <- Sys.getenv('R2PKG')
@@ -56,8 +56,6 @@
   version
 }
 
-set.locale <- function() { invisible(Sys.setlocale('LC_ALL','C')) }
-
 trim.space <- function(s) gsub('[[:space:]]','',s)
 trim.blank <- function(s) gsub('[[:blank:]]','',s)
 one.space <- function(s) gsub('[[:blank:]]+',' ',s)
@@ -500,6 +498,8 @@
 }
 sed.r_pkgver <- function(r_pkgver) make.sed.command('R_PKGVER',r_pkgver)
 
+find.Rcpp <- function(s1, s2) grepl('Rcpp', paste(s1, s2))
+
 buildlink3.mk <- function(s1,s2)
 {
   BUILDLINK3.MK <- data.frame()
@@ -561,13 +561,6 @@
   s
 }
 
-find.Rcpp <- function(s1,s2)
-{
-  s <- paste(s1,s2)
-  Rcpp <- grepl('Rcpp',s)
-  Rcpp
-}
-
 make.imports <- function(s1,s2)
 {
   s <- paste2(s1,s2)
@@ -746,7 +739,7 @@
              # message('===> depends(dependency): ',depends(dependency))
              # message('===> depends.pkg(dependency):',paste(' ',d))
              # message('===> index: ',index)
-             # message('===> buildlinke.line(): ',buildlink3.line(dependency,index))
+             # message('===> buildlink3.line(): ',buildlink3.line(dependency,index))
              if (length(index) == 1) # a unique, non-wip, dependency found
                {
                  level.message('choosing unique non-wip dependency for ',dependency,': ',depends.pkg(dependency)[index])
@@ -1259,7 +1252,7 @@
 
 main <- function()
 {
-  set.locale()
+  Sys.setlocale('LC_ALL', 'C')
 
   error <- download.file(url=arg.rpkg_description_url,destfile='DESCRIPTION',quiet=arg.quiet_curl,method='curl')
   if (error)



Home | Main Index | Thread Index | Old Index