Avoid duplicates of dictionaries and thesauri in distributed package

(cherry picked from commit f45202acde)
This commit is contained in:
Stephan Witt 2015-07-23 12:55:02 +02:00
parent 508110a41f
commit ab2d9c3af0
2 changed files with 19 additions and 0 deletions

View File

@ -777,6 +777,21 @@ convert_universal() {
done done
} }
deduplicate() {
find "$@" -type f -print | while read file ; do
echo $(md5 -q "$file") "$file"
done | sort | while read hash file ; do
if [ "$phash" = "$hash" ]; then
cmp -s "$pfile" "$file" && (
rm "$file"
ln -s "$pfile" "$file" && echo link for "$file" created
)
fi
phash="$hash"
pfile="$file"
done
}
copy_dictionaries() { copy_dictionaries() {
if [ -d "${ASpellInstallDir}" -a "yes" = "${aspell_dictionaries}" ]; then if [ -d "${ASpellInstallDir}" -a "yes" = "${aspell_dictionaries}" ]; then
ASpellResources="${LyxAppPrefix}/Contents/Resources" ASpellResources="${LyxAppPrefix}/Contents/Resources"
@ -792,11 +807,13 @@ copy_dictionaries() {
HunSpellResources="${LyxAppPrefix}/Contents/Resources" HunSpellResources="${LyxAppPrefix}/Contents/Resources"
if [ -d "${DictionarySourceDir}" ]; then if [ -d "${DictionarySourceDir}" ]; then
( cd "${DictionarySourceDir}" && find dicts -name .svn -prune -o -type f -print | cpio -pmdv "${HunSpellResources}" ) ( cd "${DictionarySourceDir}" && find dicts -name .svn -prune -o -type f -print | cpio -pmdv "${HunSpellResources}" )
deduplicate "${HunSpellResources}"/dicts
fi fi
fi fi
if [ -d "${DictionarySourceDir}" -a "yes" = "${thesaurus_deployment}" ]; then if [ -d "${DictionarySourceDir}" -a "yes" = "${thesaurus_deployment}" ]; then
MyThesResources="${LyxAppPrefix}/Contents/Resources" MyThesResources="${LyxAppPrefix}/Contents/Resources"
( cd "${DictionarySourceDir}" && find thes -name .svn -prune -o -type f -print | cpio -pmdv "${MyThesResources}" ) ( cd "${DictionarySourceDir}" && find thes -name .svn -prune -o -type f -print | cpio -pmdv "${MyThesResources}" )
deduplicate "${MyThesResources}"/thes
fi fi
} }

View File

@ -97,6 +97,8 @@ What's new
- Allow automake 1.15. - Allow automake 1.15.
- Use symlinks for duplicated dictionaries and thesauri when creating the
package on Mac OS X.
** Bug fixes: ** Bug fixes:
************* *************