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

Conversation

Projects
None yet
2 participants
@bmwiedemann
Copy link

commented Aug 9, 2017

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

bmwiedemann added some commits Aug 9, 2017

version: Allow to override build date
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.
version: Have version from release tarballs
without this patch, building from release tarballs
always gave UNKNOWN version
@mcrapet

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2017

Hi,

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

Could you review it?

@bmwiedemann

This comment has been minimized.

Copy link
Author

commented Aug 11, 2017

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Author

commented Aug 12, 2017

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

@mcrapet

This comment has been minimized.

Copy link
Owner

commented Aug 12, 2017

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

@bmwiedemann

This comment has been minimized.

Copy link
Author

commented Aug 13, 2017

+1 👍

@mcrapet

This comment has been minimized.

Copy link
Owner

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
You can’t perform that action at this time.