| @@ -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=$$ |
53 | quiet=false | | 53 | quiet=false |
54 | recursive=false | | 54 | recursive=false |
55 | update=false | | 55 | update=false |
56 | use_editor=yes | | 56 | use_editor=yes |
57 | verbose=0 | | 57 | verbose=0 |
58 | | | 58 | |
59 | keep_description=no | | 59 | keep_description=no |
60 | | | 60 | |
61 | args="" | | 61 | args="" |
62 | while getopts cDehqruVvE:M:L:P: arg | | 62 | while getopts cDehqruVvE:M:L:P: arg |
63 | do | | 63 | do |
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 |
84 | done | | 84 | done |
85 | shift $((OPTIND - 1)) | | 85 | shift $((OPTIND - 1)) |
86 | | | 86 | |
87 | # Update $args for recursive call | | 87 | # Update $args for recursive call |
88 | args="$args -L $((level + 1)) -P $pid" | | 88 | args="$args -L $((level + 1)) -P $pid" |
89 | | | 89 | |
90 | if [ ${#} -eq 0 ]; then | | 90 | if [ ${#} -eq 0 ]; then |