| 1 |
#!/usr/bin/env bash |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 5 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 6 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 |
# |
| 9 |
|
| 10 |
# This will reorder icon-themes/*/links.txt to the right order |
| 11 |
|
| 12 |
for I in icon-themes/*/links.txt ; do |
| 13 |
D="${I%/links.txt}" |
| 14 |
cat "$I" | while read LINK ORIG |
| 15 |
do |
| 16 |
if [ -f "$D/$LINK" -a -f "$D/$ORIG" ] ; then |
| 17 |
if diff "$D/$LINK" "$D/$ORIG" >/dev/null 2>&1 ; then |
| 18 |
echo "$I: removing $LINK from git: both $LINK and $ORIG are the same files" 1>&2 |
| 19 |
git rm "$D/$LINK" 1>/dev/null |
| 20 |
echo $LINK $ORIG |
| 21 |
else |
| 22 |
echo "$I: link and orig differs, check the images, and remove manually: $LINK $ORIG" 1>&2 |
| 23 |
echo $LINK $ORIG |
| 24 |
fi |
| 25 |
elif [ -f "$D/$LINK" ] ; then |
| 26 |
echo "$I: swapping to right order: $ORIG $LINK" 1>&2 |
| 27 |
echo $ORIG $LINK |
| 28 |
elif [ -n "$LINK" -a "${LINK:0:1}" != "#" -a ! -f "$D/$LINK" -a ! -f "$D/$ORIG" ] ; then |
| 29 |
echo "$I: neither exists, removing the line: $LINK $ORIG" 1>&2 |
| 30 |
else |
| 31 |
echo $LINK $ORIG |
| 32 |
fi |
| 33 |
done > "$I-fixed" |
| 34 |
|
| 35 |
mv "$I-fixed" "$I" |
| 36 |
done |
| 37 |
|
| 38 |
# vim: set expandtab sw=4 ts=4: |