-
-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DietPi-Globals | Add new error handled command wrapper G_EXEC #3440
Conversation
+ DietPi-Globals | G_EXEC: Add options to redirect STDOUT and run an additional function before every core function execution + DietPi-Globals | Remove G_FILE_EXISTS which we used only a single time and in very most cases it is required to check for file or dir only, allow symlinks or explicitly do not, or similar + DietPi-Globals | Use G_EXEC to handle G_CHECK_URL and all G_AG* functions but G_AGP (ToDo)
+ DietPi-Globals | G_EXEC: Rename G_EXEC_ATTEMPTS to G_EXEC_RETRIES since a value of 1 does not mean 1 attempt but indeed 1 retry, hence two attempts + DietPi-Globals | G_EXEC: Remove G_EXEC_REDIRECT, since in most cases where we write to a file via echo/cat, the write redirect/write itself needs to be error handled, not the cat/echo call, which nearly never fails. This needs to more thoughts and development. Also this is basically to avoid "eval" for safety reasons, for the cases we use there is no risk. Even if we use "eval echo $VAR > file" and $VAR contains the syntax for a dangerous command substitution, only the variable gets expended but the contained command is not executed, which would require "eval eval echo $VAR > file".
+ DietPi-Globals | G_EXEC: Add $G_EXEC_OUTPUT_COL to allow overriding command output colour + DietPi-Globals | G_EXEC: Add ", please wait..." after initial info print, if G_EXEC_OUTPUT=1 is set, as it might take a while until the command produces output and we have no processing animation then
Hmm strange issue: ownCloud install:
Output:
The error prompt reveals that the command array contains an entry 🈴 Simple unset two times does not help 🈯️ Found it, there was an obsolete tee pipe in place which was a prior attempt to handle occ command stack trace errors, before
Final important result: |
+ DietPi-Software | Remove obsolete tee from ownCloud occ install, which causes an issue as well: #3440 (comment)
+ DietPi-Globals | Add info that G_EXEC must never be piped + DietPi-Globals | unset variables or functions explicitly. unset tries to unset the input arguments as variables first and only if this fails tries to unset a such named functions. Also there might be a function with the same name defined while the variable is not. + DietPi-Globals | Do not assign input arguments as array ($@) to a string variable but assign it as concatenated string directly ($*)
Status: Ready
Commit list/description: