[X2Go-Commits] [x2goclient] 57/139: deduplicate.sh: add duplicates-to-real mapping.

git-admin at x2go.org git-admin at x2go.org
Wed Jan 13 17:27:36 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 b2e75908ee521303449c5fba622ebf845a781782
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 142b25f..33b16d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -113,6 +113,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.
   * 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 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