Thu Mar 5 17:07:54 2020 UTC ()
Add a hyphen (-) to each stored argument so recursive calls work.

In order for recursive calls of R2pkg to work, they must receive the same
set of arguments as the original.  Previous argument handling stripped the
hyphen (-) from each argument; this explicitly restores it.


(brook)
diff -r1.14 -r1.15 pkgsrc/pkgtools/R2pkg/files/R2pkg.sh

cvs diff -r1.14 -r1.15 pkgsrc/pkgtools/R2pkg/files/R2pkg.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/R2pkg/files/R2pkg.sh 2020/01/13 18:06:47 1.14
+++ pkgsrc/pkgtools/R2pkg/files/R2pkg.sh 2020/03/05 17:07:54 1.15
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#!/bin/sh 1#!/bin/sh
2# $NetBSD: R2pkg.sh,v 1.14 2020/01/13 18:06:47 rillig Exp $ 2# $NetBSD: R2pkg.sh,v 1.15 2020/03/05 17:07:54 brook Exp $
3# 3#
4# Copyright (c) 2014,2015,2016,2017,2018,2019 4# Copyright (c) 2014,2015,2016,2017,2018,2019
5# Brook Milligan. All rights reserved. 5# Brook Milligan. All rights reserved.
6# 6#
7# Redistribution and use in source and binary forms, with or without 7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 8# modification, are permitted provided that the following conditions
9# are met: 9# are met:
10# 1. Redistributions of source code must retain the above copyright 10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 14# documentation and/or other materials provided with the distribution.
15# 3. Neither the name of the author nor the names of any contributors 15# 3. Neither the name of the author nor the names of any contributors
@@ -53,38 +53,38 @@ pid=$$ @@ -53,38 +53,38 @@ pid=$$
53quiet=false 53quiet=false
54recursive=false 54recursive=false
55update=false 55update=false
56use_editor=yes 56use_editor=yes
57verbose=0 57verbose=0
58 58
59keep_description=no 59keep_description=no
60 60
61args="" 61args=""
62while getopts cDehqruVvE:M:L:P: arg 62while getopts cDehqruVvE:M:L:P: arg
63do 63do
64 case $arg in 64 case $arg in
65 # options without arguments 65 # options without arguments
66 c) args="$args $arg"; update=false;; 66 c) args="$args -$arg"; update=false;;
67 D) args="$args $arg"; keep_description=yes;; 67 D) args="$args -$arg"; keep_description=yes;;
68 e) args="$args $arg"; use_editor=no;; 68 e) args="$args -$arg"; use_editor=no;;
69 h) echo "$usage"; exit 0;; 69 h) echo "$usage"; exit 0;;
70 q) args="$args $arg"; quiet=true;; 70 q) args="$args -$arg"; quiet=true;;
71 r) args="$args $arg"; recursive=true;; 71 r) args="$args -$arg"; recursive=true;;
72 u) args="$args $arg"; update=true;; 72 u) args="$args -$arg"; update=true;;
73 V) echo "$name v$vers"; exit 0;; 73 V) echo "$name v$vers"; exit 0;;
74 v) args="$args $arg"; verbose=$((verbose + 1));; 74 v) args="$args -$arg"; verbose=$((verbose + 1));;
75 # options taking arguments 75 # options taking arguments
76 E) args="$args $arg $OPTARG"; PKGEDITOR=$OPTARG;; 76 E) args="$args -$arg $OPTARG"; PKGEDITOR=$OPTARG;;
77 M) args="$args $arg $OPTARG"; maintainer_email=$OPTARG;; 77 M) args="$args -$arg $OPTARG"; maintainer_email=$OPTARG;;
78 # options for recursion; only for internal use 78 # options for recursion; only for internal use
79 L) level=$((OPTARG + 0));; 79 L) level=$((OPTARG + 0));;
80 P) pid=$((OPTARG + 0));; 80 P) pid=$((OPTARG + 0));;
81 # unknown options 81 # unknown options
82 \?) echo "$usage" 1>&2; exit 1;; 82 \?) echo "$usage" 1>&2; exit 1;;
83 esac 83 esac
84done 84done
85shift $((OPTIND - 1)) 85shift $((OPTIND - 1))
86 86
87# Update $args for recursive call 87# Update $args for recursive call
88args="$args -L $((level + 1)) -P $pid" 88args="$args -L $((level + 1)) -P $pid"
89 89
90if [ ${#} -eq 0 ]; then 90if [ ${#} -eq 0 ]; then