-
Notifications
You must be signed in to change notification settings - Fork 37.7k
script: Lint Gitian descriptors with ShellCheck #17361
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
test/lint/print-gitian-script.py
Outdated
@@ -0,0 +1,22 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? Couldn't use some YAML processor like yq
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't use some YAML processor like
yq
?
Done.
TIL, thank you ;)
d82b77a
to
7e8b40e
Compare
Concept ACK: good idea! Could perhaps check for |
7e8b40e
to
93faddf
Compare
Done. Thank you. |
93faddf
to
a953da7
Compare
@dongcarl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all the places where you had to split export DIR=$(pwd)
, just use export DIR="$PWD"
, which doesn't require the splitting
do | ||
echo | ||
echo "$descriptor" | ||
SCRIPT=$'#!/bin/bash\n'$(yq -r .script "$descriptor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCRIPT=$'#!/bin/bash\n'$(yq -r .script "$descriptor") | |
SCRIPT=$'#!/usr/bin/env bash\n'$(yq -r .script "$descriptor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just mimics the way gitian-builder/bin/gbuild makes shell script:
File.open("var/build-script", "w") do |script|
script.puts "#!/bin/bash"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Makes sense to do it this way, could you add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
a953da7
to
53ff028
Compare
Done. |
Gitian builds
|
Gitian builds
|
Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already lacks |
@hebasto let's see if that one is merged first so you can update the doc here. |
gitian: fixed SC2001 regex bitcoin#17680
17f81e9 script: Enable SC2001 rule for Gitian scripts (Hennadii Stepanov) 61bb21b script: Enable SC2155 rule for Gitian scripts (Hennadii Stepanov) 577682d script: Enable SC2006 rule for Gitian scripts (Hennadii Stepanov) 14aded4 script: Lint Gitian descriptors with ShellCheck (Hennadii Stepanov) Pull request description: This PR extracts shell scripts from Gitian descriptors (`contrib/gitian-descriptors/`) and checks for ShellCheck warnings as any other one. Some non-controversial warnings are fixed. ACKs for top commit: practicalswift: ACK 17f81e9 -- diff looks correct Tree-SHA512: bdfa3d35bbb65ff634c90835d75c3df63e958b558599771d21366724f5cf64da83a68957d926e926a99c3704b9529e96a17697dc8d9ff3adf7154d9cb1999a8d
c966ff1 gitian: fixed SC2001 regex (willyk) Pull request description: Currently the gitian-win-signer.yml produces OUTFILE names without `-unsigned` stripped out This is due to regex having an`%` in front of it ``` $ INFILE="bitcoin-0.19.0-win64-setup-unsigned.exe" $ echo "${INFILE/%-unsigned}" bitcoin-0.19.0-win64-setup-unsigned.exe $ echo "${INFILE/-unsigned}" bitcoin-0.19.0-win64-setup.exe ``` Fixes bitcoin#17361 ACKs for top commit: laanwj: ACK c966ff1 hebasto: ACK c966ff1 Tree-SHA512: 954547f9dfa4cab4def5f284d4837c21f0e6fed7454a04e83e6b1b7d3fd3f9661ea657047f0d8162f6591909d32ef2f72e801b2f3a44cbb1131ac344cb913a69
c966ff1 gitian: fixed SC2001 regex (willyk) Pull request description: Currently the gitian-win-signer.yml produces OUTFILE names without `-unsigned` stripped out This is due to regex having an`%` in front of it ``` $ INFILE="bitcoin-0.19.0-win64-setup-unsigned.exe" $ echo "${INFILE/%-unsigned}" bitcoin-0.19.0-win64-setup-unsigned.exe $ echo "${INFILE/-unsigned}" bitcoin-0.19.0-win64-setup.exe ``` Fixes bitcoin#17361 ACKs for top commit: laanwj: ACK c966ff1 hebasto: ACK c966ff1 Tree-SHA512: 954547f9dfa4cab4def5f284d4837c21f0e6fed7454a04e83e6b1b7d3fd3f9661ea657047f0d8162f6591909d32ef2f72e801b2f3a44cbb1131ac344cb913a69
This PR extracts shell scripts from Gitian descriptors (
contrib/gitian-descriptors/
) and checks for ShellCheck warnings as any other one.Some non-controversial warnings are fixed.