| Summary: | update devel/git to 1.5.3.2 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Eygene Ryabinkin <rea-fbsd> | ||||
| Component: | Individual Port(s) | Assignee: | Eric Anholt <anholt> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | anholt | ||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Eygene Ryabinkin
2007-09-21 21:10:01 UTC
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
Responsible Changed From-To: freebsd-ports-bugs->anholt Over to maintainer Sat, Sep 22, 2007 at 01:01:42AM +0400, Eygene Ryabinkin wrote: > 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. According to the IEEE 1003.2, the case with no patterns matched shall return zero, so our /bin/sh is broken in this respect. Wrote the patch and filed the PR. Meanwhile, J. Hamano pointed me to the other places that has the 'while case' construct where I forgot to fix them. The corrected patch is below. --- 1.5.3.2-while-case.patch begins here --- Option parsing in the Git shell scripts uses the construct 'while case "$#" in 0) break ;; esac; do ... done'. This is neat, because it needs no external commands invocation. But for the FreeBSD's original Bourne shell (that is not fully IEEE 1003.2-compliant) the 'case' construct that has not matched patterns does not modify the exit value. As per IEEE 1003.2, it should return zero: see http://opengroup.org/onlinepubs/000095399, Shell and Utilities Volume (XCU), Case Conditional Construct. The fix is to add the case branch '*) : ;;'. It also needs no external commands invocation and it does its work, because ':' always returns zero. FreeBSD has the PR 116559, http://www.freebsd.org/cgi/query-pr.cgi?pr=116559 that fixes the shell issue. If it will be committed, this patch will not be needed anymore for systems that will have the fixed /bin/sh. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru> --- contrib/examples/git-gc.sh | 2 +- contrib/examples/git-tag.sh | 2 +- contrib/examples/git-verify-tag.sh | 2 +- git-am.sh | 2 +- git-clean.sh | 2 +- git-commit.sh | 2 +- git-fetch.sh | 2 +- git-filter-branch.sh | 2 +- git-instaweb.sh | 2 +- git-ls-remote.sh | 2 +- git-merge.sh | 2 +- git-mergetool.sh | 2 +- git-pull.sh | 2 +- git-quiltimport.sh | 2 +- git-rebase--interactive.sh | 2 +- git-rebase.sh | 4 ++-- git-repack.sh | 2 +- git-reset.sh | 2 +- git-submodule.sh | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git contrib/examples/git-gc.sh b/contrib/examples/git-gc.sh index 2ae235b..60cb348 100755 --- contrib/examples/git-gc.sh +++ contrib/examples/git-gc.sh @@ -9,7 +9,7 @@ SUBDIRECTORY_OK=Yes . git-sh-setup no_prune=: -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in --prune) diff --git contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh index 5ee3f50..26aab69 100755 --- contrib/examples/git-tag.sh +++ contrib/examples/git-tag.sh @@ -14,7 +14,7 @@ username= list= verify= LINES=0 -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in -a) diff --git contrib/examples/git-verify-tag.sh b/contrib/examples/git-verify-tag.sh index 37b0023..9a0f011 100755 --- contrib/examples/git-verify-tag.sh +++ contrib/examples/git-verify-tag.sh @@ -5,7 +5,7 @@ SUBDIRECTORY_OK='Yes' . git-sh-setup verbose= -while case $# in 0) break;; esac +while case $# in 0) break;; *) : ;; esac do case "$1" in -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose) diff --git git-am.sh b/git-am.sh index 6809aa0..0bd8d34 100755 --- git-am.sh +++ git-am.sh @@ -109,7 +109,7 @@ dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= 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 --git git-clean.sh b/git-clean.sh index a5cfd9f..1fac731 100755 --- git-clean.sh +++ git-clean.sh @@ -26,7 +26,7 @@ rmrf="rm -rf --" 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 --git git-commit.sh b/git-commit.sh index bb113e8..5f298c1 100755 --- git-commit.sh +++ git-commit.sh @@ -89,7 +89,7 @@ force_author= 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 --git git-fetch.sh b/git-fetch.sh index c3a2001..dac2d72 100755 --- git-fetch.sh +++ git-fetch.sh @@ -27,7 +27,7 @@ shallow_depth= 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 --git git-filter-branch.sh b/git-filter-branch.sh index a4b6577..02b567b 100755 --- git-filter-branch.sh +++ git-filter-branch.sh @@ -105,7 +105,7 @@ filter_tag_name= filter_subdir= orig_namespace=refs/original/ force= -while case "$#" in 0) usage;; esac +while case "$#" in 0) usage;; *) : ;; esac do case "$1" in --) diff --git git-instaweb.sh b/git-instaweb.sh index b79c6b6..c85f8c0 100755 --- git-instaweb.sh +++ git-instaweb.sh @@ -61,7 +61,7 @@ stop_httpd () { 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 --git git-ls-remote.sh b/git-ls-remote.sh index b7e5d04..4ef4341 100755 --- git-ls-remote.sh +++ git-ls-remote.sh @@ -13,7 +13,7 @@ die () { } exec= -while case "$#" in 0) break;; esac +while case "$#" in 0) break;; *) : ;; esac do case "$1" in -h|--h|--he|--hea|--head|--heads) diff --git git-merge.sh b/git-merge.sh index 3a01db0..94a50aa 100755 --- git-merge.sh +++ git-merge.sh @@ -122,7 +122,7 @@ merge_name () { 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 --git git-mergetool.sh b/git-mergetool.sh index 47a8055..0e286dd 100755 --- git-mergetool.sh +++ git-mergetool.sh @@ -268,7 +268,7 @@ merge_file () { cleanup_temp_files } -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in -t|--tool*) diff --git git-pull.sh b/git-pull.sh index 5e96d1f..722ed4e 100755 --- git-pull.sh +++ git-pull.sh @@ -16,7 +16,7 @@ test -z "$(git ls-files -u)" || 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 --git git-quiltimport.sh b/git-quiltimport.sh index 9de54d1..4039617 100755 --- git-quiltimport.sh +++ git-quiltimport.sh @@ -5,7 +5,7 @@ SUBDIRECTORY_ON=Yes 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 --git git-rebase--interactive.sh b/git-rebase--interactive.sh index abc2b1c..54e4299 100755 --- git-rebase--interactive.sh +++ git-rebase--interactive.sh @@ -317,7 +317,7 @@ do_rest () { done } -while case $# in 0) break ;; esac +while case $# in 0) break ;; *) : ;; esac do case "$1" in --continue) diff --git git-rebase.sh b/git-rebase.sh index 3bd66b0..29cfab2 100755 --- git-rebase.sh +++ git-rebase.sh @@ -122,7 +122,7 @@ finish_rb_merge () { 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" @@ -130,7 +130,7 @@ is_interactive () { is_interactive "$@" && exec git-rebase--interactive "$@" -while case "$#" in 0) break ;; esac +while case "$#" in 0) break ;; *) : ;; esac do case "$1" in --continue) diff --git git-repack.sh b/git-repack.sh index 156c5e8..aac771e 100755 --- git-repack.sh +++ git-repack.sh @@ -9,7 +9,7 @@ SUBDIRECTORY_OK='Yes' 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 --git git-reset.sh b/git-reset.sh index 1dc606f..eb92610 100755 --- git-reset.sh +++ git-reset.sh @@ -11,7 +11,7 @@ require_work_tree 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 --git git-submodule.sh b/git-submodule.sh index 3320998..78a25ad 100755 --- git-submodule.sh +++ git-submodule.sh @@ -251,7 +251,7 @@ modules_list() 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 --- -- Eygene anholt 2007-10-09 21:18:06 UTC
FreeBSD ports repository
Modified files:
devel/git Makefile distinfo pkg-plist
devel/git/files patch-Makefile
Added files:
devel/git/files patch-while-case
Log:
Update git to 1.5.3.2.
This update brings in OPTIONS for GUI tools (on) and dependencies to make
the SVN tools work (off). It also should handle the openssl dependency
correctly now. Both of these changes are variations I made on the PR
submissions for those changes.
PR: [1] ports/116521 (1.5.3.2)
[2] ports/114472 (openssl issues)
Submitted by: [1] Eygene Ryabinkin <rea-fbsd@codelabs.ru>
[2] Ed Schouten <ed@fxq.nl>
Revision Changes Path
1.24 +30 -9 ports/devel/git/Makefile
1.15 +6 -6 ports/devel/git/distinfo
1.7 +7 -3 ports/devel/git/files/patch-Makefile
1.1 +298 -0 ports/devel/git/files/patch-while-case (new)
1.13 +16 -3 ports/devel/git/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed, but using OPTIONS instead of just env vars. Thanks! |