Added a few modifications in RR system

This commit is contained in:
Arturo Gonzalez 2017-03-16 14:56:10 +01:00 committed by daniel
parent 0321f8a895
commit d5fd732d8c
3 changed files with 9 additions and 8 deletions

View File

@ -22,8 +22,7 @@ if (is_ajax ()) {
if ($updare_rr) { if ($updare_rr) {
$number = get_parameter('number'); $number = get_parameter('number');
$dir = $config["homedir"]."/extras/mr"; $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
$file = "$dir/$number.sql"; $file = "$dir/$number.sql";
$dangerous_query = false; $dangerous_query = false;
@ -57,7 +56,8 @@ if (is_ajax ()) {
if (!file_exists($dir."/updated") || !is_dir($dir."/updated")) { if (!file_exists($dir."/updated") || !is_dir($dir."/updated")) {
mkdir($dir."/updated"); mkdir($dir."/updated");
} }
$file_dest = "$dir/updated/$number.sql";
$file_dest = $config["homedir"] . "/extras/mr/updated/$number.sql";
if (copy($file, $file_dest)) { if (copy($file, $file_dest)) {
unlink($file); unlink($file);
} }
@ -75,7 +75,7 @@ if (is_ajax ()) {
mkdir($dir."/updated"); mkdir($dir."/updated");
} }
$file_dest = "$dir/updated/$number.sql"; $file_dest = $config["homedir"] . "/extras/mr/updated/$number.sql";
html_debug("FILE EXISTS: " . (int)file_exists($file_dest), true); html_debug("FILE EXISTS: " . (int)file_exists($file_dest), true);
if (file_exists($file_dest)) { if (file_exists($file_dest)) {
unlink($file); unlink($file);

View File

@ -356,7 +356,8 @@ if ($check_online_free_packages) {
} }
if ($search_minor) { if ($search_minor) {
$have_minor_releases = db_check_minor_relase_available_to_um(); $package = get_parameter('package', '');
$have_minor_releases = db_check_minor_relase_available_to_um($package);
$return['have_minor'] = false; $return['have_minor'] = false;
if ($have_minor_releases) { if ($have_minor_releases) {

View File

@ -1720,10 +1720,10 @@ function db_check_minor_relase_available () {
* *
* @return bool Return if minor release is available or not * @return bool Return if minor release is available or not
*/ */
function db_check_minor_relase_available_to_um () { function db_check_minor_relase_available_to_um ($package) {
global $config; global $config;
$dir = $config["homedir"]."/extras/mr"; $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
$have_minor_release = false; $have_minor_release = false;
@ -1741,7 +1741,7 @@ function db_check_minor_relase_available_to_um () {
$exists = false; $exists = false;
foreach ($sqlfiles_num as $num) { foreach ($sqlfiles_num as $num) {
$file_dest = "$dir/updated/$num.sql"; $file_dest = $config["homedir"] . "/extras/mr/updated/$num.sql";
if (file_exists($file_dest)) { if (file_exists($file_dest)) {
$exists = true; $exists = true;