Merge pull request #112 from Mcklaren/fix-pkg_version

Improved handling of package
This commit is contained in:
Mcklaren 2024-02-05 20:11:26 +01:00 committed by GitHub
commit 49661590cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 15 deletions

Binary file not shown.

View File

@ -10,7 +10,6 @@
"plocate": "liburing",
"python3": "python-pip,python-setuptools",
"rar2fs": "unrar",
"tmux": "ncurses-terminfo",
"vim": "libsodium",
"wget2": "gpgme,libassuan"
}

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 "0c2d4dbee9a3a76ae44e36e54646b213">
<!ENTITY launch "Settings/&name;">
<!ENTITY github "UnRAIDES/unRAID-&name;">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/plugin/&name;.plg">
@ -17,6 +17,9 @@
<CHANGES>
##&name;
###2024.02.05
- Fixed: Improved handling of package names and versions
- Removed: Delete ncurses-terminfo dependencies of tmux isn't necesary
###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