Re: [WireGuard] RFE: A notion of VERSION (was: Debugging AllowedIps)

2016-11-16 Thread Jason A. Donenfeld
On Wed, Nov 16, 2016 at 10:01 PM, Daniel Kahn Gillmor
 wrote:
> On Thu 2016-11-17 02:40:30 +0900, Jason A. Donenfeld wrote:
>> Trying again with no line breaks:
>>
> Please don't assume that the source code is built from a git repository.
> On debian, we build from the tarball, which is extracted from the git
> repo, and we have nothing for "git rev-parse" to draw from.

That's why my horrible one liner falls back on getting the version
from the parent directory... Not pretty.

>
> For the cost of one extra commit just before tagging, you could populate
> a version.txt file and this then becomes $(shell cat version.txt).

Yea most likely this is what will wind up happening...
___
WireGuard mailing list
WireGuard@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/wireguard


Re: [WireGuard] RFE: A notion of VERSION (was: Debugging AllowedIps)

2016-11-16 Thread Daniel Kahn Gillmor
On Thu 2016-11-17 02:40:30 +0900, Jason A. Donenfeld wrote:
> Trying again with no line breaks:
>
>> WIREGUARD_VERSION := $(shell parent_name=$$(readlink -f .. | sed -n 
>> 's:.*/[wW]ire[Gg]uard[a-z-]*-\([0-9.]\+\)$$:\1:p');  if [ -d ../.git ]; then 
>> echo "git-$$(git rev-parse --short HEAD)"; elif [ -n $parent_name ]; then 
>> echo "$$parent_name"; else echo "unknown"; fi)

Please don't assume that the source code is built from a git repository.
On debian, we build from the tarball, which is extracted from the git
repo, and we have nothing for "git rev-parse" to draw from.

For the cost of one extra commit just before tagging, you could populate
a version.txt file and this then becomes $(shell cat version.txt).

simplicity, simplicity :)

--dkg


signature.asc
Description: PGP signature
___
WireGuard mailing list
WireGuard@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/wireguard


Re: [WireGuard] RFE: A notion of VERSION (was: Debugging AllowedIps)

2016-11-16 Thread Jason A. Donenfeld
The best I could come with:

> WIREGUARD_VERSION := $(shell parent_name=$$(readlink -f .. | sed -n 
> 's:.*/[wW]ire[Gg]uard[a-z-]*-\([0-9.]\+\)$$:\1:p');  if [ -d ../.git ]; then 
> echo "git-$$(git rev-parse --shor
t HEAD)"; elif [ -n $parent_name ]; then echo "$$parent_name"; else
echo "unknown"; fi)

Is this reliable, or is this garbage?
___
WireGuard mailing list
WireGuard@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/wireguard