From 674398b3428448a7177873ca4c875c2695f88da8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 10 Feb 2022 12:20:24 +0100 Subject: 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... --- global-functions | 10 +++------- 1 file 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={ -- cgit v1.2.3-70-g09d2