[X2Go-Commits] [x2goclient] 63/139: deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly.
git-admin at x2go.org
git-admin at x2go.org
Sun Jan 17 06:03:06 CET 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/osx
in repository x2goclient.
commit d58428f4d1fd70d1bfa8347d74b44a780cf0cb0d
Author: Mihai Moldovan <ionic at ionic.de>
Date: Thu Aug 27 04:48:32 2015 +0200
deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly.
---
debian/changelog | 2 ++
deduplicate.sh | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2d128fa..0b253bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -127,6 +127,8 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low
- deduplicate.sh: add first skeleton for library dependency rewriting of
deleted duplicates.
- deduplicate.sh: correctly unset an array element.
+ - deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle
+ "sparse" arrays correctly.
* debian/control:
- Change apache2-dev | libc6-dev build dependency back to apache2-dev
only. Otherwise, apache2-dev is not installed at all, even though
diff --git a/deduplicate.sh b/deduplicate.sh
index b7d066a..d932fbb 100755
--- a/deduplicate.sh
+++ b/deduplicate.sh
@@ -70,7 +70,7 @@ for entry in ${duplicates[@]}; do
done
typeset -i i="0"
-for ((i = 0; i < ${#duplicates[@]}; ++i)); do
+for i in "${!duplicates[@]}"; do
entry="${duplicates[${i}]}"
typeset special_file_regex=""
for special_file_regex in ${special_files_regex[@]}; do
@@ -91,7 +91,7 @@ done
for entry in ${duplicates[@]}; do
echo "rm -v ${base_dir}/${entry}"
typeset -i i="0"
- for ((i = 0; i < ${#all_files[@]}; ++i)); do
+ for i in "${!all_files[@]}"; do
typeset all_entry="${all_files[${i}]}"
typeset relative_path="${all_entry##"${base_dir}/"}"
if [ "${relative_path}" = "${entry}" ]; then
--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list