From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4168 Path: news.gmane.org!not-for-mail From: Ivan Kanakarakis Newsgroups: gmane.linux.lib.musl.general Subject: Re: Feature request Date: Tue, 29 Oct 2013 09:12:40 +0200 Message-ID: References: <20131029023312.GR20515@brightrain.aerifal.cx> <526F21F5.2010806@gentoo.org> <20131029045454.GU20515@brightrain.aerifal.cx> <526F426D.2050303@gentoo.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133458e92426d04e9dbf357 X-Trace: ger.gmane.org 1383030809 29540 80.91.229.3 (29 Oct 2013 07:13:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 07:13:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4172-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 29 08:13:35 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Vb3Ub-0003h2-MH for gllmg-musl@plane.gmane.org; Tue, 29 Oct 2013 08:13:33 +0100 Original-Received: (qmail 7242 invoked by uid 550); 29 Oct 2013 07:13:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7231 invoked from network); 29 Oct 2013 07:13:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=PVJRGpiOLjM0GbcaXR58NcSlH72v3xOYInLuRik4fDw=; b=EjhkVs3jksRuNwhK10XcmjowZHVLIPXgJsmxco7BlZZiD9EEAl/BQxRo4kzepkmPuA 9TrLlHQNwS/RsGF95NyoxAOQkj1GxcLfVf5EQO8Ox3uLPOaSReiaovXYjqkDxVnIUvoU ZKvZaH852CrhGQJl3oWhDHOOXQhXuaPzId5XwzQ5vZdi8BuNIXa+TynhX+IH1/rSr10M oh4SS1JNLOVVQnYD+3yuYc3B/CDOo/e0mmIec6EF1cNaC+gGEkygSuhoITj3n8kEkZOO U58npC2jFNCZ93Kx6QUMTS4jAfycjf4aZDJRFPmkGOLfuOkWPDjICdUAQOr8Xix3qt4t PzCA== X-Received: by 10.60.70.134 with SMTP id m6mr18081542oeu.14.1383030800398; Tue, 29 Oct 2013 00:13:20 -0700 (PDT) In-Reply-To: <526F426D.2050303@gentoo.org> Xref: news.gmane.org gmane.linux.lib.musl.general:4168 Archived-At: --001a1133458e92426d04e9dbf357 Content-Type: text/plain; charset=UTF-8 The $(< file) syntax is bash-only iirc. git describe --always is what I though of too ;-] but you won't have "serial versioning". unless there is a version numer suffixed by that. On 29 October 2013 07:06, Luca Barbato wrote: > On 29/10/13 05:54, Rich Felker wrote: > > On Tue, Oct 29, 2013 at 03:48:21AM +0100, Luca Barbato wrote: > >> On 29/10/13 03:33, Rich Felker wrote: > >>> On Mon, Oct 28, 2013 at 08:13:09PM +0000, Paul Schutte wrote: > >>>> Hi Guys, > >>>> > >>>> Would it be possible for you to add the version of musl to the output > of > >>>> libc.so ? > >>>> > >>>> root@sabotage:~# /lib/libc.so > >>>> musl libc/dynamic program loader > >>>> usage: /lib/libc.so pathname [args] > >>>> > >>>> I have several machines with musl on it and it will be very helpful > to see > >>>> which version is installed. > >>> > >>> Indeed, this has been something I've wanted to add for a while, and > >>> which should definitely be in for 1.0. It's just a matter of doing the > >>> right thing in the build and release system to get the version in > >>> there, and it's not clear what the version should read for git builds > >>> between versions. I think this is a good chance to discuss that. > >> > >> git describe short signature might be the best option. > > > > Thanks for the git-fu help. I'm assuming you mean using something like > > "git describe --tags"? Use of this could be contingent on either a > > .git dir, or lack of a version file added to release tarballs. The > > only thing that's not clear is how to handle non-release source trees > > present on a build system that lacks a working git installation. > > if [ -d .git ]; then > VER=$(git describe --always | sed -e "s:v::") > if [ x"$(git diff-index --name-only HEAD)" != x ]; then > VER="${VER}-dirty" > fi > elif [ -f .version ]; then > VER=$(< .version) > else > VER="Unknown" > fi > > Or something along the lines. > > lu > -- *Ivan c00kiemon5ter Kanakarakis* >:3 --001a1133458e92426d04e9dbf357 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The $(< file) syntax is bash-only iirc.
git = describe --always is what I though of too ;-]
but you won't have "serial versioning".=C2=A0
unle= ss there is a version numer suffixed by that.




On 29 October 2013 07:06, Luca Barbato <lu_zero@gentoo.org>= wrote:
On 29/10/13 05:54, Rich Felker wrot= e:
> On Tue, Oct 29, 2013 at 03:48:21AM +0100, Luca Barbato wrote:
>> On 29/10/13 03:33, Rich Felker wrote:
>>> On Mon, Oct 28, 2013 at 08:13:09PM +0000, Paul Schutte wrote:<= br> >>>> Hi Guys,
>>>>
>>>> Would it be possible for you to add the version of musl to= the output of
>>>> libc.so ?
>>>>
>>>> root@sabotage:~# /lib/libc.so
>>>> musl libc/dynamic program loader
>>>> usage: /lib/libc.so pathname [args]
>>>>
>>>> I have several machines with musl on it and it will be ver= y helpful to see
>>>> which version is installed.
>>>
>>> Indeed, this has been something I've wanted to add for a w= hile, and
>>> which should definitely be in for 1.0. It's just a matter = of doing the
>>> right thing in the build and release system to get the version= in
>>> there, and it's not clear what the version should read for= git builds
>>> between versions. I think this is a good chance to discuss tha= t.
>>
>> git describe short signature might be the best option.
>
> Thanks for the git-fu help. I'm assuming you mean using something = like
> "git describe --tags"? Use of this could be contingent on ei= ther a
> .git dir, or lack of a version file added to release tarballs. The
> only thing that's not clear is how to handle non-release source tr= ees
> present on a build system that lacks a working git installation.

=C2=A0 =C2=A0 if [ -d .git ]; then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 VER=3D$(git describe --always | sed -e "s:= v::")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ x"$(git diff-index --name-only HEAD)&= quot; !=3D x ]; then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 VER=3D"${VER}-dirty" =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
=C2=A0 =C2=A0 elif [ -f .version ]; then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 VER=3D$(< .version)
=C2=A0 =C2=A0 else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 VER=3D"Unknown"
=C2=A0 =C2=A0 fi

Or something along the lines.

lu



--
Ivan c00kiemon5ter Kanakarakis =C2=A0>:3=C2=A0
--001a1133458e92426d04e9dbf357--