don't throw away command output when packaging installsets
[LibreOffice.git] / bin / removetooltip_markups.sh
blob056c9753e5101c272508bb9fb012a1398ad5334a
1 #!/usr/bin/env 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 # Run the script in the core directory to remove all tooltip_markup
11 # properties from the .ui files
13 LOG_FILE="modified-$(date +%s).log"
15 removeTooltipMarkup()
17 LINE=$(grep -n "<property name=\"tooltip_markup\"" $1 | cut -f 1 -d ':')
18 TEXT=$(grep "<property name=\"tooltip_markup\"" $1)
19 grep -v "<property name=\"tooltip_markup\"" $1 > temp && mv temp $1
20 echo "removed $TEXT from $1 at line $LINE" >> $LOG_FILE
23 changeTooltipMarkup()
25 LINE=$(grep -n "<property name=\"tooltip_markup\"" $1 | cut -f 1 -d ':')
26 sed "s/tooltip_markup/tooltip_text/g" $i > temp && mv temp $1
27 echo "renamed tooltip_markup from $1 at line $LINE" >> $LOG_FILE
30 checkTooltipMarkup()
32 TEXT=`grep "<property name=\"tooltip_text\"" $1`
33 MARKUP=`grep "<property name=\"tooltip_markup\"" $1`
35 if [[ $MARKUP ]] && [[ $TEXT ]]
36 then
37 removeTooltipMarkup "$1"
39 if [[ $MARKUP ]] && [[ ! $TEXT ]]
40 then
41 changeTooltipMarkup "$1"
45 shopt -s globstar
46 echo " " > $LOG_FILE
47 for i in **/*.ui; do
48 echo -n "."
49 checkTooltipMarkup "$i"
50 done
52 echo
53 echo "Done!"