pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/R2pkg pkgtools/R2pkg: update to 0.6.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cb5b4b28c584
branches:  trunk
changeset: 402618:cb5b4b28c584
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 13 09:43:26 2019 +0000

description:
pkgtools/R2pkg: update to 0.6.1

Changes since 0.6:

* Run properly even if TMPDIR is not set.

* Quote variables to prevent unintended interpolation.

* Write error messages to stderr instead of stdout.

diffstat:

 pkgtools/R2pkg/Makefile       |   4 ++--
 pkgtools/R2pkg/files/R2pkg.sh |  28 +++++++++++++++++-----------
 pkgtools/R2pkg/files/RELEASE  |  10 +++++++++-
 3 files changed, 28 insertions(+), 14 deletions(-)

diffs (152 lines):

diff -r 536bda52dbb7 -r cb5b4b28c584 pkgtools/R2pkg/Makefile
--- a/pkgtools/R2pkg/Makefile   Sun Oct 13 08:48:23 2019 +0000
+++ b/pkgtools/R2pkg/Makefile   Sun Oct 13 09:43:26 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2019/08/08 20:14:26 brook Exp $
+# $NetBSD: Makefile,v 1.6 2019/10/13 09:43:26 rillig Exp $
 #
 
-VERS=          0.6
+VERS=          0.6.1
 PKGNAME=       R2pkg-${VERS}
 CATEGORIES=    pkgtools
 
diff -r 536bda52dbb7 -r cb5b4b28c584 pkgtools/R2pkg/files/R2pkg.sh
--- a/pkgtools/R2pkg/files/R2pkg.sh     Sun Oct 13 08:48:23 2019 +0000
+++ b/pkgtools/R2pkg/files/R2pkg.sh     Sun Oct 13 09:43:26 2019 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: R2pkg.sh,v 1.6 2019/08/08 20:14:27 brook Exp $
+# $NetBSD: R2pkg.sh,v 1.7 2019/10/13 09:43:26 rillig Exp $
 #
 # Copyright (c) 2014,2015,2016,2017,2018,2019
 #      Brook Milligan.  All rights reserved.
@@ -31,6 +31,9 @@
 #
 # Create an R package in the current directory
 #
+
+set -u
+
 NAME="R2pkg"
 VERS="@VERS@"
 
@@ -40,6 +43,7 @@
 
 : ${CRAN_URL:=ftp://cran.r-project.org}
 : ${PKGEDITOR:=${EDITOR:=vi}}
+: ${TMPDIR:=/tmp}
 
 # Substituted by pkgsrc at pre-configure time.
 MAKE=@MAKE@
@@ -52,8 +56,10 @@
 UPDATE=0
 VERBOSE=0
 
+DESCRIPTION=no
 DESCRIPTION_CONNECTION=connection
 
+ARGS=""
 while getopts cDehqruVvE:M:L:P: f
 do
     case ${f} in
@@ -61,7 +67,7 @@
        c) UPDATE=0; ARGS="${ARGS} -c";;
        D) DESCRIPTION=yes; DESCRIPTION_CONNECTION="'DESCRIPTION'"; ARGS="${ARGS} -D";;
        e) EDIT=0; ARGS="${ARGS} -e";;
-       h) echo ${USAGE}; exit 0;;
+       h) echo "${USAGE}"; exit 0;;
        q) QUIET=1; ARGS="${ARGS} -q";;
        r) RECURSIVE=1; RECURSIVE_MESSAGE=1; ARGS="${ARGS} -r";;
        u) UPDATE=1; ARGS="${ARGS} -u";;
@@ -74,7 +80,7 @@
        L) LEVEL=${OPTARG};;
        P) PID=${OPTARG};;
        # unknown options
-        \?) echo ${USAGE}; exit 1;;
+        \?) echo "${USAGE}" 1>&2; exit 1;;
     esac
 done
 shift `expr ${OPTIND} - 1`
@@ -83,12 +89,12 @@
 ARGS="${ARGS} -L $((${LEVEL}+1)) -P ${PID}"
 
 if [ ${#} -eq 0 ]; then
-    RPKG=$(echo $(basename $(pwd)) | sed -e 's/^R-//');
+    RPKG=$(basename $(pwd) | sed -e 's/^R-//')
 elif [ ${#} -eq 1 ]; then
     RPKG=${1}
 else
-    echo "Error: multiple package names given."
-    echo "${USAGE}"
+    echo "Error: multiple package names given." 1>&2
+    echo "${USAGE}" 1>&2
     exit 1
 fi
 
@@ -148,7 +154,7 @@
     R_CMD="Rscript --no-save /dev/null"
     eval ${R_CMD}
     if [ ${?} -ne 0 ]; then
-       echo "ERROR: math/R package is not installed."
+       echo "ERROR: math/R package is not installed." 1>&2
        exit 1
     fi
 }
@@ -157,7 +163,7 @@
 {
     touch ${PACKAGES_LIST}
     grep -E -q -e "${RPKG}" ${PACKAGES_LIST} \
-       && echo "ERROR: circular dependency"
+       && echo "ERROR: circular dependency" 1>&2
     echo "${RPKG}" >> ${PACKAGES_LIST}
 }
 
@@ -1400,7 +1406,7 @@
     eval ${R_CMD}
     retval=${?}
     if [ ${retval} -ne 0 ]; then
-       echo "ERROR: making ${RPKG} package failed."
+       echo "ERROR: making ${RPKG} package failed." 1>&2
     fi
     return ${retval}
 }
@@ -1535,7 +1541,7 @@
 
 cleanup_misc_files ()
 {
-    [ "X${DESCRIPTION}" != "X" ] || rm -f DESCRIPTION
+    [ "${DESCRIPTION}" = "yes" ] || rm -f DESCRIPTION
     rm -f ${R_FILE}
     rm -f CATEGORIES
     rm -f COMMENT
@@ -1571,7 +1577,7 @@
 EOF
        [ -f buildlink3.mk ] && echo "- check buildlink3.mk"
 
-       [ "X${DESCRIPTION}" != "X" ] && echo "- remove DESCRIPTION."
+       [ "${DESCRIPTION}" = "yes" ] && echo "- remove DESCRIPTION."
        if [ ${RECURSIVE} -ne 0 ]; then
            cat << EOF
 
diff -r 536bda52dbb7 -r cb5b4b28c584 pkgtools/R2pkg/files/RELEASE
--- a/pkgtools/R2pkg/files/RELEASE      Sun Oct 13 08:48:23 2019 +0000
+++ b/pkgtools/R2pkg/files/RELEASE      Sun Oct 13 09:43:26 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: RELEASE,v 1.3 2019/08/08 20:14:27 brook Exp $
+$NetBSD: RELEASE,v 1.4 2019/10/13 09:43:26 rillig Exp $
 
 RELEASE
 =======
@@ -53,3 +53,11 @@
 
 * Annotate generated comments with [R2pkg] to make them easier to find.
 
+R2pkg v.0.6.1 (2019-10-13)
+------------------------
+
+* Run properly even if TMPDIR is not set.
+
+* Quote variables to prevent unintended interpolation.
+
+* Write error messages to stderr instead of stdout.



Home | Main Index | Thread Index | Old Index