-
Notifications
You must be signed in to change notification settings - Fork 260
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
Ban 'assert' and introduce 'pipestatus' instead in EAPI 9 #1426
base: master
Are you sure you want to change the base?
Conversation
There should be separate commits for |
I feel like banning Unrelated to your comment above. How do you (and others) feel about
vs
I considered using an alias for that, as it felt cleaner and clearly expresses the intent. But maybe there are downsides I am not aware of? |
This is definitely not one atomic change. Read the log of the 2024-12-08 council meeting where several council members asked for the
That would be the only alias in the Portage code and it feels brittle. As a matter of fact, all previously defined aliases (with Anyway, the
|
Two more comments:
|
Having the code isolated in a single file makes testing easier. It also follows the pattern of |
Starting with EAPI 9, we decied to phase out 'assert', because, for example, due its confusing name. Instead 'assert' is going to replaced with 'pipestatus'. Bug: https://bugs.gentoo.org/566342 Signed-off-by: Florian Schmaus <[email protected]>
8715475
to
0328292
Compare
assert() { | ||
local x pipestatus=${PIPESTATUS[*]} | ||
for x in ${pipestatus} ; do | ||
[[ ${x} -eq 0 ]] || die "$@" | ||
done | ||
} |
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.
I wonder if this should be simplified and use __pipestatus
internally?
assert() { | |
local x pipestatus=${PIPESTATUS[*]} | |
for x in ${pipestatus} ; do | |
[[ ${x} -eq 0 ]] || die "$@" | |
done | |
} | |
assert() { | |
__pipestatus || die "$@" | |
} |
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.
Sounds good to me, but let's hear what others think.
Yes, but then follow its pattern entirely and source the file only when |
Sourcing the file conditionally has disadvantages, as it's And again, |
Starting with EAPI 9, we decided to phase out 'assert', because, for example, its name is confusing. Instead 'assert' is replaced with 'pipestatus'. This also introduces the portage internal __pipestatus helper that can be used in bash code for all EAPIs. The __pipestatus in eapi9-pipestatus.sh was taken from eapi9-pipestatus.eclass, written by Ulrich Müller. Thanks ulm! Bug: https://bugs.gentoo.org/566342 Signed-off-by: Florian Schmaus <[email protected]>
Obviously we disagree here. So, I guess it is for the Portage maintainers to decide whether a function with 11 SLOC should live in its own file. |
Starting with EAPI 9, we decided to phase out 'assert', because, for example, its name is confusing. Instead 'assert' is going to be replaced with 'pipestatus'.
This also introduces the portage internal __pipestatus helper that can be used in bash code for all EAPIs.
Bug: https://bugs.gentoo.org/566342