From 13c2b3250cae078d7e10f0b2da87fd95364b0ca0 Mon Sep 17 00:00:00 2001 From: Martin Rothschink Date: Mon, 17 Jan 2022 18:11:11 +0100 Subject: [PATCH 1/2] Do not deliver DSM7 package on DSM6 machines --- lib/SSpkS/Package/PackageFilter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/SSpkS/Package/PackageFilter.php b/lib/SSpkS/Package/PackageFilter.php index efbbeb3..8fc595d 100644 --- a/lib/SSpkS/Package/PackageFilter.php +++ b/lib/SSpkS/Package/PackageFilter.php @@ -113,7 +113,8 @@ public function isMatchingFirmwareVersion(\SSpkS\Package\Package $package): bool private function isMatchingFirmwareVersionPre7(\SSpkS\Package\Package $package): bool { // on DSM6 or less, package must be <= to filter - return version_compare($package->firmware, /** @scrutinizer ignore-type */ $this->filterFwVersion, '<='); + return version_compare($package->firmware, /** @scrutinizer ignore-type */ '7', '<') + && version_compare($package->firmware, /** @scrutinizer ignore-type */ $this->filterFwVersion, '<='); } private function isMatchingFirmwareVersionPost7(\SSpkS\Package\Package $package): bool From cbf886e09e1fefcada246765c40848c25f9fccc0 Mon Sep 17 00:00:00 2001 From: Martin Rothschink Date: Mon, 17 Jan 2022 18:11:47 +0100 Subject: [PATCH 2/2] Support os_min_ver instead of outdated firmware --- lib/SSpkS/Package/Package.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/SSpkS/Package/Package.php b/lib/SSpkS/Package/Package.php index 11413a9..9337858 100644 --- a/lib/SSpkS/Package/Package.php +++ b/lib/SSpkS/Package/Package.php @@ -15,7 +15,7 @@ * @property string $maintainer_url URL of maintainer's web page * @property string $distributor Package distributor * @property string $distributor_url URL of distributor's web page - * @property string $support_url URL of support web page + * @property string $support_url URL of support web page * @property array $arch List of supported architectures, or 'noarch' * @property array $thumbnail List of thumbnail files * @property array $thumbnail_url List of thumbnail URLs @@ -171,6 +171,10 @@ private function collectMetadata() $this->metadata['qinst'] = !empty($this->metadata['qinst']) ? $this->parseBool($this->metadata['qinst']) : $qValue; $this->metadata['qupgrade'] = !empty($this->metadata['qupgrade']) ? $this->parseBool($this->metadata['qupgrade']) : $qValue; $this->metadata['qstart'] = !empty($this->metadata['qstart']) ? $this->parseBool($this->metadata['qstart']) : $qValue; + + if (isset($this->metadata['os_min_ver'])) { + $this->metadata['firmware'] = $this->metadata['os_min_ver']; + } } /**