aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-02-10 12:20:24 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-02-10 12:30:06 +0100
commit674398b3428448a7177873ca4c875c2695f88da8 (patch)
tree76030d3090b4fc6dd57db0f1bf8ce3fe93d6e77d
parent4d26dd07c32d5220c880e719df4f86ad34af6382 (diff)
global-functions: $DownloadPackage: handle special cases
This is a RouterOS v7 only change! * Revert commit 1e6931c8e34d5035cb07baa98b57eccbcd4278ab (but keep the cherry-picked one in branch routeros-v6). * Drop special case 'routeros-$arch', which no longer exists. * Update package name 'system' to 'routeros'. This should be the correct name, and is expected by CAPsMAN. No idea why package-name property for the file is different...
-rw-r--r--global-functions10
1 files changed, 3 insertions, 7 deletions
diff --git a/global-functions b/global-functions
index acf3546..3323f36 100644
--- a/global-functions
+++ b/global-functions
@@ -252,20 +252,16 @@
:global CleanFilePath;
:global LogPrintExit2;
:global MkDir;
- :global VersionToNum;
:global WaitForFile;
:if ([ :len $PkgName ] = 0) do={ :return false; }
:if ([ :len $PkgVer ] = 0) do={ :set PkgVer [ / system package update get installed-version ]; }
:if ([ :len $PkgArch ] = 0) do={ :set PkgArch [ / system resource get architecture-name ]; }
+ :if ($PkgName = "system") do={ :set PkgName "routeros"; }
+
:local PkgFile ($PkgName . "-" . $PkgVer . "-" . $PkgArch . ".npk");
- :if ([ $VersionToNum $PkgVer ] < [ $VersionToNum "7.0" ] && $PkgName = "routeros") do={
- :set PkgFile ($PkgName . "-" . $PkgArch . "-" . $PkgVer . ".npk");
- }
- :if ($PkgArch = "x86_64" || $PkgName ~ "^routeros-") do={
- :set PkgFile ($PkgName . "-" . $PkgVer . ".npk");
- }
+ :if ($PkgArch = "x86_64") do={ :set PkgFile ($PkgName . "-" . $PkgVer . ".npk"); }
:local PkgDest [ $CleanFilePath ($PkgDir . "/" . $PkgFile) ];
:if ([ $MkDir $PkgDir ] = false) do={