Browse Source

Performance optimization of kde-tde conversion scripts

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 3 years ago
parent
commit
95b74a657c
4 changed files with 68 additions and 60 deletions
  1. +11
    -9
      kde-tde/convert_existing_kde3_app_to_tde
  2. +19
    -25
      kde-tde/tde_action_conversion
  3. +19
    -13
      kde-tde/tde_device_conversion
  4. +19
    -13
      kde-tde/tde_mimetype_conversion

+ 11
- 9
kde-tde/convert_existing_kde3_app_to_tde View File

@@ -501,15 +501,17 @@ xargs -r0 sed -ri \
-e "s|kde toolbar widget|tde toolbar widget|g"

# Convert desktop files
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i '/^Keyword/ { s,\,,;,g }' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^ServiceTypes=/X-TDE-ServiceTypes=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^ServiceTypes\[\(.*\)\]=/X-TDE-ServiceTypes\[\1\]=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^ExcludeServiceTypes=/X-TDE-ExcludeServiceTypes=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^ExcludeServiceTypes\[\(.*\)\]=/X-TDE-ExcludeServiceTypes\[\1\]=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^DocPath=/X-DocPath=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^DocPath\[\(.*\)\]=/X-DocPath\[\1\]=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^InitialPreference=/X-TDE-InitialPreference=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i 's/^InitialPreference\[\(.*\)\]=/X-TDE-InitialPreference\[\1\]=/g' {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -print0 | \
xargs -r0 sed -i \
-e '/^Keyword/ { s,\,,;,g }' \
-e 's/^ServiceTypes=/X-TDE-ServiceTypes=/g' \
-e 's/^ServiceTypes\[\(.*\)\]=/X-TDE-ServiceTypes\[\1\]=/g' \
-e 's/^ExcludeServiceTypes=/X-TDE-ExcludeServiceTypes=/g' \
-e 's/^ExcludeServiceTypes\[\(.*\)\]=/X-TDE-ExcludeServiceTypes\[\1\]=/g' \
-e 's/^DocPath=/X-DocPath=/g' \
-e 's/^DocPath\[\(.*\)\]=/X-DocPath\[\1\]=/g' \
-e 's/^InitialPreference=/X-TDE-InitialPreference=/g' \
-e 's/^InitialPreference\[\(.*\)\]=/X-TDE-InitialPreference\[\1\]=/g'

# Rename files
find . -name "kio_*" | while read f; do mv "${f}" "${f/kio_/tdeio_}"; done

+ 19
- 25
kde-tde/tde_action_conversion View File

@@ -34,32 +34,38 @@ function rename_files {
}

function convert_files {
[ -d ~/tde-git/tde/main ] && \
cd ~/tde-git/tde/main

echo "==================================================="
echo "Converting $1..."

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet(\"$1\"/IconSet(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet( \"$1\"/IconSet( \"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "\(Icon\(Set\|\)( \?\)\"$1\"" | \
xargs -r0 sed -i "s/\(Icon\(Set\|\)( \?\)\"$1\"/\1\"$2\"/g"

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon(\"$1\"/Icon(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon( \"$1\"/Icon( \"$2\"/g" {} \;
find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "<iconset>\"$1\"" | \
xargs -r0 sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g"

find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -exec sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g" {} \;
find ./ -type f -iregex ".*\.\(directory\|desktop\|protocol\)" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "Icon=$1" | \
xargs -r0 sed -i "s/Icon=$1/Icon=$2/g"

find ./ -type f -iname "*.directory" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.protocol" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;

find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -exec sed -i "s/icon=\"$1\"/icon=\"$2\"/g" {} \;
find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "icon=\"$1\"" | \
xargs -r0 sed -i "s/icon=\"$1\"/icon=\"$2\"/g"

echo "==================================================="
echo "Renaming $1..."
cd $WORKDIR/tdelibs/pics
[ -d $WORKDIR/tdelibs/pics ] && \
cd $WORKDIR/tdelibs/pics && \
rename_files $1 $2
cd $WORKDIR/tdeartwork/IconThemes
[ -d $WORKDIR/tdeartwork/IconThemes ] && \
cd $WORKDIR/tdeartwork/IconThemes && \
rename_files $1 $2
cd $WORKDIR/tdeaccessibility/IconThemes
[ -d $WORKDIR/tdeaccessibility/IconThemes ] && \
cd $WORKDIR/tdeaccessibility/IconThemes && \
rename_files $1 $2
cd $WORKDIR
echo "==================================================="
@@ -146,15 +152,3 @@ convert_files "input_devices_settings" "preferences-desktop-peripherals"
convert_files "kcmsystem" "preferences-system"
convert_files "personal" "preferences-desktop-personal"
convert_files "looknfeel" "preferences-desktop"
convert_files "package_development" "applications-development"
convert_files "package_games" "applications-games"
convert_files "package_graphics" "applications-graphics"
convert_files "package_network" "applications-internet"
convert_files "package_multimedia" "applications-multimedia"
convert_files "package_wordprocessing" "applications-office"
convert_files "edu_science" "applications-science"
convert_files "package_utilities" "applications-utilities"
convert_files "looknfeel" "preferences-desktop"
convert_files "input_devices_settings" "preferences-desktop-peripherals"
convert_files "personal" "preferences-desktop-personal"
convert_files "kcmsystem" "preferences-system"

+ 19
- 13
kde-tde/tde_device_conversion View File

@@ -34,32 +34,38 @@ function rename_files {
}

function convert_files {
[ -d ~/tde-git/tde/main ] && \
cd ~/tde-git/tde/main

echo "==================================================="
echo "Converting $1..."

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet(\"$1\"/IconSet(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet( \"$1\"/IconSet( \"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "\(Icon\(Set\|\)( \?\)\"$1\"" | \
xargs -r0 sed -i "s/\(Icon\(Set\|\)( \?\)\"$1\"/\1\"$2\"/g"

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon(\"$1\"/Icon(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon( \"$1\"/Icon( \"$2\"/g" {} \;
find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "<iconset>\"$1\"" | \
xargs -r0 sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g"

find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -exec sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g" {} \;
find ./ -type f -iregex ".*\.\(directory\|desktop\|protocol\)" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "Icon=$1" | \
xargs -r0 sed -i "s/Icon=$1/Icon=$2/g"

find ./ -type f -iname "*.directory" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.protocol" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;

find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -exec sed -i "s/icon=\"$1\"/icon=\"$2\"/g" {} \;
find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "icon=\"$1\"" | \
xargs -r0 sed -i "s/icon=\"$1\"/icon=\"$2\"/g"

echo "==================================================="
echo "Renaming $1..."
cd $WORKDIR/tdelibs/pics
[ -d $WORKDIR/tdelibs/pics ] && \
cd $WORKDIR/tdelibs/pics && \
rename_files $1 $2
cd $WORKDIR/tdeartwork/IconThemes
[ -d $WORKDIR/tdeartwork/IconThemes ] && \
cd $WORKDIR/tdeartwork/IconThemes && \
rename_files $1 $2
cd $WORKDIR/tdeaccessibility/IconThemes
[ -d $WORKDIR/tdeaccessibility/IconThemes ] && \
cd $WORKDIR/tdeaccessibility/IconThemes && \
rename_files $1 $2
cd $WORKDIR
echo "==================================================="

+ 19
- 13
kde-tde/tde_mimetype_conversion View File

@@ -34,32 +34,38 @@ function rename_files {
}

function convert_files {
[ -d ~/tde-git/tde/main ] && \
cd ~/tde-git/tde/main

echo "==================================================="
echo "Converting $1..."

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet(\"$1\"/IconSet(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/IconSet( \"$1\"/IconSet( \"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "\(Icon\(Set\|\)( \?\)\"$1\"" | \
xargs -r0 sed -i "s/\(Icon\(Set\|\)( \?\)\"$1\"/\1\"$2\"/g"

find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon(\"$1\"/Icon(\"$2\"/g" {} \;
find ./ -type f -iname "*.c*" -not -iwholename '*.git*' -exec sed -i "s/Icon( \"$1\"/Icon( \"$2\"/g" {} \;
find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "<iconset>\"$1\"" | \
xargs -r0 sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g"

find ./ -type f -iname "*.ui*" -not -iwholename '*.git*' -exec sed -i "s/<iconset>\"$1\"/<iconset>\"$2\"/g" {} \;
find ./ -type f -iregex ".*\.\(directory\|desktop\|protocol\)" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "Icon=$1" | \
xargs -r0 sed -i "s/Icon=$1/Icon=$2/g"

find ./ -type f -iname "*.directory" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.desktop" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;
find ./ -type f -iname "*.protocol" -not -iwholename '*.git*' -exec sed -i "s/Icon=$1/Icon=$2/g" {} \;

find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -exec sed -i "s/icon=\"$1\"/icon=\"$2\"/g" {} \;
find ./ -type f -iname "*.rc" -not -iwholename '*.git*' -print0 | \
xargs -r0 grep -ZIl "icon=\"$1\"" | \
xargs -r0 sed -i "s/icon=\"$1\"/icon=\"$2\"/g"

echo "==================================================="
echo "Renaming $1..."
cd $WORKDIR/tdelibs/pics
[ -d $WORKDIR/tdelibs/pics ] && \
cd $WORKDIR/tdelibs/pics && \
rename_files $1 $2
cd $WORKDIR/tdeartwork/IconThemes
[ -d $WORKDIR/tdeartwork/IconThemes ] && \
cd $WORKDIR/tdeartwork/IconThemes && \
rename_files $1 $2
cd $WORKDIR/tdeaccessibility/IconThemes
[ -d $WORKDIR/tdeaccessibility/IconThemes ] && \
cd $WORKDIR/tdeaccessibility/IconThemes && \
rename_files $1 $2
cd $WORKDIR
echo "==================================================="

Loading…
Cancel
Save