wok-next view xcursor-comix/stuff/symdup.sh @ rev 21369
updated mgetty again (1.1.37 -> 1.2.1)
author | Hans-G?nter Theisgen |
---|---|
date | Thu Apr 16 09:53:00 2020 +0100 (2020-04-16) |
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