diff --git a/.gitignore b/.gitignore index a27fe57..e082c27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # DEVELOPED FOLDERS upgrade-packages +develop/rsync.txt diff --git a/archive/NerdTools-2023.03.06-x86_64-1.txz b/archive/NerdTools-2023.03.06-x86_64-1.txz new file mode 100644 index 0000000..c995100 Binary files /dev/null and b/archive/NerdTools-2023.03.06-x86_64-1.txz differ diff --git a/develop/create.json-6.11.sh b/develop/create.json-6.11.sh deleted file mode 100755 index a41b352..0000000 --- a/develop/create.json-6.11.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -php create.json.php 6.11 > ../contents/packages.6.11.json - diff --git a/develop/create.json.php b/develop/create.json.php deleted file mode 100644 index e433b1b..0000000 --- a/develop/create.json.php +++ /dev/null @@ -1,52 +0,0 @@ - size ['.$size.'] package...'); - #print('Downloading file_check_sha1 => sha1_file ['.$sha1_file.'] package...'); - #print('Downloading file_check_sha1 => sha1_file ['.sha1($contents).'] package...'); - - //echo "$file => $sha1_file => $size \n"; - $detalle['name'] = basename($file); - $detalle['path'] = "packages/$version/".basename($file); - $detalle['sha'] = $sha1_file; - $detalle['size'] = $size; - $detalle['download_url'] = "https://raw.githubusercontent.com/UnRAIDES/unRAID-NerdTools/main/packages/$version/".basename($file); - $detalle['type'] = 'file'; - - //print_r($detalle); - //print_r($detalle); - // $detalle['download_url'] = "https://raw.githubusercontent.com/UnRAIDES/unRAID-NerdPack/master/packages/$version/".basename($file); - - - return ($detalle); -} - -echo json_encode($array,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES ); - - - -?> diff --git a/develop/leeme.txt b/develop/leeme.txt index 8b086a2..4f98a8c 100644 --- a/develop/leeme.txt +++ b/develop/leeme.txt @@ -1,11 +1,11 @@ -# Generador de json por version -php create.json.php 6.11 > ../contents/packages.6.11.json + +MODO DE USO # Generador de version de plugin Ejemplos: - ./unraidmpkg.sh - ./unraidmpkg.sh a - ./unraidmpkg.sh b - ./unraidmpkg.sh c + ./develop/unraidmpkg.sh + ./develop/unraidmpkg.sh a + ./develop/unraidmpkg.sh b + ./develop/unraidmpkg.sh c diff --git a/develop/unraidmpkg.sh b/develop/unraidmpkg.sh index 95b75d4..3affa4c 100755 --- a/develop/unraidmpkg.sh +++ b/develop/unraidmpkg.sh @@ -3,7 +3,7 @@ BASEDIR=$PWD -cd ../source/NerdTools +cd source/NerdTools ./pkg_build.sh $1 @@ -14,9 +14,9 @@ echo "VERSION: $version" echo "${BASH_SOURCE[0]}" # CALCULATE MD5 -md5=($(md5sum ${BASEDIR}/../archive/NerdTools-${version}-x86_64-1.txz)) +md5=($(md5sum ${BASEDIR}/archive/NerdTools-${version}-x86_64-1.txz)) echo ${md5} -sed -i "s/ENTITY version .*/ENTITY version \"$version\">"/ "$BASEDIR/../plugin/NerdTools.plg" -sed -i "s/ENTITY md5 .*/ENTITY md5 \"$md5\">"/ "$BASEDIR/../plugin/NerdTools.plg" +sed -i "s/ENTITY version .*/ENTITY version \"$version\">"/ "$BASEDIR/plugin/NerdTools.plg" +sed -i "s/ENTITY md5 .*/ENTITY md5 \"$md5\">"/ "$BASEDIR/plugin/NerdTools.plg" diff --git a/plugin/NerdTools.plg b/plugin/NerdTools.plg index d0cacdf..28c556f 100644 --- a/plugin/NerdTools.plg +++ b/plugin/NerdTools.plg @@ -3,8 +3,8 @@ - - + + @@ -17,6 +17,8 @@ ##&name; +###2023.03.06 +- Fixed: fixed PHP deprecated: ###2023.03.05b - Initial 6.12 compatibility - Fixed: added some missing package descriptions diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdToolsHelpers.php b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdToolsHelpers.php index d608f4b..c5ade45 100644 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdToolsHelpers.php +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdToolsHelpers.php @@ -13,7 +13,6 @@ if (!is_dir($pkg_extra_path)) $pkg_desc = 'https://raw.githubusercontent.com/UnRAIDES/unRAID-NerdTools/main/packages/packages-desc'; $pkg_repo = "https://api.github.com/repos/UnRAIDES/unRAID-NerdTools/contents/packages/$os_version"; -$pkg_repo = $_SERVER['HTTP_DEVELOP'] ? $pkg_repo = "https://api.github.com/repos/jsavargas/unRAID-NerdTools/contents/packages/$os_version?ref=develop" : $pkg_repo; $desc_file = $pkg_path.'packages-desc'; $repo_file = $pkg_path.'packages.json'; diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/PackageQuery.php b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/PackageQuery.php index 02a86dd..06b1c14 100644 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/PackageQuery.php +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/PackageQuery.php @@ -11,6 +11,7 @@ if (!file_exists($repo_file) || !empty($_GET['force']) || (filemtime($repo_file) } $pkgs_array = []; +$pkg_nameArray = []; foreach ($pkgs_github_array as $pkg_github) { $pkg_nameArray = explode('-', $pkg_github['name']); // split package name into array @@ -36,7 +37,7 @@ foreach ($pkgs_github_array as $pkg_github) { // check all plugins for package dependency $plugins = []; - exec("cd /boot/config/plugins ; find *.plg | xargs grep '${pkg_name}-${pkg_version}' -sl",$plugins); + exec("cd /boot/config/plugins ; find *.plg | xargs grep '$pkg_name-$pkg_version' -sl",$plugins); $pkg_plgs = '--'; if ($plugins){ foreach ($plugins as $plugin){ @@ -59,6 +60,8 @@ foreach ($pkgs_github_array as $pkg_github) { $downloadedpkg = !empty(preg_grep($pkg_pattern, $pkgs_installed)) ? array_values(preg_grep($pkg_pattern, $pkgs_installed))[0] : false; $downloadedpkgv = $downloadedpkg ? preg_match('/^'.$pkg_name.'-(\d.+?)[-|_].*/',$downloadedpkg, $matches)? $matches[1]:false : false; $updatePkg = version_compare($pkg_version, $downloadedpkgv, '>') ; + + if (!array_key_exists($pkg_name, $pkgs_desc_array)) $pkgs_desc_array[$pkg_name] = ""; $pkg = [ 'name' => str_replace("_nerdtools.txz",".txz",$pkg_github['name']) , // add full package name