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

Making grep -q -e -e usable on solaris #3788

Merged
merged 6 commits into from
May 5, 2024

Conversation

judovana
Copy link
Contributor

@judovana judovana commented May 2, 2024

replacing -q by /dev/null
repalcing double -e by or in regex itself

replacing -q by /dev/null
repalcing double -e by two greps
@github-actions github-actions bot added the solaris Issues that affect or relate to the SOLARIS OS label May 2, 2024
Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting a block on this purely because it was a problem I reported and I want to verify that it works before anyone merges it ;-) It also may require egrep instead of grep but the linter will likely whinge about that.
Will test tomorrow - thanks for the quick turnaround @judovana

@judovana
Copy link
Contributor Author

judovana commented May 2, 2024 via email

@karianna
Copy link
Contributor

karianna commented May 2, 2024

ERROR the following files don't have a valid license header:
.github/workflows/semgrep_diff.yml

Is unrelated

@judovana
Copy link
Contributor Author

judovana commented May 3, 2024

Thanx @karianna I was wondering....

@judovana
Copy link
Contributor Author

judovana commented May 3, 2024

@sxa I had make it much nicer to move that or to regex. The only disadvantage is that it is now unreadable:( and -E is not reliable over distros. But with that explanation in echo just on another line it should be ok

@sxa
Copy link
Member

sxa commented May 3, 2024

I'm getting:

The mandatory repo argument has a very strict format 'jdk[0-9]{1,3}[u]{0,1}' or just plain 'jdk' for tip. 'jdk8u' does not match.

from this change on Solaris - that's from
just running ./make-adopt-build-farm.sh jdk8u without any additional parameters

A bit if diagnoses shows that echo jdk8u | grep '^\(jdk\|jdk[0-9]\{1,3\}[u]\{0,1\}\)$' returns nothing on Solaris' grep

EDIT: The first version with the two separate checks looks ok though - echo jdk8u | grep "^jdk[0-9]\\{1,3\\}[u]\\{0,1\\}$" finds the string correctly.

@judovana
Copy link
Contributor Author

judovana commented May 3, 2024

Hm

echo jdk8u | grep '^\(jdk\|jdk[0-9]\{1,3\}[u]\{0,1\}\)$'
jdk8u

I do nothave soalris around to try it up. maybe -E and removal of slashes can help, Maybe try it in the previous 669a1a5 revision. Generally I'mm running out of ideas.

@sxa
Copy link
Member

sxa commented May 3, 2024

Hm

echo jdk8u | grep '^(jdk|jdk[0-9]{1,3}[u]{0,1})$'
jdk8u

I do nothave soalris around to try it up. maybe -E and removal of slashes can help, Maybe try it in the previous 669a1a5 revision. Generally I'mm running out of ideas.

Yeah I think I'd vote for using the previous revision at this point - it's a bit messy using two variables but it's reasonably clear and should work everywhere.

@judovana
Copy link
Contributor Author

judovana commented May 3, 2024

The 669a1a5 really worked for you??? and others had not? /me amazed. WIll remove the second commit then

Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 669a1a5 really worked for you??? and others had not? /me amazed. Will remove the second commit then

Purely on the basis of running this on solaris: echo jdk8u | grep "^jdk[0-9]\\{1,3\\}[u]\\{0,1\\}$" is true ($?=0) and the same using echo jdk8x at the start gives $?=1 so I think that's good enough if you're happy with it :-)

@sxa
Copy link
Member

sxa commented May 3, 2024

Failing github check seems to be covered by #3789 and not relevant to this PR

@judovana
Copy link
Contributor Author

judovana commented May 3, 2024

Ok. added comment on this topic to the code. Ok by me, plesae review/merge as necessary.

Copy link
Contributor

@karianna karianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested wording change

sbin/common/common.sh Outdated Show resolved Hide resolved
Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>
@judovana
Copy link
Contributor Author

judovana commented May 5, 2024

Thank you. I keep learning.

@karianna karianna merged commit 9982cfe into adoptium:master May 5, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solaris Issues that affect or relate to the SOLARIS OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants