mirror of
https://github.com/unraid/webgui.git
synced 2026-04-23 18:48:49 -05:00
Fixed plugin manager - show correct version for "next" branch
This commit is contained in:
@@ -4,8 +4,8 @@ Icon="icon-update"
|
||||
Tag="upload"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -16,7 +16,7 @@ Tag="upload"
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$empty = "<tr><td colspan='6'><div class='spinner'></div></td><tr>";
|
||||
$empty = "<tr><td colspan='6'><div class='spinner'></div></td></tr>";
|
||||
$version = $branch = $date = 'unknown';
|
||||
$bzroot = file_exists('/boot/previous/bzroot');
|
||||
$check = $notify['unraidos'] ? 0 : 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -17,7 +17,7 @@ $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
function plugin($method, $arg = '') {
|
||||
global $docroot;
|
||||
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin ".escapeshellarg($method)." ".escapeshellarg($arg), $output, $retval);
|
||||
return $retval==0 ? implode("\n", $output) : false;
|
||||
return $retval==0 ? end($output) : false;
|
||||
}
|
||||
|
||||
function check_plugin($arg, &$ncsi) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright 2005-2018, Lime Technology
|
||||
* Copyright 2012-2018, Bergware International.
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -48,16 +48,16 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
|
||||
$checked = (!$audit && !$check) ? check_plugin(basename($plugin_file),$ncsi) : true;
|
||||
//OS update?
|
||||
$os = $system && $name==$builtin[0];
|
||||
$toggle = false;
|
||||
$past = false;
|
||||
//toggle stable/next release?
|
||||
if ($os && $branch) {
|
||||
$toggle = plugin('version',$plugin_file);
|
||||
$past = plugin('version',$plugin_file);
|
||||
$tmp_plg = "$name-.plg";
|
||||
$tmp_file = "/var/tmp/$name.plg";
|
||||
copy($plugin_file,$tmp_file);
|
||||
exec("sed -ri 's|^(<!ENTITY category).*|\\1 \"{$branch}\">|' $tmp_file");
|
||||
symlink($tmp_file,"/var/log/plugins/$tmp_plg");
|
||||
if (check_plugin($tmp_plg,$ncsi)) {
|
||||
if (version_compare(check_plugin($tmp_plg,$ncsi),$past,'>')) {
|
||||
copy("/tmp/plugins/$tmp_plg",$tmp_file);
|
||||
$plugin_file = $tmp_file;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
|
||||
if ($url !== false) {
|
||||
$filename = "/tmp/plugins/".(($os && $branch) ? $tmp_plg : basename($url));
|
||||
if ($checked && file_exists($filename)) {
|
||||
if ($toggle && $toggle != $version) {
|
||||
if ($past && $past != $version) {
|
||||
$status = make_link('install',$plugin_file,'forced');
|
||||
} else {
|
||||
$latest = plugin('version',$filename);
|
||||
|
||||
Reference in New Issue
Block a user