2024.02.05

fix-pkg_version
This commit is contained in:
jsavargas 2024-02-05 15:29:51 -03:00
parent 3106552ee2
commit 60f9cb2943
3 changed files with 16 additions and 14 deletions

Binary file not shown.

View File

@ -3,8 +3,8 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "NerdTools">
<!ENTITY author "UnRAIDES">
<!ENTITY version "2024.02.04">
<!ENTITY md5 "c58391030deb76faf1500da3117ebd2b">
<!ENTITY version "2024.02.05">
<!ENTITY md5 "37f006c6aa0528a4a3f66b7e669c41e9">
<!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;
###2024.02.05
- Fixed: Improved handling of package names and versions
###2024.02.04
- Fixed: package nvme-cli added original version, the rename not work
- Fixed: rollback python-pip-21.3.1-2 (added stable version)

View File

@ -18,23 +18,23 @@ $pkg_nameArray = [];
foreach ($pkgs_github_array as $pkg_github) {
$pkg_nameArray = explode('-', $pkg_github['name']); // split package name into array
$pattern = '/^([a-zA-Z0-9-]+)-([\d.]+)-?.*\.txz$/';
$pkg_name = "";
$pkg_version = "";
$pkg_nver = "";
if (preg_match($pattern, $pkg_github['name'], $matches)) {
// $matches[1] contiene el nombre del paquete
// $matches[2] contiene la versión del paquete
$pkg_name = $matches[1];
$pkg_version = $matches[2];
$pkg_nver = $matches[2];
}
// strip md5 files
if(!strpos(end($pkg_nameArray),'.md5')) {
$pkg_name = $pkg_nameArray[0];
if (sizeof($pkg_nameArray) > 4) { //if package name has a subset get it
for ($ii = 1; $ii < sizeof($pkg_nameArray)-3; $ii++) {
$pkg_name .= '-'.$pkg_nameArray[$ii];
}
}
$pkg_version = $pkg_nameArray[sizeof($pkg_nameArray) - 3]; // get package version
$pkg_nver = $pkg_name.'-'.str_replace('.', '__', $pkg_version); // add underscored version to package name
$pkg_pattern = '/^'.$pkg_name.'-[0-9].*/'; // search pattern for packages
// check all plugins for package dependency