[X2Go-Commits] [x2goclient] 56/197: deduplicate.sh: add duplicates-to-real mapping.
git-admin at x2go.org
git-admin at x2go.org
Thu Jun 30 23:52:48 CEST 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 287e702ba2b69b6fdc36d98c81eefdc3ff71f58a
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Aug 26 21:40:13 2015 +0200
deduplicate.sh: add duplicates-to-real mapping.
---
debian/changelog | 1 +
deduplicate.sh | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 38bd83c..429299e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -132,6 +132,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium
library path. Putting everything into a single place is a stupid idea.
- deduplicate.sh: add new, more or less Proof of Concept, and Work in
Progress file deduplication script.
+ - deduplicate.sh: add duplicates-to-real mapping.
* debian/control:
- Maintainer change in package: X2Go Developers <x2go-dev at lists.x2go.org>.
- Uploaders: add myself. Also, force a rebuild due to the changed
diff --git a/deduplicate.sh b/deduplicate.sh
index 7c4de14..19dc584 100755
--- a/deduplicate.sh
+++ b/deduplicate.sh
@@ -77,3 +77,31 @@ echo "New value for all_files:"
for entry in ${all_files[@]}; do
echo "${entry}"
done
+
+echo "Duplicates-to-real map:"
+# Build complementary array to duplicates.
+typeset -a to_files
+for entry in ${duplicates[@]}; do
+ typeset filename="$(basename "${entry}")"
+
+ for all_entry in ${all_files[@]}; do
+ typeset all_entry_filename="$(basename "${all_entry}")"
+
+ if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then
+ if [ "${filename}" = "${all_entry_filename}" ]; then
+ to_files+=( "${all_entry}" )
+
+ echo "${entry} => ${all_entry}"
+
+ # There should be only one entry matching, so we can save a bit of time and break out of the loop.
+ # Even more importantly, we only want one entry for each duplicates entry anyway...
+ break
+ fi
+ else
+ echo "WARNING: empty file name while matching duplicates with non-duplicates." >&2
+ echo "WARNING: duplicate entry: \"${entry}\"" >&2
+ echo "WARNING: real entry: \"${all_entry}\"" >&2
+ exit 1
+ fi
+ done
+done
--
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