[pkg-fso-commits] [SCM] openmoko-files-config, various files for the Openmoko devices branch, master, updated. debian/20090202-2-17-g89b7cc3
Luca Capello
luca at pca.it
Tue Jun 9 01:48:37 UTC 2009
The following commit has been merged in the master branch:
commit b5f40891eb28514040bce829bcd32fc2e9bc7d5d
Author: Luca Capello <luca at pca.it>
Date: Tue Jun 9 02:46:50 2009 +0200
debian/fso-config-gta01.*inst: /e/f/opref/conf/phone/default.yaml
/etc/freesmartphone/opreferences/conf/phone/default.yaml was
shipped with version 20090202-2, while being managed by the
fso-sounds-* packages. Add postinst/preinst bits to get rid
of it while preserving the file installed by the fso-sounds-*
packages.
diff --git a/debian/changelog b/debian/changelog
index 9fda37b..7c92b8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,8 +15,12 @@ openmoko-files-config (20090224-1) UNRELEASED; urgency=low
* debian/fso-config-gta01.install:
+ install common/ files as well.
+ follow GTA01 folder name change.
+ * debian/fso-config-gta01.postinst:
+ + restore /etc/f.../oprefrerences/conf/phone/default.yaml.
* debian/fso-config-gta01.preinst:
- remove obsolete udev rules file.
+ - remove /etc/f.../oprefrerences/conf/phone/default.yaml
+ since it is managed by the fso-sounds-* packages.
* debian/fso-config-gta02.install:
+ install common/ files as well.
* debian/fso-config-gta02.preinst:
diff --git a/debian/fso-config-gta01.postinst b/debian/fso-config-gta01.postinst
new file mode 100644
index 0000000..919a209
--- /dev/null
+++ b/debian/fso-config-gta01.postinst
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+# THIS IS A VERY BAD TRICK, but I do not know a better way to do the
+# same, please look at the preinst file for the whole story.
+# Restore update-alternatives file provided by fso-sounds-* packages
+if [ "$1" = "configure" ]; then
+ YAMLFILE=/etc/freesmartphone/opreferences/conf/phone/default.yaml
+ if [ ! -e "$YAMLFILE" -a -e "$YAMLFILE".dpkg-bak ]; then
+ echo "Restoring proper $YAMLFILE ..."
+ mv -f $YAMLFILE.dpkg-bak $YAMLFILE
+ fi
+fi
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
diff --git a/debian/fso-config-gta01.preinst b/debian/fso-config-gta01.preinst
index bc3257c..7fd5041 100644
--- a/debian/fso-config-gta01.preinst
+++ b/debian/fso-config-gta01.preinst
@@ -24,6 +24,25 @@ case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "20090202-2"; then
rm_conffile fso-config-gta01 /etc/udev/rules.d/55-gta01-neo1973.rules
+ # THESE ARE VERY BAD TRICKS, but I do not know a better
+ # way to do the same.
+ # The following conffile does not belong to this package
+ # and is managed by the fso-sounds-* packages instead,
+ # through update-alternatives, and because of that, this
+ # package always install it as .dpkg-new. Thus assume
+ # that if exists and it comes from fso-config-gta01 (only
+ # one previous upload), it is safe to remove it.
+ YAMLFILE=/etc/freesmartphone/opreferences/conf/phone/default.yaml
+ if [ -e "$YAMLFILE".dpkg-new ]; then
+ md5sum="`md5sum \"$YAMLFILE.dpkg-new\" | sed -e \"s/ .*//\"`"
+ if [ "$md5sum" = c2f0f8f1d1e0b5e41c8d88c03661a4e8 ]; then
+ echo "Removing obsolete conffile $YAMLFILE.dpkg-new ..."
+ rm -f "$YAMLFILE".dpkg-new
+ fi
+ fi
+ # Let dpkg make a backup of the conffile, which will be
+ # restored during postinst.
+ rm_conffile fso-config-gta01 "$YAMLFILE"
fi
;;
*)
--
openmoko-files-config, various files for the Openmoko devices
More information about the pkg-fso-commits
mailing list