Fix: Pb in package with install.lock

This commit is contained in:
Laurent Destailleur 2011-08-04 12:07:29 +00:00
parent abbdc91f57
commit c2e71d7283
7 changed files with 19 additions and 25 deletions

View File

@ -49,10 +49,8 @@ echo Run the dolibarr postinst script
# Define vars
docdir='/var/lib/dolibarr/documents'
#docdir='/usr/share/dolibarr/documents'
installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
installconfig="/etc/dolibarr/install.forced.php"
#config="/usr/share/dolibarr/htdocs/conf/conf.php"
config="/etc/dolibarr/conf.php"

View File

@ -54,10 +54,8 @@ echo Run the dolibarr postrm script
docdir='/var/lib/dolibarr/documents'
#docdir='/usr/share/dolibarr/documents'
#config="/usr/share/dolibarr/htdocs/conf/conf.php"
config="/etc/dolibarr/conf.php"
lockfile="/usr/share/dolibarr/install.lock"
lockfile="$docdir/install.lock"

View File

@ -154,8 +154,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
export config="%{_sysconfdir}/dolibarr/conf.php"
export lockfile="/usr/share/dolibarr/install.lock"
# Detect OS
os='unknown';
@ -223,11 +221,9 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then
# semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
#semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr/install.lock"
semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)"
restorecon -R -v /etc/dolibarr
#restorecon -R -v /usr/share/dolibarr
restorecon -v /usr/share/dolibarr/install.lock
restorecon -R -v /var/lib/dolibarr
fi
@ -288,7 +284,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
export config="%{_sysconfdir}/dolibarr/conf.php"
export lockfile="$targetdir/install.lock"
# Detect OS
@ -345,8 +340,8 @@ echo Removed remaining $config
%{__rm} -f $config
echo Removed remaining $installconfig
%{__rm} -f $installconfig
echo Removed remaining $lockfile
%{__rm} -f $lockfile
echo Removed remaining $docdir/install.lock
%{__rm} -f $docdir/install.lock
%changelog

View File

@ -27,7 +27,7 @@
* \file htdocs/filefunc.inc.php
* \ingroup core
* \brief File that include conf.php file and functions.lib.php
* \version $Id: filefunc.inc.php,v 1.21 2011/07/31 23:19:04 eldy Exp $
* \version $Id: filefunc.inc.php,v 1.22 2011/08/04 12:07:29 eldy Exp $
*/
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
@ -60,6 +60,7 @@ error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
# Define vars
$conffiletoshowshort = "conf.php";
# Define localization of conf file
$conffile = "conf/conf.php";

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/index.php
* \brief Dolibarr home page
* \version $Id: index.php,v 1.200 2011/07/31 23:19:05 eldy Exp $
* \version $Id: index.php,v 1.201 2011/08/04 12:07:30 eldy Exp $
*/
define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site.
@ -545,8 +545,9 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
{
$message='';
// Install lock missing
if (! file_exists('../install.lock') && is_dir(DOL_DOCUMENT_ROOT."/install"))
// Check if install lock file is present
$lockfile=DOL_DATA_ROOT.'/install.lock';
if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
{
$langs->load("other");
//if (! empty($message)) $message.='<br>';
@ -573,7 +574,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
$db->close();
llxFooter('$Date: 2011/07/31 23:19:05 $ - $Revision: 1.200 $');
llxFooter('$Date: 2011/08/04 12:07:30 $ - $Revision: 1.201 $');
/**

View File

@ -23,7 +23,7 @@
* \file htdocs/install/etape5.php
* \ingroup install
* \brief Last page of upgrade or install process
* \version $Id: etape5.php,v 1.107 2011/07/31 23:26:19 eldy Exp $
* \version $Id: etape5.php,v 1.108 2011/08/04 12:07:30 eldy Exp $
*/
include_once("./inc.php");
@ -314,7 +314,8 @@ if ($action == "set")
if (! empty($force_install_lockinstall))
{
// Install is finished, we create the lock file
$fp = @fopen($lockfile, "w");
$lockfile=DOL_DATA_ROOT.'/install.lock';
$fp = @fopen($lockfile, "w");
if ($fp)
{
if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
@ -363,7 +364,8 @@ elseif (preg_match('/upgrade/i',$action))
if (! empty($force_install_lockinstall))
{
// Upgrade is finished, we create the lock file
$fp = @fopen($lockfile, "w");
$lockfile=DOL_DATA_ROOT.'/install.lock';
$fp = @fopen($lockfile, "w");
if ($fp)
{
if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility

View File

@ -21,7 +21,7 @@
/** \file htdocs/install/inc.php
* \ingroup core
* \brief File that define environment for install pages
* \version $Id: inc.php,v 1.137 2011/07/31 23:26:18 eldy Exp $
* \version $Id: inc.php,v 1.138 2011/08/04 12:07:30 eldy Exp $
*/
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
@ -70,16 +70,15 @@ else
$includeconferror='';
# Define vars
$conffiletoshowshort = "conf.php";
# Define localization of conf file
$conffile = "../conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
$lockfile = '../../install.lock';
# For debian/redhat like systems
#$conffile = "/etc/dolibarr/conf.php";
#$conffiletoshow = "/etc/dolibarr/conf.php";
#$lockfile = '/etc/dolibarr/install.lock'; # Web has no permission to write here
$lockfile = '../../install.lock';
if (! defined('DONOTLOADCONF') && file_exists($conffile))
{
@ -128,7 +127,6 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile))
}
$conf->global->MAIN_LOGTOHTML=1;
// Define prefix
if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_';
define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:''));
@ -179,6 +177,7 @@ if (preg_match('/install.lock/i',$_SERVER["SCRIPT_FILENAME"]))
}
exit;
}
$lockfile=DOL_DATA_ROOT.'/install.lock';
if (file_exists($lockfile))
{
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).<br>';