-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add Solaris support #3515
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
Merged
+36
−5
Merged
Add Solaris support #3515
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db00322
Prefer GNU make on Solaris
vlmarek 655a937
Modify the tests to work on Solaris
vlmarek 456387c
Fix strptime day of week/year on Solaris
vlmarek 910da6f
Fix universal time on Solaris
vlmarek 697c432
Do not test system jq
vlmarek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,14 +4,21 @@ | |
|
|
||
| msys=false | ||
| mingw=false | ||
| sunos=false | ||
| case "$(uname -s)" in | ||
| MSYS*) msys=true;; | ||
| MINGW*) mingw=true;; | ||
| SunOS*) sunos=true;; | ||
| esac | ||
|
|
||
| JQ_NO_B=$JQ | ||
| JQ="$JQ -b" | ||
|
|
||
| # On Solaris, GNU tools are available in /usr/gnu. This script should prefer | ||
| # them over the native tools, because the native versions may lack some | ||
| # command-line options the script relies on. | ||
| $sunos && PATH="/usr/gnu/bin:$PATH" | ||
|
|
||
| PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null | ||
|
|
||
| SHELL=/bin/sh | ||
|
|
@@ -603,16 +610,18 @@ cmp $d/color $d/expect | |
| echo 'Failed to set $JQ_COLORS' > $d/expect_warning | ||
| $JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/expect | ||
| for colors in '/' '[30' '30m' '30:31m:32' '30:*:31' 'invalid'; do | ||
| JQ_COLORS=$colors \ | ||
| $JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning | ||
| export JQ_COLORS=$colors | ||
| $JQ -Ccn '[{"a":true,"b":false},"abc",123,null]' > $d/color 2>$d/warning | ||
| cmp $d/color $d/expect | ||
| cmp $d/warning $d/expect_warning | ||
| done | ||
| unset JQ_COLORS | ||
|
|
||
| # Check $NO_COLOR | ||
| test_no_color=true | ||
| $msys && test_no_color=false | ||
| $mingw && test_no_color=false | ||
| $sunos && test_no_color=false | ||
| if $test_no_color && command -v script >/dev/null 2>&1; then | ||
| if script -qc echo /dev/null >/dev/null 2>&1; then | ||
| faketty() { script -qec "$*" /dev/null; } | ||
|
|
@@ -681,7 +690,7 @@ EOF | |
| echo "WARNING: Not testing localization" | ||
| else | ||
| dt1=$(LC_ALL=$l date +'%a %d %b %Y at %H:%M:%S') | ||
| dt2=$(LC_ALL=$l jq -nr 'now | strflocaltime("%a %d %b %Y at %H:%M:%S")') | ||
| dt2=$(LC_ALL=$l $JQ -nr 'now | strflocaltime("%a %d %b %Y at %H:%M:%S")') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to cherry-pick this change in separate PR. |
||
| dt3=$(LC_ALL=$l date +'%a %d %b %Y at %H:%M:%S') | ||
| if [ "$dt1" != "$dt2" ] && [ "$dt2" != "$dt3" ]; then | ||
| echo "jq does not honor LC_ALL environment variable ($dt1, $dt2, $dt3)" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Possible to skip above
tzsetand call it once here?