> Thomas wrote:
>> > Wait, your git --describe is finding a random tarball in some other
>> > directory?
>> >
>> > That's really broken.
>> ...
>> GITHASH is technically correct, but annoyingly unhelpful.
>>
>> How shall I force "toybox --version" to print "toybox 0.7.4"
>> instead of "toybox whatever-16.0.0-222-ge7bb9e918200"
>> just because the toybox build dir is "under" a git dir?
>
> Have you looked at the GIT_CEILING_DIRECTORIES variable?

GIT_CEILING_DIRECTORIES=$(dirname ${PWD}) works, but seems hacky.

Rather than patching [ -z "$GITHASH" ] && GITHASH=... because setting
$GITHASH=myver seems misleading, the (new) attached .patch lets you set
$TOYBOX_VERSION=myver to end up with -DTOYBOX_VERSION=myver ... supersedes
GITHASH= but still falls back to main.c:#define TOYBOX_VERSION= ... so
projects can override "TOYBOX_VERSION=${PV}-${PR}" to keep "toybox
--version" from printing "toybox $(git describe)".

Unless $CONFIG_TOYBOX_VERSION is a better name than $TOYBOX_VERSION.
Unless introducing -DTOYBOX_VERSION_GITHASH and optionally showing "toybox
$TOYBOX_VERSION-$TOYBOX_VERSION_GITHASH" is better.

Attachment: dont-hide-version-num.patch
Description: Binary data

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to