fix reinstall packages

This commit is contained in:
jsavargas 2022-10-09 00:21:06 -03:00
parent dda0b39de5
commit ace8c949d9
3 changed files with 7 additions and 4 deletions

Binary file not shown.

View File

@ -3,8 +3,8 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "NerdTools">
<!ENTITY author "UnRAIDES">
<!ENTITY version "2022.10.08">
<!ENTITY md5 "ff03dec047f1f450025e046dcad18be9">
<!ENTITY version "2022.10.09">
<!ENTITY md5 "fd33e7e4b1d1f2a95e2a30b3af2bea03">
<!ENTITY launch "Settings/&name;">
<!ENTITY github "UnRAIDES/unRAID-&name;">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/plugin/&name;.plg">
@ -17,6 +17,8 @@
<CHANGES>
##&name;
###2022.10.09
- Fix reinstall packages
###2022.10.08
- The plugins column is changed by the current version
- The functionality to compare old versions is updated

View File

@ -71,7 +71,7 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
$pkg_name = str_replace('__', '.', $pkg_name); // replace "_" with "." in package names
$pkg_pattern = '/^'.$pkg_name.'.-*/'; // search pattern for packages
$pkg_patternd = '/^'.$pkg_name.'.*_nerdtools.*/'; // search pattern for packages
$pkg_install_status = !empty(preg_grep($pkg_pattern, $pkgs_installed)); // check install status
$pkg_install_status = !empty(preg_grep($pkg_patternd, $pkgs_installed)); // check install status
$pkg_download_status = !empty(preg_grep($pkg_patternd, $pkgs_downloaded)); // check package download status
$pkg_online_status = !empty(preg_grep($pkg_pattern, $pkgs_github_array));
$pkg_find .= " ! -name '".$pkg_name."*'";
@ -122,8 +122,9 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
}
if (!$pkg_install_status) { // if package is not installed
//logger('upgradepkg --install-new --reinstall '.$pkg_extra_path.$pkg_name.'*_nerdtools.txz');
$pkg_msg = 'Installing';
$pkg_cmd = 'upgradepkg --install-new '.$pkg_extra_path.$pkg_name.'*_nerdtools.txz 2>&1';
$pkg_cmd = 'upgradepkg --install-new --reinstall '.$pkg_extra_path.$pkg_name.'*_nerdtools.txz 2>&1';
}
} elseif ($pkg_pref == 'no' && $pkg_download_status && $argu) {