summaryrefslogtreecommitdiffstats
path: root/kde-tde/tde_mimetype_conversion
diff options
context:
space:
mode:
Diffstat (limited to 'kde-tde/tde_mimetype_conversion')
-rwxr-xr-xkde-tde/tde_mimetype_conversion32
1 files changed, 19 insertions, 13 deletions
diff --git a/kde-tde/tde_mimetype_conversion b/kde-tde/tde_mimetype_conversion
index cd2c744..815b815 100755
--- a/kde-tde/tde_mimetype_conversion
+++ b/kde-tde/tde_mimetype_conversion
@@ -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 "==================================================="