pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_rolling-replace pkg_rolling-replace: use ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6399fe544234
branches:  trunk
changeset: 455143:6399fe544234
user:      mcf <mcf%pkgsrc.org@localhost>
date:      Mon Jun 28 19:33:23 2021 +0000

description:
pkg_rolling-replace: use POSIX getopts(1) instead of getopt(1)

diffstat:

 pkgtools/pkg_rolling-replace/Makefile                     |   4 +-
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh |  40 ++++++--------
 2 files changed, 19 insertions(+), 25 deletions(-)

diffs (69 lines):

diff -r 4badcdc0165c -r 6399fe544234 pkgtools/pkg_rolling-replace/Makefile
--- a/pkgtools/pkg_rolling-replace/Makefile     Mon Jun 28 18:46:19 2021 +0000
+++ b/pkgtools/pkg_rolling-replace/Makefile     Mon Jun 28 19:33:23 2021 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.49 2021/04/22 08:54:18 pho Exp $
+# $NetBSD: Makefile,v 1.50 2021/06/28 19:33:23 mcf Exp $
 
-PKGNAME=       pkg_rolling-replace-0.24.12
+PKGNAME=       pkg_rolling-replace-0.24.13
 CATEGORIES=    pkgtools
 
 MAINTAINER=    gdt%NetBSD.org@localhost
diff -r 4badcdc0165c -r 6399fe544234 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Mon Jun 28 18:46:19 2021 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Mon Jun 28 19:33:23 2021 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: pkg_rolling-replace.sh,v 1.44 2021/04/22 08:54:18 pho Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.45 2021/06/28 19:33:23 mcf Exp $
 #<license>
 # Copyright (c) 2006 BBN Technologies Corp.  All rights reserved.
 #
@@ -345,29 +345,23 @@
 MAKE_VAR="IN_PKG_ROLLING_REPLACE=1"
 MAKE_VAR_SEP=" "
 
-args=$(getopt BFhknursvD:x:X:L: $*)
-if [ $? -ne 0 ]; then
-    opt_h=1
-fi
-set -- $args
-while [ $# -gt 0 ]; do
-    case "$1" in
-        -B) opt_B=-B ;;
-        -F) opt_F=1 ;;
-        -h) opt_h=1 ;;
-        -k) opt_k=1 ;;
-        -n) opt_n=1 ;;
-        -r) opt_r=1 ;;
-        -s) opt_s=1 ;;
-        -u) opt_u=1 ;;
-        -v) opt_v=1 ;;
-       -D) MAKE_VAR="${MAKE_VAR}${MAKE_VAR_SEP}$2"; MAKE_VAR_SEP=" "; shift ;;
-        -x) EXCLUDE="$EXCLUDE $(echo $2 | sed 's/,/ /g')" ; shift ;;
-        -X) REALLYEXCLUDE="$REALLYEXCLUDE $(echo $2 | sed 's/,/ /g')" ; shift ;;
-        -L) LOGPATH="$2"; shift ;;
-        --) shift; break ;;
+while getopts BFhknursvD:x:X:L: opt; do
+    case "$opt" in
+        B) opt_B=-B ;;
+        F) opt_F=1 ;;
+        h) opt_h=1 ;;
+        k) opt_k=1 ;;
+        n) opt_n=1 ;;
+        r) opt_r=1 ;;
+        s) opt_s=1 ;;
+        u) opt_u=1 ;;
+        v) opt_v=1 ;;
+        D) MAKE_VAR="${MAKE_VAR}${MAKE_VAR_SEP}$OPTARG"; MAKE_VAR_SEP=" " ;;
+        x) EXCLUDE="$EXCLUDE $(echo $OPTARG | sed 's/,/ /g')" ;;
+        X) REALLYEXCLUDE="$REALLYEXCLUDE $(echo $OPTARG | sed 's/,/ /g')" ;;
+        L) LOGPATH="$OPTARG" ;;
+        ?) opt_h=1 ;;
     esac
-    shift
 done
 
 if [ -n "$opt_h" ]; then



Home | Main Index | Thread Index | Old Index