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

Detect version of sed in Makefile #12319

Merged
merged 5 commits into from
Jul 27, 2020
Merged

Conversation

silverwind
Copy link
Member

It's possible to install GNU sed on Darwin or FreeBSD so it's better to not assume BSD sed on those platforms but to instead perform version detection for the GNU string and only use BSD syntax if absent.

It's possible to install GNU sed on Darwin or FreeBSD so it's better to
not assume BSD sed on those platforms but to instead perform version
detection for the `GNU` string and only use BSD syntax if absent.
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jul 24, 2020
@lafriks lafriks added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jul 24, 2020
@lafriks lafriks added this to the 1.13.0 milestone Jul 24, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 25, 2020
@lafriks
Copy link
Member

lafriks commented Jul 25, 2020

🚀

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Not sure this is the way to go. sed --version fails on macOS

@silverwind
Copy link
Member Author

silverwind commented Jul 25, 2020

Yeah, BSD sed knows no --version argument but it's no issue as long as there's no GNU string in the output.

$ /usr/bin/sed --version
/usr/bin/sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

@silverwind
Copy link
Member Author

silverwind commented Jul 25, 2020

Switching to perl might be an option but I'm not totally certain that the regex engines are compatible and I think sed is more likely to exist on a given system.

Makefile Outdated Show resolved Hide resolved
Co-authored-by: techknowlogick <matti@mdranta.net>
@techknowlogick techknowlogick merged commit 8d6fa00 into go-gitea:master Jul 27, 2020
@silverwind silverwind deleted the sed branch July 27, 2020 20:37
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants