pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/R2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri Oct 18 22:10:46 UTC 2019

Modified Files:
        pkgsrc/pkgtools/R2pkg/files: R2pkg.R R2pkg_test.R

Log Message:
pkgtools/R2pkg: make write.Makefile simpler


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 pkgsrc/pkgtools/R2pkg/files/R2pkg.R
cvs rdiff -u -r1.8 -r1.9 pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/R2pkg/files/R2pkg.R
diff -u pkgsrc/pkgtools/R2pkg/files/R2pkg.R:1.13 pkgsrc/pkgtools/R2pkg/files/R2pkg.R:1.14
--- pkgsrc/pkgtools/R2pkg/files/R2pkg.R:1.13    Fri Oct 18 21:42:20 2019
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg.R Fri Oct 18 22:10:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: R2pkg.R,v 1.13 2019/10/18 21:42:20 rillig Exp $
+# $NetBSD: R2pkg.R,v 1.14 2019/10/18 22:10:46 rillig Exp $
 #
 # Copyright (c) 2014,2015,2016,2017,2018,2019
 #      Brook Milligan.  All rights reserved.
@@ -43,6 +43,8 @@ arg.maintainer_email     <- Sys.getenv('
 arg.rpkg_description_url <- Sys.getenv('RPKG_DESCRIPTION_URL')
 arg.quiet_curl           <- as.logical(Sys.getenv('QUIET_CURL'))
 
+mkcvsid <- paste0('# $', 'NetBSD$')
+
 level.message <- function(...)
   message('[ ', arg.level, ' ] ', ...)
 
@@ -648,39 +650,36 @@ copy.description <- function(connection)
 
 write.Makefile <- function(metadata)
 {
-  RCSID             <- paste0('# $', 'NetBSD$')
-  CATEGORIES        <- varassign('CATEGORIES', categories())
-  MAINTAINER        <- varassign('MAINTAINER', maintainer(arg.maintainer_email))
-  COMMENT           <- varassign('COMMENT', one.line(metadata$Title))
-  LICENSE           <- varassign('LICENSE', license(metadata$License))
-  R_PKGNAME         <- varassign('R_PKGNAME', one.line(metadata$Package))
-  R_PKGVER          <- varassign('R_PKGVER', one.line(metadata$Version))
-  USE_LANGUAGES     <- varassigns('USE_LANGUAGES', use.languages(metadata$Imports, metadata$Depends))
-  DEPENDENCIES      <- make.depends(metadata$Imports, metadata$Depends)
-  DEPENDS           <- DEPENDENCIES[1]
-  BUILDLINK3.MK     <- DEPENDENCIES[2]
-  INCLUDE.R         <- '.include "../../math/R/Makefile.extension"'
-  INCLUDE.PKG       <- '.include "../../mk/bsd.pkg.mk"'
-
-  Makefile <- list()
-  Makefile <- append(Makefile,RCSID)
-  Makefile <- append(Makefile,'')
-  Makefile <- append(Makefile,R_PKGNAME)
-  Makefile <- append(Makefile,R_PKGVER)
-  Makefile <- append(Makefile,CATEGORIES)
-  Makefile <- append(Makefile,'')
-  Makefile <- append(Makefile,MAINTAINER)
-  Makefile <- append(Makefile,COMMENT)
-  Makefile <- append(Makefile,LICENSE)
-  Makefile <- append(Makefile,'')
-  Makefile <- append(Makefile,DEPENDS)
-  Makefile <- append(Makefile,USE_LANGUAGES)
-  Makefile <- append(Makefile,INCLUDE.R)
-  Makefile <- append(Makefile,BUILDLINK3.MK)
-  Makefile <- append(Makefile,INCLUDE.PKG)
-  Makefile <- paste(unlist(Makefile),collapse='\n')
+  CATEGORIES    <- varassign('CATEGORIES', categories())
+  MAINTAINER    <- varassign('MAINTAINER', maintainer(arg.maintainer_email))
+  COMMENT       <- varassign('COMMENT', one.line(metadata$Title))
+  LICENSE       <- varassign('LICENSE', license(metadata$License))
+  R_PKGNAME     <- varassign('R_PKGNAME', one.line(metadata$Package))
+  R_PKGVER      <- varassign('R_PKGVER', one.line(metadata$Version))
+  USE_LANGUAGES <- varassigns('USE_LANGUAGES', use.languages(metadata$Imports, metadata$Depends))
+  dependencies  <- make.depends(metadata$Imports, metadata$Depends)
+  depends       <- dependencies[1]
+  buildlink3    <- dependencies[2]
+
+  lines <- c(
+    mkcvsid,
+    '',
+    R_PKGNAME,
+    R_PKGVER,
+    CATEGORIES,
+    '',
+    MAINTAINER,
+    COMMENT,
+    LICENSE,
+    '',
+    depends,
+    USE_LANGUAGES,
+    '.include "../../math/R/Makefile.extension"',
+    buildlink3,
+    '.include "../../mk/bsd.pkg.mk"',
+    recursive = TRUE)
 
-  write(Makefile,'Makefile')
+  writeLines(lines, 'Makefile')
 }
 
 construct.line <- function(df,key,value)

Index: pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R
diff -u pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R:1.8 pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R:1.9
--- pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R:1.8        Fri Oct 18 21:42:20 2019
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg_test.R    Fri Oct 18 22:10:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: R2pkg_test.R,v 1.8 2019/10/18 21:42:20 rillig Exp $
+# $NetBSD: R2pkg_test.R,v 1.9 2019/10/18 22:10:46 rillig Exp $
 #
 # Copyright (c) 2019
 #      Roland Illig.  All rights reserved.
@@ -32,8 +32,6 @@ source('R2pkg.R')
 library(testthat)
 library(withr)
 
-mkcvsid = paste0('# $', 'NetBSD$')
-
 # TODO: use a test fixture for setting these
 arg.recursive <- FALSE
 arg.update <- FALSE



Home | Main Index | Thread Index | Old Index