summaryrefslogtreecommitdiffstats
path: root/ubuntu/maverick/defaultsettings/desktop-base/debian/preinst
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-06-01 02:04:45 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-06-01 02:04:45 -0500
commit6f8b29e1fa4d7c4f8676dbded0b9fde3e9acd207 (patch)
tree4613d1f6dd2471c02d32d72193426a4659432d0c /ubuntu/maverick/defaultsettings/desktop-base/debian/preinst
parenta6d46f81f053a75f8584f8e0b04e48f93dfc1532 (diff)
downloadtde-packaging-6f8b29e1fa4d7c4f8676dbded0b9fde3e9acd207.tar.gz
tde-packaging-6f8b29e1fa4d7c4f8676dbded0b9fde3e9acd207.zip
Add initial copy of the old Debian desktop-base package to the Debian and Ubuntu packaging files
Diffstat (limited to 'ubuntu/maverick/defaultsettings/desktop-base/debian/preinst')
-rw-r--r--ubuntu/maverick/defaultsettings/desktop-base/debian/preinst71
1 files changed, 71 insertions, 0 deletions
diff --git a/ubuntu/maverick/defaultsettings/desktop-base/debian/preinst b/ubuntu/maverick/defaultsettings/desktop-base/debian/preinst
new file mode 100644
index 000000000..d46d14701
--- /dev/null
+++ b/ubuntu/maverick/defaultsettings/desktop-base/debian/preinst
@@ -0,0 +1,71 @@
+#!/bin/sh -e
+
+#DEBHELPER#
+
+if [ "${1}" = "upgrade" ]; then
+ if dpkg --compare-versions ${2} lt 0.3.11 && dpkg --compare-versions ${2} gt 0.3.5; then
+ update-alternatives --remove gnome-splash \
+ /usr/share/images/desktop-base/Splash-Debian.png
+ update-alternatives --remove gnome-splash \
+ /usr/share/images/desktop-base/Splash-EvolvingTux.png
+ update-alternatives --remove gnome-splash \
+ /usr/share/images/desktop-base/Splash-Debian_red.png
+
+ dpkg-divert --package desktop-base --rename \
+ --divert /usr/share/pixmaps/splash/gnome-splash.png.orig \
+ --remove /usr/share/pixmaps/splash/gnome-splash.png
+ fi
+fi
+
+same_conffile() {
+ CONFFILE="$1"
+ if [ -e "$CONFFILE" ]; then
+ md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+ old_md5sum="`dpkg-query -W -f='${Conffiles}' desktop-base | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
+ [ "$md5sum" = "$old_md5sum" ]
+ return
+ fi
+ return 1
+}
+
+case "$1" in
+ install|upgrade)
+ if dpkg --compare-versions "$2" lt "5.0.2"; then
+ # if the folder is a symlink (installed by splashy), modified files
+ # need to be copied (from /usr/share/splashy/themes) before beeing
+ # replaced. If it's not, they need to be moved (from
+ # /etc/splashy/themes)
+ # not modified files need to be removed if no symlink, and not
+ # touched in case of a symlink
+ THEME_FOLDER="/etc/splashy/themes/moreblue-orbit"
+ THEME_FOLDER_BAK="/etc/splashy.dpkg-old/themes/moreblue-orbit"
+ FILES="background-bw.png background-color.png VeraSans.ttf theme.xml"
+
+ if [ -h /etc/splashy/themes ]; then
+ # symlink
+ for FILE in ${FILES}; do
+ [ -f ${THEME_FOLDER}/${FILE} ] || break
+ if ! same_conffile "${THEME_FOLDER}/${FILE}"; then
+ # symlink and changed file, copy it in a safe place
+ [ -d $THEME_FOLDER_BAK ] || mkdir -p $THEME_FOLDER_BAK
+ cp ${THEME_FOLDER}/${FILE} ${THEME_FOLDER_BAK}/
+ fi
+ done
+ else
+ # real folder
+ for FILE in ${FILES}; do
+ [ -f ${THEME_FOLDER}/${FILE} ] || break
+ if ! same_conffile "${THEME_FOLDER}/${FILE}"; then
+ # real folder and changed file, move it in a safe place
+ [ -d $THEME_FOLDER_BAK ] || mkdir -p $THEME_FOLDER_BAK
+ mv ${THEME_FOLDER}/${FILE} ${THEME_FOLDER_BAK}/
+ else
+ # real folder but unchanged file, just remove it
+ rm ${THEME_FOLDER}/${FILE}
+ fi
+ done
+ fi
+ fi
+ ;;
+esac
+