From 8fb1d90f428a92b89b491ca3f407d7e5c4c28709 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Oct 2009 23:39:05 +0000 Subject: [PATCH] Fix: Package debian uninstall --- build/deb/postinst | 5 ++++- build/deb/postrm | 9 ++++++++- build/makepack-dolibarr.pl | 8 ++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/build/deb/postinst b/build/deb/postinst index bd9a64b584f..41d0d60f484 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -46,7 +46,10 @@ echo Run the postinst script case "$1" in configure) + configorig="/usr/share/dolibarr/build/deb/apache.conf" config="/etc/dolibarr/apache.conf" + mkdir -p /etc/dolibarr + cp -pr $configorig $config #db_reset "dolibarr/webserver" @@ -118,4 +121,4 @@ db_stop #DEBHELPER# -exit 0 \ No newline at end of file +exit 0 diff --git a/build/deb/postrm b/build/deb/postrm index 2765f9715c1..15faadb47c5 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -49,14 +49,21 @@ case "$1" in fi - rm -rf /etc/dolibarr for server in $webservers ; do + error="" conffile="/etc/$server/httpd.conf" + # We disable set -e because script apache-uninclude.sh return error if not + set +e . /usr/share/wwwconfig-common/apache-uninclude.sh + set -e +# if [ "x$error" != "x" ] ; +# then echo $error +# fi if [ "$status" = "purge" ] ; then restart="$restart $server" fi done + rm -rf /etc/dolibarr servers="apache2-ssl apache2 mysql" . /usr/share/wwwconfig-common/restart.sh diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f52b02552e1..4ae1926b785 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -387,8 +387,8 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`; - print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`; + #print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n"; + #$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`; #print "Copy changelog file into $BUILDROOT/$PROJECT/DEBIAN\n"; #$ret=`cp "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT/DEBIAN/changelog"`; @@ -399,8 +399,8 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT/DEBIAN\n"; $ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT/DEBIAN/copyright"`; - print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n"; - $ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`; + #print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n"; + #$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`; print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT`;