Date: Mon, 4 Jul 2016 12:47:54 -0400 From: Baho Utot <baho-utot@columbus.rr.com> To: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: Getting port version Message-ID: <db244fc0-fd05-a7a3-570d-0ad8dfff71a0@columbus.rr.com> In-Reply-To: <CAOc73CABRSBdykdjYRJaHFaZyhq0ejC3iyiH-_2E34RSJVBJmQ@mail.gmail.com> References: <d5212e65-513d-38f3-529d-526b899600b6@columbus.rr.com> <CAOc73CABRSBdykdjYRJaHFaZyhq0ejC3iyiH-_2E34RSJVBJmQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/04/16 12:39, Ben Woods wrote: > On Monday, 4 July 2016, Baho Utot <baho-utot@columbus.rr.com > <mailto:baho-utot@columbus.rr.com>> wrote: > > I am creating a bourne script ( I would use python but that is not > in base ) to build packages. > > Synth, poudiere etc will not work, this is for a raspberry pi 2 > and those tools don't run on the platform > > I need to get the port version from the port > > 1. so I can construct a string and have a look see if that > port is already in the repository > > 2. I want to know what version I am building > > I have tried: > > #!/bin/sh > > for a in "dns/unbound ports-mgmt/pkg lang/perl5.20" ; do > VERSION="$( grep PORTVERSION= /usr/ports/${a}/Makefile )" > > printf "Package: %s Version: %s\n" "${a}" "${VERSION##*=}" > > done > > > That fails because all ports don't follow that, for instance: > > lang/perl5.20 has PORTVERSION= ${PERL_VERSION} > > ports-mgmt/pkg has DISTVERSION= <what ever> > > Is there some other way I can fetch the version from the Makefile? > > > I think it should be sufficient to run this from within the port > directory: > $ make -VPORTVERSION > > You can use that technique to print out any other Makefile variable > values. > > Regards, > Ben > > > -- > > -- > From: Benjamin Woods > woodsb02@gmail.com <mailto:woodsb02@gmail.com> Ok I will give it a go
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?db244fc0-fd05-a7a3-570d-0ad8dfff71a0>