Update conversion scripts

pull/1/head
Timothy Pearson 10 years ago
parent f36177d904
commit 321c708ddb

@ -1,4 +1,13 @@
#!/bin/bash #!/bin/bash
#
# Licensed under the GPL v2
THISSCRIPT=$(readlink -f $0)
if [[ ! -e "$THISSCRIPT" ]]; then
echo "Unable to find myself! Exiting..."
exit 1
fi
SCRIPTPATH=`dirname $THISSCRIPT`
find ./ -type f -not -iwholename '*.git*' -print0 | find ./ -type f -not -iwholename '*.git*' -print0 |
xargs -r0 grep -ElI "([^a-zA-Z0-9]|^)(\ xargs -r0 grep -ElI "([^a-zA-Z0-9]|^)(\
@ -508,4 +517,4 @@ find . -name "*.kdevelop" | while read f; do mv "${f}" "${f/.kdevelop/.tdevelop}
find . -name "kdewidgets*" | while read f; do mv "${f}" "${f/kdewidgets/tdewidgets}"; done find . -name "kdewidgets*" | while read f; do mv "${f}" "${f/kdewidgets/tdewidgets}"; done
# Update icon names (optional) # Update icon names (optional)
./convert_kde3_icon_names_to_xdg_standards $SCRIPTPATH/convert_kde3_icon_names_to_xdg_standards

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# (c) 2014 Timothy Pearson # (c) 2014-2015 Timothy Pearson
# All Rights Reserved # All Rights Reserved
# #
# WARNING # WARNING
@ -8,5 +8,13 @@
# Hand editing will likely be required after running to ensure all icon names have been updated # Hand editing will likely be required after running to ensure all icon names have been updated
# See http://trinity.etherpad.trinitydesktop.org/60 for a mapping of old KDE3 names to modern XDG names # See http://trinity.etherpad.trinitydesktop.org/60 for a mapping of old KDE3 names to modern XDG names
./tde_mimetype_conversion THISSCRIPT=$(readlink -f $0)
./tde_action_conversion if [[ ! -e "$THISSCRIPT" ]]; then
echo "Unable to find myself! Exiting..."
exit 1
fi
SCRIPTPATH=`dirname $THISSCRIPT`
$SCRIPTPATH/tde_mimetype_conversion
$SCRIPTPATH/tde_action_conversion
$SCRIPTPATH/tde_device_conversion

@ -0,0 +1,135 @@
#!/bin/bash
#
# (c) 2015 Timothy Pearson
# All Rights Reserved
#
# WARNING
# This script is not complete!
# Hand editing will likely be required after running to ensure all icon names have been updated
# See http://trinity.etherpad.trinitydesktop.org/60 for a mapping of old KDE3 names to modern XDG names
WORKDIR=$PWD
function rename_files {
echo '#!/bin/bash' > /tmp/rename_mime_files
echo '' >> /tmp/rename_mime_files
echo 'cd $1' >> /tmp/rename_mime_files
echo '' >> /tmp/rename_mime_files
echo 'BASEDIR=${PWD##*/}' >> /tmp/rename_mime_files
echo "ORIGNAME='$1'" >> /tmp/rename_mime_files
echo "NEWNAME='$2'" >> /tmp/rename_mime_files
echo '' >> /tmp/rename_mime_files
echo 'if [[ "$BASEDIR" == ".git" ]]; then' >> /tmp/rename_mime_files
echo ' echo "Ignoring .git directory"' >> /tmp/rename_mime_files
echo ' exit 0' >> /tmp/rename_mime_files
echo 'fi' >> /tmp/rename_mime_files
echo '' >> /tmp/rename_mime_files
echo 'ls -d * | sed "s/\(.*\)mime-$ORIGNAME\.png\(.*\)$/git mv \"&\" \"\1mime-$NEWNAME\.png\2\"/" | grep mv | sh' >> /tmp/rename_mime_files
echo 'ls -d * | sed "s/$ORIGNAME\.png\(.*\)$/git mv \"&\" \"$NEWNAME\.png\1\"/" | grep mv | sh' >> /tmp/rename_mime_files
chmod 755 /tmp/rename_mime_files
find ./ -type d -exec /tmp/rename_mime_files {} \; &> /dev/null
rm /tmp/rename_mime_files
}
function convert_files {
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*' -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*' -exec sed -i "s/<iconset>\"$1\"/<iconset>\"$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" {} \;
echo "==================================================="
echo "Renaming $1..."
cd $WORKDIR/tdelibs/pics
rename_files $1 $2
cd $WORKDIR/tdeartwork/IconThemes
rename_files $1 $2
cd $WORKDIR/tdeaccessibility/IconThemes
rename_files $1 $2
cd $WORKDIR
echo "==================================================="
echo "Still found in files:"
echo "==================================================="
find . -not -iwholename '*.git*' | xargs grep "\"$1\"" -sl
echo "==================================================="
echo ""
}
#convert_files "system" "computer"
convert_files "hdd_unmount" "drive-harddisk"
convert_files "hdd_mount" "drive-harddisk-mounted"
convert_files "hdd_unmount_encrypt" "drive-harddisk-encrypted"
convert_files "hdd_unmount_decrypt" "drive-harddisk-decrypted"
convert_files "hdd_mount_decrypt" "drive-harddisk-decrypted-mounted"
#convert_files "hicolor/32x32/apps/kxkb.png" "input-keyboard"
#convert_files "mouse" "input-mouse"
#convert_files "tablet" "input-tablet"
convert_files "sd_mmc_unmount" "media-flash-sd_mmc"
convert_files "sd_mmc_mount" "media-flash-sd_mmc-mounted"
convert_files "sd_mmc_unmount_encrypt" "media-flash-sd_mmc-encrypted"
convert_files "sd_mmc_unmount_decrypt" "media-flash-sd_mmc-decrypted"
convert_files "sd_mmc_mount_decrypt" "media-flash-sd_mmc-decrypted-mounted"
convert_files "usbpendrive_unmount" "media-flash-usb"
convert_files "usbpendrive_mount" "media-flash-usb-mounted"
convert_files "usbpendrive_unmount_encrypt" "media-flash-usb-encrypted"
convert_files "usbpendrive_unmount_decrypt" "media-flash-usb-decrypted"
convert_files "usbpendrive_mount_decrypt" "media-flash-usb-decrypted-mounted"
convert_files "smart_media_unmount" "media-flash-smart_media"
convert_files "smart_media_mount" "media-flash-smart_media-mounted"
convert_files "smart_media_unmount_encrypt" "media-flash-smart_media-encrypted"
convert_files "smart_media_unmount_decrypt" "media-flash-smart_media-decrypted"
convert_files "smart_media_mount_decrypt" "media-flash-smart_media-decrypted-mounted"
convert_files "memory_stick_unmount" "media-flash-memory_stick"
convert_files "memory_stick_mount" "media-flash-memory_stick-mounted"
convert_files "memory_stick_unmount_encrypt" "media-flash-memory_stick-encrypted"
convert_files "memory_stick_unmount_decrypt" "media-flash-memory_stick-decrypted"
convert_files "memory_stick_mount_decrypt" "media-flash-memory_stick-decrypted-mounted"
convert_files "compact_flash_unmount" "media-flash-compact_flash"
convert_files "compact_flash_mount" "media-flash-compact_flash-mounted"
convert_files "compact_flash_unmount_encrypt" "media-flash-compact_flash-encrypted"
convert_files "compact_flash_unmount_decrypt" "media-flash-compact_flash-decrypted"
convert_files "compact_flash_mount_decrypt" "media-flash-compact_flash-decrypted-mounted"
convert_files "3floppy_unmount" "media-floppy-3_5"
convert_files "3floppy_mount" "media-floppy-3_5-mounted"
convert_files "5floppy_unmount" "media-floppy-5_14"
convert_files "5floppy_mount" "media-floppy-5_14-mounted"
convert_files "zip_unmount" "media-floppy-zip"
convert_files "zip_mount" "media-floppy-zip-mounted"
convert_files "cdrom_unmount" "media-optical-cdrom"
convert_files "cdrom_mount" "media-optical-cdrom-mounted"
convert_files "cdrom_unmount_encrypt" "media-optical-cdrom-encrypted"
convert_files "cdrom_unmount_decrypt" "media-optical-cdrom-decrypted"
convert_files "cdrom_mount_decrypt" "media-optical-cdrom-decrypted-mounted"
convert_files "cdwriter_unmount" "media-optical-cdwriter"
convert_files "cdwriter_mount" "media-optical-cdwriter-mounted"
convert_files "cdwriter_unmount_encrypt" "media-optical-cdwriter-encrypted"
convert_files "cdwriter_unmount_decrypt" "media-optical-cdwriter-decrypted"
convert_files "cdwriter_mount_decrypt" "media-optical-cdwriter-decrypted-mounted"
convert_files "dvd_unmount" "media-optical-dvd"
convert_files "dvd_mount" "media-optical-dvd-mounted"
convert_files "dvd_unmount_encrypt" "media-optical-dvd-encrypted"
convert_files "dvd_unmount_decrypt" "media-optical-dvd-decrypted"
convert_files "dvd_mount_decrypt" "media-optical-dvd-decrypted-mounted"
convert_files "cdaudio_unmount" "media-optical-cdaudio"
convert_files "cdaudio_mount" "media-optical-cdaudio-mounted"
convert_files "tape_unmount" "media-tape"
convert_files "tape_mount" "media-tape-mounted"
convert_files "ipod_unmount" "multimedia-player"
convert_files "ipod_mount" "multimedia-player-mounted"
#convert_files "printer1" "printer"

@ -78,6 +78,10 @@ find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/qt20fix/tqt
# Clean up unintended renames # Clean up unintended renames
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/ttqtconv2ui/tqtconv2ui/g' {} \; find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/ttqtconv2ui/tqtconv2ui/g' {} \;
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/ttqvfb/tqvfb/g' {} \; find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/ttqvfb/tqvfb/g' {} \;
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/BlindsQt::Vertical/Blinds::Vertical/g' {} \;
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/BlindsQt::Horizontal/Blinds::Horizontal/g' {} \;
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/Flip::Vertical/Flip::Vertical/g' {} \;
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/Flip::Horizontal/Flip::Horizontal/g' {} \;
# Rename little-used libraries # Rename little-used libraries
find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/-leditor/-ltqteditor/g' {} \; find ./ -type f -iname "*" -not -iwholename '*.git*' -exec sed -i 's/-leditor/-ltqteditor/g' {} \;

Loading…
Cancel
Save