lok: avoid ILibreOfficeKitNotifier null ptr de-reference on shutdown.
[LibreOffice.git] / bin / sanitize-image-links
blob6b5a2ec485b0938254117cbf9d8f1e14732529a5
1 #!/bin/bash
3 # This file is part of the LibreOffice project.
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/.
10 # This will reorder icon-themes/*/links.txt to the right order
12 for I in icon-themes/*/links.txt ; do
13 D="${I%/links.txt}"
14 cat "$I" | while read LINK ORIG
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
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
33 done > "$I-fixed"
35 mv "$I-fixed" "$I"
36 done
38 # vim: set expandtab sw=4 ts=4: