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

2 version improvements #98

Closed
wants to merge 2 commits into from
Closed

Conversation

bmwiedemann
Copy link

in addition to #97
this includes guessing the version from release tarballs

tested to work on openSUSE
with https://github.com/mcrapet/plowshare/archive/v%{version}.tar.gz

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
without this patch, building from release tarballs
always gave UNKNOWN version
@mcrapet
Copy link
Owner

mcrapet commented Aug 11, 2017

Hi,

Here is my new version:
https://gist.github.com/mcrapet/fe8e8a32a3457bf3c597a00322120884

Could you review it?

@bmwiedemann
Copy link
Author

Works for me (tested on openSUSE and Debian with dash), but you neglected the theoretical case of a non-GNU/Linux system with a 'date' that does not support -r.
and the original version would have supported strange mixes like BSD date on Linux or GNU date on a BSD... no idea how common those are. I think, MacOS X has the most BSD users these days.

@mcrapet
Copy link
Owner

mcrapet commented Aug 11, 2017

  • BSD date on Linux: I don't buy it because date is GNU coreutils.
  • GNU date on BSD, possible like sed, but convention is to prefix a "gnu" or "g" letter (like gsed).

But as you said it is theoretically possible.
What about checking date --version (first line) instead of uname -s?

@bmwiedemann
Copy link
Author

actually, I only care about GNU/Linux, so you may just ignore such esoteric cases.

@mcrapet
Copy link
Owner

mcrapet commented Aug 12, 2017

Last call: see v2 gist. For me this is good. No more uname dependency.

@bmwiedemann
Copy link
Author

bmwiedemann commented Aug 13, 2017

+1 👍

@mcrapet
Copy link
Owner

mcrapet commented Aug 13, 2017

Committed db87b3d.
See for you help!

@mcrapet mcrapet closed this Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants