mirror of
https://github.com/UnRAIDES/unRAID-NerdTools
synced 2025-04-05 06:11:32 +00:00
fix-dependencies
This commit is contained in:
parent
cae1b3907d
commit
d427df6451
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
|||
upgrade-packages
|
||||
|
||||
develop/rsync.txt
|
||||
*.bak
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
<CHANGES>
|
||||
##&name;
|
||||
###2023.05.04
|
||||
- Enhanced: improvements in the treatment of dependencies
|
||||
###2023.05.02
|
||||
- Update: borgbackup-1.2.4
|
||||
- Update: python3-3.9.16-3
|
||||
|
|
|
@ -28,7 +28,7 @@ function get_content_from_github($repo, $file) {
|
|||
curl_setopt($ch, CURLOPT_URL, $repo);
|
||||
$content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
if (!empty($content) && (!is_file($file) || $content != file_get_contents($file)))
|
||||
if (!empty($content))
|
||||
file_put_contents($file, $content);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,12 @@ 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_depends = 'https://raw.githubusercontent.com/UnRAIDES/unRAID-NerdTools/main/packages/packages-depends';
|
||||
|
||||
$desc_file = $pkg_path.'packages-desc';
|
||||
$repo_file = $pkg_path.'packages.json';
|
||||
$config_file = $plg_path.'NerdTools.cfg';
|
||||
$depends_file = $plg_path.'packages-depends';
|
||||
|
||||
// get package configs
|
||||
$pkg_cfg = file_exists($config_file) ? parse_ini_file($config_file) : [];
|
||||
|
@ -31,6 +33,8 @@ $pkgs_desc_array = file_exists($desc_file) ? json_decode(file_get_contents($de
|
|||
|
||||
$pkgs_github_array = file_exists($repo_file) ? json_decode(file_get_contents($repo_file), true) : [];
|
||||
|
||||
$depends_file_array = file_exists($depends_file) ? json_decode(file_get_contents($depends_file), true) : [];
|
||||
|
||||
function logger($output, $quiet = false) {
|
||||
exec('echo '.escapeshellarg($output).' 2>&1 | logger -tnerdpack');
|
||||
if (!$quiet) {
|
||||
|
|
|
@ -6,8 +6,10 @@ require_once '/usr/local/emhttp/plugins/NerdTools/include/DownloadHelpers.php';
|
|||
if (!file_exists($repo_file) || !empty($_GET['force']) || (filemtime($repo_file) < (time() - 3600))) {
|
||||
get_content_from_github($pkg_repo, $repo_file);
|
||||
get_content_from_github($pkg_desc, $desc_file);
|
||||
get_content_from_github($pkg_depends, $depends_file);
|
||||
$pkgs_desc_array = file_exists($desc_file) ? json_decode(file_get_contents($desc_file), true) : [];
|
||||
$pkgs_github_array = file_exists($repo_file) ? json_decode(file_get_contents($repo_file), true) : [];
|
||||
$depends_file_array = file_exists($depends_file) ? json_decode(file_get_contents($depends_file), true) : [];
|
||||
}
|
||||
|
||||
$pkgs_array = [];
|
||||
|
@ -65,6 +67,7 @@ foreach ($pkgs_github_array as $pkg_github) {
|
|||
|
||||
$pkg = [
|
||||
'name' => str_replace("_nerdtools.txz",".txz",$pkg_github['name']) , // add full package name
|
||||
'dependencies' => $depends_file_array[$pkg_name] ? str_replace(array(" ",","), array("",", "), $depends_file_array[$pkg_name]) : '', // add package name only
|
||||
'pkgname' => $pkg_name, // add package name only
|
||||
'pkgnver' => $pkg_nver, // add package name with underscored version
|
||||
'pkgversion' => $pkg_version, // add package name with raw version
|
||||
|
|
|
@ -142,8 +142,8 @@ function checkDepends() {
|
|||
if ($('#'+index)[0]){
|
||||
value.split(",").forEach(function (item) {
|
||||
if (item && $('#'+index)[0].checked) {
|
||||
$('#' + item).switchButton({ checked: true });
|
||||
$('#' + item, '.pkgvalue').val('yes');
|
||||
$('#' + item.trim()).switchButton({ checked: true });
|
||||
$('#' + item.trim(), '.pkgvalue').val('yes');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user