From d5fd732d8caff2cfbd4372120036774a15b5e0d0 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 16 Mar 2017 14:56:10 +0100 Subject: [PATCH] Added a few modifications in RR system --- pandora_console/include/ajax/rolling_release.ajax.php | 8 ++++---- pandora_console/include/ajax/update_manager.ajax.php | 3 ++- pandora_console/include/functions_db.php | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/ajax/rolling_release.ajax.php b/pandora_console/include/ajax/rolling_release.ajax.php index 4c32123783..9bc778c4d5 100644 --- a/pandora_console/include/ajax/rolling_release.ajax.php +++ b/pandora_console/include/ajax/rolling_release.ajax.php @@ -22,8 +22,7 @@ if (is_ajax ()) { if ($updare_rr) { $number = get_parameter('number'); - $dir = $config["homedir"]."/extras/mr"; - + $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; $file = "$dir/$number.sql"; $dangerous_query = false; @@ -57,7 +56,8 @@ if (is_ajax ()) { if (!file_exists($dir."/updated") || !is_dir($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)) { unlink($file); } @@ -75,7 +75,7 @@ if (is_ajax ()) { 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); if (file_exists($file_dest)) { unlink($file); diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php index 3ae0dc6534..0dafe4c5d2 100644 --- a/pandora_console/include/ajax/update_manager.ajax.php +++ b/pandora_console/include/ajax/update_manager.ajax.php @@ -356,7 +356,8 @@ if ($check_online_free_packages) { } 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; if ($have_minor_releases) { diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 556d279742..8244a000f7 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1720,10 +1720,10 @@ function db_check_minor_relase_available () { * * @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; - $dir = $config["homedir"]."/extras/mr"; + $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; $have_minor_release = false; @@ -1741,7 +1741,7 @@ function db_check_minor_relase_available_to_um () { $exists = false; 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)) { $exists = true;