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: Sun Oct 13 15:35:48 UTC 2019
Modified Files:
pkgsrc/pkgtools/R2pkg/files: R2pkg.R R2pkg.sh
Log Message:
pkgtools/R2pkg: make R2pkg.R testable
Placing the code into a main function allows the tests to source the file
without any side effects.
The LC_ALL=C environment variable is necessary on NetBSD/x86_64 8.0 in
the en_US.UTF-8 locale since otherwise R dumps core in the source(...)
call, deep inside towctrans.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/R2pkg/files/R2pkg.R
cvs rdiff -u -r1.8 -r1.9 pkgsrc/pkgtools/R2pkg/files/R2pkg.sh
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.2 pkgsrc/pkgtools/R2pkg/files/R2pkg.R:1.3
--- pkgsrc/pkgtools/R2pkg/files/R2pkg.R:1.2 Sun Oct 13 13:28:45 2019
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg.R Sun Oct 13 15:35:48 2019
@@ -1,4 +1,4 @@
-# $NetBSD: R2pkg.R,v 1.2 2019/10/13 13:28:45 rillig Exp $
+# $NetBSD: R2pkg.R,v 1.3 2019/10/13 15:35:48 rillig Exp $
#
# Copyright (c) 2014,2015,2016,2017,2018,2019
# Brook Milligan. All rights reserved.
@@ -1249,17 +1249,20 @@ create.DESCR <- function(metadata)
write(DESCR,'DESCR')
}
-set.locale()
+main <- function()
+{
+ set.locale()
-error <- download.file(url=arg.rpkg_description_url,destfile='DESCRIPTION',quiet=arg.quiet_curl,method='curl')
-if (error)
- {
- message('ERROR: Downloading the DESCRIPTION file for ',arg.rpkg,' failed;')
- message(' perhaps the package no longer exists?')
- quit(save='no',status=error)
- }
+ error <- download.file(url=arg.rpkg_description_url,destfile='DESCRIPTION',quiet=arg.quiet_curl,method='curl')
+ if (error)
+ {
+ message('ERROR: Downloading the DESCRIPTION file for ',arg.rpkg,' failed;')
+ message(' perhaps the package no longer exists?')
+ quit(save='no',status=error)
+ }
-metadata <- read.dcf(file='DESCRIPTION', fields=c('Package','Version','Title','Description','License','Imports','Depends'))
+ metadata <- read.dcf(file='DESCRIPTION', fields=c('Package','Version','Title','Description','License','Imports','Depends'))
-create.Makefile(metadata)
-create.DESCR(metadata)
+ create.Makefile(metadata)
+ create.DESCR(metadata)
+}
Index: pkgsrc/pkgtools/R2pkg/files/R2pkg.sh
diff -u pkgsrc/pkgtools/R2pkg/files/R2pkg.sh:1.8 pkgsrc/pkgtools/R2pkg/files/R2pkg.sh:1.9
--- pkgsrc/pkgtools/R2pkg/files/R2pkg.sh:1.8 Sun Oct 13 13:26:22 2019
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg.sh Sun Oct 13 15:35:48 2019
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: R2pkg.sh,v 1.8 2019/10/13 13:26:22 rillig Exp $
+# $NetBSD: R2pkg.sh,v 1.9 2019/10/13 15:35:48 rillig Exp $
#
# Copyright (c) 2014,2015,2016,2017,2018,2019
# Brook Milligan. All rights reserved.
@@ -192,7 +192,8 @@ make_package ()
MAINTAINER_EMAIL="${MAINTAINER_EMAIL}" \
RPKG_DESCRIPTION_URL="${RPKG_DESCRIPTION_URL}" \
QUIET_CURL="${QUIET_CURL}" \
- Rscript --no-save "@LIBDIR@/R2pkg.R"
+ LC_ALL="C" \
+ Rscript --no-save -e "source('@LIBDIR@/R2pkg.R'); main()"
retval=${?}
if [ ${retval} -ne 0 ]; then
echo "ERROR: making ${RPKG} package failed." 1>&2
Home |
Main Index |
Thread Index |
Old Index