head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.30 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.28 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.26 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.24 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.22 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.20 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.18 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.16 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.14 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.12 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.10 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.8 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.6 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.4 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.2 pkgsrc-2006Q4-base:1.2; locks; strict; comment @# @; 1.2 date 2006.11.05.20.39.46; author rillig; state dead; branches; next 1.1; 1.1 date 2006.11.02.19.15.07; author rillig; state Exp; branches; next ; desc @@ 1.2 log @Removed the patches for the unportable shell scripts, as requested by Manuel Bouyer in PR 34976. Instead, added the files to CHECK_PORTABILITY_SKIP. While here, fixed PKGMANDIR. @ text @$NetBSD: patch-ec,v 1.1 2006/11/02 19:15:07 rillig Exp $ Fixed "test ==" and made the code a little shorter. There are still many little bugs left. --- examples/external-device-migrate.orig 2006-10-15 14:22:03.000000000 +0200 +++ examples/external-device-migrate 2006-11-02 20:10:17.000000000 +0100 @@@@ -55,41 +55,27 @@@@ function evaluate_params() { local step host domname typ recover filename func stype stype="" - while [ 1 ]; do - if [ "$1" == "-step" ]; then - shift - step=$1 - elif [ "$1" == "-host" ]; then - shift - host=$1 - elif [ "$1" == "-domname" ]; then - shift - domname=$1 - elif [ "$1" == "-type" ]; then - shift - typ=$1 - elif [ "$1" == "-subtype" ]; then - shift - stype="_$1" - elif [ "$1" == "-recover" ]; then - recover=1 - elif [ "$1" == "-help" ]; then - ext_dev_migrate_usage - exit - else - break - fi - shift + while [ $# -ge 1 ]; do + case "$1" in + -step) step=$2; shift 2;; + -host) host=$2; shift 2;; + -domname) domname=$2; shift 2;; + -type) type=$2; shift 2;; + -subtype) subtype=$2; shift 2;; + -recover) recover=1; shift;; + -help) ext_dev_migrate_usage; exit 0;; + *) break;; + esac done - if [ "$step" == "" -o \ - "$host" == "" -o \ - "$typ" == "" -o \ - "$domname" == "" ]; then - echo "Error: Parameter(s) missing (-step/-host/-type/-domname)" - echo "" - echo "$0 -help for usage." - exit + if [ "$step" = "" -o \ + "$host" = "" -o \ + "$typ" = "" -o \ + "$domname" = "" ]; then + echo "Error: Parameter(s) missing (-step/-host/-type/-domname)" 1>&2 + echo "" 1>&2 + echo "$0 -help for usage." 1>&2 + exit 1 fi filename="$dir/$typ$stype-migration.sh" @@@@ -99,7 +85,7 @@@@ function evaluate_params() fi . "$filename" - if [ "$recover" == "1" ]; then + if [ "$recover" = "1" ]; then func="$typ"_recover eval $func $host $domname $step $* else @@@@ -108,4 +94,4 @@@@ function evaluate_params() fi } -evaluate_params $* +evaluate_params "$@@" @ 1.1 log @Fixed "test ==" and some other bugs, as reported in PR 34976. The quality of the shell scripts is not too good ... @ text @d1 1 a1 1 $NetBSD$ @