Author: doogie
Date: Fri Mar 13 17:27:18 2009 New Revision: 753322 URL: http://svn.apache.org/viewvc?rev=753322&view=rev Log: Start making use of dpkg triggers, so that ofbiz only gets stopped/ started once per dpkg run, and so that installation is delayed to the end of the dpkg run as well. Added: ofbiz/trunk/debian/ofbiz-applications.postinst ofbiz/trunk/debian/ofbiz-applications.prerm ofbiz/trunk/debian/ofbiz-framework.triggers Modified: ofbiz/trunk/debian/move-files.pl ofbiz/trunk/debian/ofbiz-framework.postinst ofbiz/trunk/debian/ofbiz-framework.templates Modified: ofbiz/trunk/debian/move-files.pl URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/move-files.pl?rev=753322&r1=753321&r2=753322&view=diff ============================================================================== --- ofbiz/trunk/debian/move-files.pl (original) +++ ofbiz/trunk/debian/move-files.pl Fri Mar 13 17:27:18 2009 @@ -226,12 +226,7 @@ close(FIND); -my $postinst = <<_EOF_; - if [ "\$ofbiz_reseed" ]; then - echo "Need to modify ofbiz data." 1>&2 - configure_ofbiz - fi -_EOF_ +my $postinst = ''; push(@{$scripts{'ofbiz-framework'}->{'postinst'}->{'configure'}}, $postinst); foreach my $pkg (keys(%scripts)) { foreach my $script (keys(%{$scripts{$pkg}})) { Added: ofbiz/trunk/debian/ofbiz-applications.postinst URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/ofbiz-applications.postinst?rev=753322&view=auto ============================================================================== --- ofbiz/trunk/debian/ofbiz-applications.postinst (added) +++ ofbiz/trunk/debian/ofbiz-applications.postinst Fri Mar 13 17:27:18 2009 @@ -0,0 +1,14 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule +case "$1" in + (configure|reconfigure) + if [ "z" = "z$2" ]; then + dpkg-trigger --no-await ofbiz-install + else + dpkg-trigger --no-await ofbiz-upgrade + fi + ;; +esac +#DEBHELPER# +db_stop Added: ofbiz/trunk/debian/ofbiz-applications.prerm URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/ofbiz-applications.prerm?rev=753322&view=auto ============================================================================== --- ofbiz/trunk/debian/ofbiz-applications.prerm (added) +++ ofbiz/trunk/debian/ofbiz-applications.prerm Fri Mar 13 17:27:18 2009 @@ -0,0 +1,12 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule +if [ -x "/etc/init.d/ofbiz" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d ofbiz stop || exit $? + else + /etc/init.d/ofbiz stop || exit $? + fi +fi +#DEBHELPER# +db_stop Modified: ofbiz/trunk/debian/ofbiz-framework.postinst URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/ofbiz-framework.postinst?rev=753322&r1=753321&r2=753322&view=diff ============================================================================== --- ofbiz/trunk/debian/ofbiz-framework.postinst (original) +++ ofbiz/trunk/debian/ofbiz-framework.postinst Fri Mar 13 17:27:18 2009 @@ -163,7 +163,7 @@ . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/postinst dbc_generate_include=sh:/etc/ofbiz/debconf.cfg -dbc_go ofbiz "$@" +[ "$1" != "triggered" ] && dbc_go ofbiz "$@" if [ -e /etc/ofbiz/debconf.cfg ]; then ofbiz_admin_key="" . /etc/ofbiz/debconf.cfg @@ -172,22 +172,44 @@ ofbiz_readers="" ofbiz_admin_port="" fi + +if [ "$1" = "triggered" ]; then + case "$2" in + (ofbiz-daemon) + start_ofbiz + ;; + (ofbiz-install|ofbiz-upgrade) + ofbiz_reseed="" + if [ "$2" = "ofbiz-install" ]; then + ofbiz_reseed=1 + ofbiz_import_readers=1 + fi + get ofbiz_readers ofbiz/readers ofbiz_import_readers ofbiz_reseed + if [ "z" = "z$ofbiz_readers" ]; then + ofbiz_readers="seed" + else + ofbiz_readers="seed,$ofbiz_readers" + fi + ofbiz_readers="$(fix_readers "$ofbiz_readers")" + get ofbiz_admin_port ofbiz/admin-port + if [ "z" != "z$ofbiz_reseed" ]; then + echo "Need to modify ofbiz data." 1>&2 + configure_ofbiz + fi + start_ofbiz + ;; + esac + db_stop + exit 0 +fi + ofbiz_reseed="" case "$1" in (configure|reconfigure) - if [ "z" = "z$2" ]; then - ofbiz_reseed=1 - ofbiz_import_readers=1 - fi - get ofbiz_readers ofbiz/readers ofbiz_import_readers ofbiz_reseed - if [ "z" = "z$ofbiz_readers" ]; then - ofbiz_readers="seed" + if [ "$2" ]; then + dpkg-trigger --no-await ofbiz-upgrade else - ofbiz_readers="seed,$ofbiz_readers" - fi - ofbiz_readers="$(fix_readers "$ofbiz_readers")" - get ofbiz_admin_port ofbiz/admin-port - if ! [ "$2" ]; then + dpkg-trigger --no-await ofbiz-install if ! getent passwd ofbiz 2>/dev/null >/dev/null; then adduser --quiet --group --no-create-home --system --shell /bin/sh --home /var/lib/ofbiz ofbiz fi Modified: ofbiz/trunk/debian/ofbiz-framework.templates URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/ofbiz-framework.templates?rev=753322&r1=753321&r2=753322&view=diff ============================================================================== --- ofbiz/trunk/debian/ofbiz-framework.templates (original) +++ ofbiz/trunk/debian/ofbiz-framework.templates Fri Mar 13 17:27:18 2009 @@ -43,6 +43,15 @@ _Description: Reimport data? Whether data should be reimported on upgrade. +Template: ofbiz/fieldtype/postgres +Type: select +Choices: exact, text +Default: text +_Description: Which field type mapping to use? + Postgresql 8.1 or later has no speed differences when using TEXT, or + using a blank-padded field type mapping. New installs should prefer + the TEXT variant. + Template: ofbiz/database-type Type: string Description: internal Added: ofbiz/trunk/debian/ofbiz-framework.triggers URL: http://svn.apache.org/viewvc/ofbiz/trunk/debian/ofbiz-framework.triggers?rev=753322&view=auto ============================================================================== --- ofbiz/trunk/debian/ofbiz-framework.triggers (added) +++ ofbiz/trunk/debian/ofbiz-framework.triggers Fri Mar 13 17:27:18 2009 @@ -0,0 +1,3 @@ +interest ofbiz-install +interest ofbiz-upgrade +interest ofbiz-daemon |
Free forum by Nabble | Edit this page |