-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix(scripts/termux_step_install_license): fix logic error #21005
Conversation
dbc0b55
to
4819f19
Compare
I'll do some local searching for any packages effected by this logic error |
4819f19
to
2bdcdb1
Compare
c5c82d8
to
1fbb7bf
Compare
1fbb7bf
to
d0b41be
Compare
d0b41be
to
7ed6423
Compare
caa8021
to
6a94e07
Compare
I added the |
} | ||
done | ||
if (( ! FROM_SOURCES )); then | ||
# If we get here no license file could be found | ||
termux_error_exit "${TERMUX_PKG_NAME}: Could not find a license file for $LICENSE in the package sources" |
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.
Add a comma ,
after here
and in below comment too.
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.
Actually I think explaining the second if (( ! FROM_SOURCES )); then
works better here.
See the comment above the if statement that I just added.
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.
You need to move the second if (( ! FROM_SOURCES )); then
inside the first one, otherwise when second non-generic license is processed, the second if will get triggered and abort.
And use "If we have not found".
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.
Oh yeah you're right it would need to be defined outside the while loop otherwise it gets reset for each license.
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.
the second if will get triggered and abort.
Sorry, it won't abort, but wrong place for it. The second abort if (( ! FROM_SOURCES ))
should be inside the first if (( ! FROM_SOURCES ))
in which licenses are actually searched so that it isn't run after first non-generic license loop.
And now you have moved the FROM_SOURCES
initialization to the wrong if
(TERMUX_PKG_LICENSE_FILE
).
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.
lolz, true, do it then. I should have caught it earlier.
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.
Just pushed it in the latest revision
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.
Great! Now let's wait for the next production break
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.
Does not remebering to change the commit message to actually reflect the final state of the PR count?
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.
Wrong commit message is a getting-kicked-out-of-org offense!
Yeah, I am gonna take a break too. Maybe grimler has some input too. Can do this tomorrow. |
7bd90f6
to
2eb17c1
Compare
7fcce67
to
9c28a98
Compare
9c28a98
to
1525f0e
Compare
Move counter advance to the end of the while loop. This fixes a logic error where the counter wouldn't advance if the first license was "generic", and the second one was author specific. This would cause `cp` to attempt to copy through the dangling symlink to the generic license in `termux-licenses` which fails and dies.
1525f0e
to
02058f4
Compare
Move counter advance to the end of the while loop.
This fixes a logic error where the counter wouldn't advance if the first license was "generic"
and the second one was author specific.
This would cause
cp
to attempt to copy through the dangling symlink to the generic licensein
termux-licenses
which fails and dies.I also moved the
$TERMUX_PACKAGE_LIBRARY
check into acase
which should make it easier to follow.