capsman-download-packages: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:02:56 +01:00
parent 98bd011984
commit 85965a6dee
3 changed files with 12 additions and 24 deletions

View file

@ -11,7 +11,6 @@
# #
# !! Do not edit this file, it is generated from template! # !! Do not edit this file, it is generated from template!
:local ExitOK false;
:onerror Err { :onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady; :global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -28,8 +27,7 @@
:global WaitFullyConnected; :global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={ :if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
$WaitFullyConnected; $WaitFullyConnected;
@ -39,16 +37,14 @@
:if ([ :len $PackagePath ] = 0) do={ :if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
:set ExitOK true; :exit;
:error false;
} }
:if ([ $FileGet $PackagePath ] = false) do={ :if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={ :if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!"); $PackagePath . ") failed!");
:set ExitOK true; :exit;
:error false;
} }
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!"); "). Please place your packages!");
@ -89,5 +85,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitError; $ExitError false [ :jobname ] $Err;
} }

View file

@ -12,7 +12,6 @@
# !! This is just a template to generate the real script! # !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered. # !! Pattern '%TEMPL%' is replaced, paths are filtered.
:local ExitOK false;
:onerror Err { :onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady; :global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -29,8 +28,7 @@
:global WaitFullyConnected; :global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={ :if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
$WaitFullyConnected; $WaitFullyConnected;
@ -41,16 +39,14 @@
:if ([ :len $PackagePath ] = 0) do={ :if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
:set ExitOK true; :exit;
:error false;
} }
:if ([ $FileGet $PackagePath ] = false) do={ :if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={ :if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!"); $PackagePath . ") failed!");
:set ExitOK true; :exit;
:error false;
} }
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!"); "). Please place your packages!");
@ -100,5 +96,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitError; $ExitError false [ :jobname ] $Err;
} }

View file

@ -11,7 +11,6 @@
# #
# !! Do not edit this file, it is generated from template! # !! Do not edit this file, it is generated from template!
:local ExitOK false;
:onerror Err { :onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady; :global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -28,8 +27,7 @@
:global WaitFullyConnected; :global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={ :if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true; :exit;
:error false;
} }
$WaitFullyConnected; $WaitFullyConnected;
@ -39,16 +37,14 @@
:if ([ :len $PackagePath ] = 0) do={ :if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
:set ExitOK true; :exit;
:error false;
} }
:if ([ $FileGet $PackagePath ] = false) do={ :if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={ :if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!"); $PackagePath . ") failed!");
:set ExitOK true; :exit;
:error false;
} }
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!"); "). Please place your packages!");
@ -91,5 +87,5 @@
} }
} }
} do={ } do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err; :global ExitError; $ExitError false [ :jobname ] $Err;
} }