diff --git a/dev/build/generate_filelist_xml.php b/dev/build/generate_filelist_xml.php index 5dc2219cb1e..9853f860c08 100755 --- a/dev/build/generate_filelist_xml.php +++ b/dev/build/generate_filelist_xml.php @@ -50,6 +50,13 @@ $includeconstants = array(); $buildzip = 0; if (empty($argv[1])) { + print '***** '.$script_file.' *****'."\n"; + print "Generate the file filelist-x.y.z[-mybuild].xml with signature of files. "; + print "This includes the 3 sections:\n"; + print "- dolibarr_htdocs_dir\n"; + print "- dolibarr_scripts_dir\n"; + print "- dolibarr_unalterable_files (only files inside the scope of the unalterable module)\n"; + print "\n"; print "Usage: ".$script_file." release=auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit(1); @@ -97,7 +104,7 @@ $savrelease = $release; $tmpver = explode('-', $release, 2); if ($tmpver[0] == 'auto') { $release = DOL_VERSION; - if ($tmpver[1] && $tmpver[0] == 'auto') { + if (!empty($tmpver[1]) && $tmpver[0] == 'auto') { $release .= '-'.$tmpver[1]; } } @@ -126,10 +133,10 @@ if (empty($includecustom)) { } } -print "Working on files into : ".DOL_DOCUMENT_ROOT."\n"; -print "Release : ".$release."\n"; -print "Include custom in signature : ".$includecustom."\n"; -print "Include constants in signature : "; +print "Working on files into : ".DOL_DOCUMENT_ROOT."\n"; +print "Release : ".$release."\n"; +print "Include custom dir in signature : ".(empty($includecustom) ? 'no' : 'yes')."\n"; +print "Include constants in signature : ".(empty($includeconstants) ? 'none' : ''); foreach ($includeconstants as $countrycode => $tmp) { foreach ($tmp as $constname => $constvalue) { print $constname.'='.$constvalue." "; @@ -155,9 +162,12 @@ $gitcommit = 'seetag'; $branchname = preg_replace('/^(\d+\.\d+)\..*$/', '\1', $release); // Keep only x.y into x.y.z $fileforgit = dirname(dirname(dirname(__FILE__))).'/.git/refs/heads/'.$branchname; print "Try to get last commit ID from file ".$fileforgit."\n"; -$fileforgitcontent = file_get_contents($fileforgit); +$fileforgitcontent = ''; +if (file_exists($fileforgit)) { + $fileforgitcontent = file_get_contents($fileforgit); +} if (empty($fileforgitcontent)) { - print "Failed to get the last commit ID. Are you on the branch for the release (branch name '.$branchname.') ?\n"; + print "Failed to get the last commit ID. Are you on the branch for the release (branch name ".$branchname.") ?\n"; } $gitcommit = trim($fileforgitcontent); @@ -350,7 +360,7 @@ if ($newdir != $dir) { } fputs($fp, '