Date: Sat, 22 Sep 2007 01:01:42 +0400 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Cc: anholt@freebsd.org Subject: Re: ports/116521: update git to 1.5.3.2 Message-ID: <20070921210142.GB97288@void.codelabs.ru> In-Reply-To: <200709212010.l8LKA1Fe031020@freefall.freebsd.org> References: <20070921200426.D73AA1AF41C@void.codelabs.ru> <200709212010.l8LKA1Fe031020@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Found one more issue with 1.5.3.2: shell scripts are using constructs like 'while case "$#" in 0) break;; esac; do ... done' for argument parsing loop that does not need external commands invocation. This works great for bash that is /bin/sh for Linux, but original /bin/sh (that FreeBSD has) skips this cycle completely. The solution is to add the case branch '*) : ;;'. It does not add any external command invocation, but does its work since ':' always returns zero. Here is the patch that should be placed into the files/ directory: --- 1.5.3.2-while-case.patch begins here --- diff -urN ./git-am.sh ../git-1.5.3.2.new/git-am.sh --- ./git-am.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-am.sh 2007-09-22 00:44:14.000000000 +0400 @@ -109,7 +109,7 @@ resolvemsg= resume= git_apply_opt= -while case "$#" in 0) break;; esac +while case "$#" in 0) break;; *) : ;; esac do case "$1" in -d=*|--d=*|--do=*|--dot=*|--dote=*|--dotes=*|--dotest=*) diff -urN ./git-clean.sh ../git-1.5.3.2.new/git-clean.sh --- ./git-clean.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-clean.sh 2007-09-22 00:44:24.000000000 +0400 @@ -26,7 +26,7 @@ rm_refuse="echo Not removing" echo1="echo" -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in -d) diff -urN ./git-commit.sh ../git-1.5.3.2.new/git-commit.sh --- ./git-commit.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-commit.sh 2007-09-22 00:44:40.000000000 +0400 @@ -89,7 +89,7 @@ only_include_assumed= untracked_files= templatefile="`git config commit.template`" -while case "$#" in 0) break;; esac +while case "$#" in 0) break;; *) : ;; esac do case "$1" in -F|--F|-f|--f|--fi|--fil|--file) diff -urN ./git-fetch.sh ../git-1.5.3.2.new/git-fetch.sh --- ./git-fetch.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-fetch.sh 2007-09-22 00:44:46.000000000 +0400 @@ -27,7 +27,7 @@ no_progress= test -t 1 || no_progress=--no-progress quiet= -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in -a|--a|--ap|--app|--appe|--appen|--append) diff -urN ./git-filter-branch.sh ../git-1.5.3.2.new/git-filter-branch.sh --- ./git-filter-branch.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-filter-branch.sh 2007-09-22 00:44:53.000000000 +0400 @@ -105,7 +105,7 @@ filter_subdir= orig_namespace=refs/original/ force= -while case "$#" in 0) usage;; esac +while case "$#" in 0) usage;; *) : ;; esac do case "$1" in --) diff -urN ./git-instaweb.sh ../git-1.5.3.2.new/git-instaweb.sh --- ./git-instaweb.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-instaweb.sh 2007-09-22 00:44:59.000000000 +0400 @@ -61,7 +61,7 @@ test -f "$fqgitdir/pid" && kill `cat "$fqgitdir/pid"` } -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in --stop|stop) diff -urN ./git-ls-remote.sh ../git-1.5.3.2.new/git-ls-remote.sh --- ./git-ls-remote.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-ls-remote.sh 2007-09-22 00:45:11.000000000 +0400 @@ -13,7 +13,7 @@ } exec= -while case "$#" in 0) break;; esac +while case "$#" in 0) break;; *) : ;; esac do case "$1" in -h|--h|--he|--hea|--head|--heads) diff -urN ./git-merge.sh ../git-1.5.3.2.new/git-merge.sh --- ./git-merge.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-merge.sh 2007-09-22 00:45:28.000000000 +0400 @@ -122,7 +122,7 @@ case "$#" in 0) usage ;; esac have_message= -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\ diff -urN ./git-mergetool.sh ../git-1.5.3.2.new/git-mergetool.sh --- ./git-mergetool.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-mergetool.sh 2007-09-22 00:45:39.000000000 +0400 @@ -268,7 +268,7 @@ cleanup_temp_files } -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in -t|--tool*) diff -urN ./git-pull.sh ../git-1.5.3.2.new/git-pull.sh --- ./git-pull.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-pull.sh 2007-09-22 00:46:11.000000000 +0400 @@ -16,7 +16,7 @@ die "You are in the middle of a conflicted merge." strategy_args= no_summary= no_commit= squash= -while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac +while case "$#,$1" in 0) break ;; *,-*) : ;; *) break ;; esac do case "$1" in -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\ diff -urN ./git-quiltimport.sh ../git-1.5.3.2.new/git-quiltimport.sh --- ./git-quiltimport.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-quiltimport.sh 2007-09-22 00:46:23.000000000 +0400 @@ -5,7 +5,7 @@ dry_run="" quilt_author="" -while case "$#" in 0) break;; esac +while case "$#" in 0) break;; *) : ;; esac do case "$1" in --au=*|--aut=*|--auth=*|--autho=*|--author=*) diff -urN ./git-rebase--interactive.sh ../git-1.5.3.2.new/git-rebase--interactive.sh --- ./git-rebase--interactive.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-rebase--interactive.sh 2007-09-22 00:46:30.000000000 +0400 @@ -317,7 +317,7 @@ done } -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in --continue) diff -urN ./git-rebase.sh ../git-1.5.3.2.new/git-rebase.sh --- ./git-rebase.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-rebase.sh 2007-09-22 00:46:40.000000000 +0400 @@ -122,7 +122,7 @@ is_interactive () { test -f "$dotest"/interactive || - while case $#,"$1" in 0,|*,-i|*,--interactive) break ;; esac + while case $#,"$1" in 0,|*,-i|*,--interactive) break ;; *) : ;; esac do shift done && test -n "$1" diff -urN ./git-repack.sh ../git-1.5.3.2.new/git-repack.sh --- ./git-repack.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-repack.sh 2007-09-22 00:47:07.000000000 +0400 @@ -9,7 +9,7 @@ no_update_info= all_into_one= remove_redundant= local= quiet= no_reuse= extra= -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in -n) no_update_info=t ;; diff -urN ./git-reset.sh ../git-1.5.3.2.new/git-reset.sh --- ./git-reset.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-reset.sh 2007-09-22 00:47:18.000000000 +0400 @@ -11,7 +11,7 @@ update= reset_type=--mixed unset rev -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in --mixed | --soft | --hard) diff -urN ./git-submodule.sh ../git-1.5.3.2.new/git-submodule.sh --- ./git-submodule.sh 2007-09-19 22:02:17.000000000 +0400 +++ ../git-1.5.3.2.new/git-submodule.sh 2007-09-22 00:47:32.000000000 +0400 @@ -251,7 +251,7 @@ done } -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in add) --- 1.5.3.2-while-case.patch ends here --- This patch will be submitted to the mainstream Git, so it can be of no value for the next version. -- Eygene
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070921210142.GB97288>