Skip to content
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

installdependencies.sh prints incorrect return value in case of apt-get error #3460

Open
Topi-ab opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Topi-ab
Copy link

Topi-ab commented Sep 10, 2024

Describe the bug
Lines

$apt_get update && $apt_get install -y libkrb5-3 zlib1g
if [ $? -ne 0 ]
then
echo "'$apt_get' failed with exit code '$?'"

do not print out the actual error. The "$?" variable gets cleared with if -command.

FIX: Store the error code to a temporary variable before if, and then use that variable in both if and echo.

Also it would be good to print out the failing command line, like

apt_get update && $apt_get install -y libkrb5-3 zlib1g
failed with error code 7.

To Reproduce

Disconnect net when running the script.

Expected behavior
Should print the error code returnted by apt-get

Runner Version and Platform

Version of your runner? ??

OS of the machine running the runner? OSX/Windows/Linux/...
Linux

What's not working?

Error printing

Job Log Output

N/A

Runner and Worker's Diagnostic Logs

N/A

@Topi-ab Topi-ab added the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant