Tue Oct 15 18:44:21 2019 UTC ()
pkgtools/R2pkg: remove unused code


(rillig)
diff -r1.7 -r1.8 pkgsrc/pkgtools/R2pkg/files/R2pkg.R

cvs diff -r1.7 -r1.8 pkgsrc/pkgtools/R2pkg/files/R2pkg.R (expand / switch to unified diff)

--- pkgsrc/pkgtools/R2pkg/files/R2pkg.R 2019/10/13 19:34:13 1.7
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg.R 2019/10/15 18:44:21 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: R2pkg.R,v 1.7 2019/10/13 19:34:13 rillig Exp $ 1# $NetBSD: R2pkg.R,v 1.8 2019/10/15 18:44:21 rillig Exp $
2# 2#
3# Copyright (c) 2014,2015,2016,2017,2018,2019 3# Copyright (c) 2014,2015,2016,2017,2018,2019
4# Brook Milligan. All rights reserved. 4# Brook Milligan. All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 3. Neither the name of the author nor the names of any contributors 14# 3. Neither the name of the author nor the names of any contributors
@@ -434,53 +434,26 @@ license <- function(s) @@ -434,53 +434,26 @@ license <- function(s)
434 if (old.license != '' && old.license != license) 434 if (old.license != '' && old.license != license)
435 license <- paste0(license,' # [R2pkg] previously: ',old.license) 435 license <- paste0(license,' # [R2pkg] previously: ',old.license)
436 license 436 license
437} 437}
438 438
439maintainer <- function(email) 439maintainer <- function(email)
440{ 440{
441 MAINTAINER <- read.file.as.value('MAINTAINER') 441 MAINTAINER <- read.file.as.value('MAINTAINER')
442 if (MAINTAINER == '') 442 if (MAINTAINER == '')
443 MAINTAINER <- email 443 MAINTAINER <- email
444 MAINTAINER 444 MAINTAINER
445} 445}
446 446
447make.sed.command <- function(key,value) 
448{ 
449 address <- paste0('/^[[:blank:]]*',key,'/') 
450 match <- paste0('(',key,'[[:blank:]]*=[[:blank:]]*).*$') 
451 replacement <- paste0('\\1',value) 
452 command <- paste0(' -e "',address,'s/',match,'/',replacement,'/"') 
453 command 
454} 
455 
456sed.categories <- function(categories) make.sed.command('CATEGORIES',categories) 
457sed.comment <- function(comment) 
458{ 
459 old.comment <- read.file.as.value('COMMENT') 
460 if (weakly.equals(old.comment,comment)) 
461 comment <- old.comment 
462 make.sed.command('COMMENT',comment) 
463} 
464sed.maintainer <- function(email) 
465{ 
466 make.sed.command('MAINTAINER',maintainer(email)) 
467} 
468sed.license <- function(license) 
469{ 
470 make.sed.command('LICENSE',license) 
471} 
472sed.r_pkgver <- function(r_pkgver) make.sed.command('R_PKGVER',r_pkgver) 
473 
474find.Rcpp <- function(imps, deps) grepl('Rcpp', paste(imps, deps)) 447find.Rcpp <- function(imps, deps) grepl('Rcpp', paste(imps, deps))
475 448
476buildlink3.mk <- function(imps,deps) 449buildlink3.mk <- function(imps,deps)
477{ 450{
478 BUILDLINK3.MK <- data.frame() 451 BUILDLINK3.MK <- data.frame()
479 buildlink3.mk.list <- read.file.as.list('BUILDLINK3.MK') 452 buildlink3.mk.list <- read.file.as.list('BUILDLINK3.MK')
480 for (line in buildlink3.mk.list) 453 for (line in buildlink3.mk.list)
481 { 454 {
482 fields <- strsplit(line[[1]],'/',fixed=TRUE) 455 fields <- strsplit(line[[1]],'/',fixed=TRUE)
483 key <- fields[[1]][3] 456 key <- fields[[1]][3]
484 value <- line 457 value <- line
485 BUILDLINK3.MK <- rbind(BUILDLINK3.MK,data.frame(key=key,value=value)) 458 BUILDLINK3.MK <- rbind(BUILDLINK3.MK,data.frame(key=key,value=value))
486 } 459 }