wok-next view xcursor-comix/stuff/symdup.sh @ rev 19988

Add qt5 - now it's look good enough
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Oct 20 03:29:40 2017 +0300 (2017-10-20)
parents
children
line source
1 # substitute repeated files by symlinks
2 for path in $install/usr/share/icons/*; do
3 # make symlinks separately for every cursor theme
5 md5file=$(mktemp)
6 find $path -type f -exec md5sum '{}' \; | sort > $md5file
8 for md in $(uniq -d -w32 $md5file | cut -c1-32); do
9 # group of similar files
10 similar="$(grep $md $md5file | cut -c35-)"
12 # find shortest filename
13 shortest=$(echo "$similar" | cut -d' ' -f1)
14 for line in $(echo $similar); do
15 [ "${#line}" -lt "${#shortest}" ] && shortest="$line"
16 done
18 # make symlinks to the file with shortest filename
19 for file in $similar; do
20 [ "$shortest" != "$file" ] && ln -sf $shortest $file
21 done
22 done
23 rm "$md5file"
24 done
26 # make all symlinks relative
27 symlinks -crs $install