Add kde5-migrate-user-conf script for kde4->kde5 config files migration

This commit is contained in:
Silvan Calarco 2016-05-19 00:46:08 +02:00
parent 0167393c1b
commit 969156aaa7
2 changed files with 45 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# Makefile for openmamba-desktop-kde4
# Copyright (C) 2004-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2004-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2005-2007 by Davide Madrisan <davide.madrisan@gmail.com>
include VERSION
@ -35,7 +35,6 @@ datadir = ${prefix}/share
initrddir = ${sysconfdir}/rc.d/init.d
mandir = ${prefix}/usr/share/man
sysconfigdir= ${sysconfdir}/sysconfig
xprofiledir = ${sysconfdir}/xprofile.d
mambabasedatadir = ${datadir}/openmamba/mambabase
mambawelcomedatadir = ${datadir}/openmamba/mambawelcome
bootrecoverdatadir = ${datadir}/openmamba/bootrecover
@ -140,7 +139,6 @@ install-kde-distro-addons: dist-update
@$(INSTALL_DIR) $(DESTDIR)$(kde5configdir)
@$(INSTALL_DIR) $(DESTDIR)$(kdewallpapersdir)
@$(INSTALL_DIR) $(DESTDIR)$(kdeplasmadesktopupdatesdir)
@$(INSTALL_DIR) $(DESTDIR)$(xprofiledir)
@$(INSTALL_DIR) $(DESTDIR)$(kdedatadir)/apps/color-schemes
@$(INSTALL_DIR) $(DESTDIR)$(kdedatadir)/apps/konqueror/profiles
@$(INSTALL_DIR) $(DESTDIR)$(kdedatadir)/apps/konsole
@ -175,6 +173,7 @@ install-kde-distro-addons: dist-update
cp -a kde/wallpapers/{$(WALLPAPERS)} $(DESTDIR)$(kdewallpapersdir)
cp -a kde/desktoptheme $(DESTDIR)$(kdeappsdir)/
$(INSTALL_SCRIPT) bin/kickoffcfg $(DESTDIR)$(kdebindir)/kickoffcfg
$(INSTALL_SCRIPT) bin/kde5-migrate-user-conf $(DESTDIR)$(bindir)/kde5-migrate-user-conf
install-srpms:
@$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir)

43
bin/kde5-migrate-user-conf Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
# openmamba simple kde4->kde5 user config migration script
if [ "$1" = "-f" ]; then
FORCE=1
else
[ -e ~/.kde4/share/config/ -a ! -e ~/.kde4/share/.kde5_conf_migrated ] || exit 0
fi
for p in ~/.kde4/share/config/*; do
[ -L $p ] && continue
f=`basename $p`
if [ -e ~/.config/$f ]; then
if [ "$FORCE" ]; then
echo "Migrating $p -> ~/.config/$f [forced]"
mv ~/.config/$f ~/.config/$f.bak
mv $p ~/.config/ || exit 1
ln -s ../../../.config/$f $p || exit 1
fi
#echo "SKIPPED: $p"
else
echo "Migrating $p -> ~/.config/$f"
mv $p ~/.config/ || exit 1
ln -s ../../../.config/$f $p || exit 1
fi
done
for p in ~/.kde4/share/apps/*; do
[ -L $p ] && continue
f=`basename $p`
if [ -e ~/.local/$f ]; then
if [ "$FORCE" ]; then
echo "Migrating $p -> ~/.local/$f [forced]"
mv ~/.local/$f ~/.local/$f.bak
mv $p ~/.local/ || exit 1
ln -s ../../../.local/$f $p || exit 1
fi
#echo "SKIPPED: $p"
else
echo "Migrating $p -> ~/.local/$f"
mv $p ~/.local/ || exit 1
ln -s ../../../.local/$f $p || exit 1
fi
done
touch ~/.kde4/share/.kde5_conf_migrated