[X2Go-Commits] [x2goclient] 56/126: deduplicate.sh: add duplicates-to-real mapping.
git-admin at x2go.org
git-admin at x2go.org
Wed Dec 2 23:19:26 CET 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/osx
in repository x2goclient.
commit b8ce054fb12f47ae8cb70e6b78eca540c1044584
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 aaa9b92..6ecdfa6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -108,6 +108,7 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low
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.
[ Oleksandr Shneyder ]
* New upstream release (4.0.5.1):
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