update_config: Write the old package install dir to a tmp file. v0.6.x
authorPascal Volk <user@localhost.localdomain.org>
Sat, 26 Nov 2011 17:28:59 +0000
branchv0.6.x
changeset 483 fb210a116f18
parent 482 428ee9cdf1b2
child 484 35395b49bc44
update_config: Write the old package install dir to a tmp file. upgrade: Remove old CamelCase files. Removed some unused variables.
update_config.py
upgrade.sh
--- a/update_config.py	Sun Nov 13 20:19:40 2011 +0000
+++ b/update_config.py	Sat Nov 26 17:28:59 2011 +0000
@@ -8,7 +8,18 @@
 from time import time
 from ConfigParser import ConfigParser
 from shutil import copy2
-from VirtualMailManager.constants.VERSION import VERSION
+try:
+    from VirtualMailManager.constants.VERSION import VERSION
+except ImportError:
+    os.sys.stderr.write('error: no pre 0.6.0 version information found\n')
+    raise SystemExit(2)
+
+# we have to remove the old CamelCase files
+import VirtualMailManager
+vmm_inst_dir = os.path.dirname(VirtualMailManager.__file__)
+tmp_info = open('/tmp/vmm_inst_dir', 'w')
+tmp_info.write(vmm_inst_dir)
+tmp_info.close()
 
 try:
     import psycopg2
--- a/upgrade.sh	Sun Nov 13 20:19:40 2011 +0000
+++ b/upgrade.sh	Sat Nov 26 17:28:59 2011 +0000
@@ -7,9 +7,6 @@
 PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
 PREFIX=/usr/local
 
-PF_CONFDIR=$(postconf -h config_directory)
-PF_GID=$(id -g $(postconf -h mail_owner))
-POSTCONF=$(which postconf)
 DOVECOT_VERS=$(dovecot --version | awk '{print $1}')
 LOCALE_DIR=${PREFIX}/share/locale
 DOC_DIR=${PREFIX}/share/doc/vmm
@@ -21,7 +18,6 @@
 DOCS="ChangeLog COPYING NEWS INSTALL README"
 
 INSTALL_OPTS="-g 0 -o 0 -p"
-INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p"
 
 if [ $(id -u) -ne 0 ]; then
     echo "Run this script as root."
@@ -38,11 +34,17 @@
     echo "please read the upgrade instructions at http://vmm.localdomain.org/"
     exit 1
 elif [ $rv -ne 0 ]; then
-    echo "Sorry, something went wrong. Please file a bug:"
-    echo "https://sourceforge.net/tracker/?group_id=213727"
+    echo "Sorry, something went wrong. Please file a bug at:"
+    echo "https://bitbucket.org/pvo/vmm/issues"
     exit 1
 fi
 
+# remove old CamelCase files
+if [ -f /tmp/vmm_inst_dir ] ; then
+    rm -rf `cat /tmp/vmm_inst_dir`
+    rm -f /tmp/vmm_inst_dir
+fi
+
 python setup.py -q install --force --prefix ${PREFIX}
 python setup.py clean --all >/dev/null