Discussion:
Getting port version
(too old to reply)
Baho Utot
2016-07-04 16:23:30 UTC
Permalink
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?
Matthew Seaman
2016-07-04 16:36:00 UTC
Permalink
Post by Baho Utot
Is there some other way I can fetch the version from the Makefile?
Use make(1):

make -C /usr/ports/some/thing -V PKGNAME

or

make -C /usr/ports/some/thing -V PORTVERSION

Cheers,

Matthew
Ben Woods
2016-07-04 16:39:05 UTC
Permalink
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
#!/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
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
***@gmail.com
Baho Utot
2016-07-04 16:47:54 UTC
Permalink
Post by Baho Utot
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
#!/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
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
$ make -VPORTVERSION
You can use that technique to print out any other Makefile variable
values.
Regards,
Ben
--
--
From: Benjamin Woods
Ok I will give it a go
Baho Utot
2016-07-04 16:47:35 UTC
Permalink
Post by Matthew Seaman
Post by Baho Utot
Is there some other way I can fetch the version from the Makefile?
make -C /usr/ports/some/thing -V PKGNAME
or
make -C /usr/ports/some/thing -V PORTVERSION
Cheers,
Matthew
Ok I will give it a go
Solene Rapenne
2016-07-04 16:51:34 UTC
Permalink
Hello

I am not sure but maybe you can find a tool for building packages in ports-mgmt ? I was thinking about portmaster for example.

Kind regards
Post by Baho Utot
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
#!/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
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?
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
Baho Utot
2016-07-04 17:03:53 UTC
Permalink
Post by Solene Rapenne
Hello
I am not sure but maybe you can find a tool for building packages in
ports-mgmt ? I was thinking about portmaster for example.
Kind regards
I have been missing my daily beatings and I have not had a good one
lately so I am going to roll my own ;)

Thanks
RW via freebsd-questions
2016-07-04 17:23:23 UTC
Permalink
On Mon, 4 Jul 2016 17:36:00 +0100
Post by Matthew Seaman
Post by Baho Utot
Is there some other way I can fetch the version from the Makefile?
make -C /usr/ports/some/thing -V PKGNAME
or
make -C /usr/ports/some/thing -V PORTVERSION
or PKGVERSION - PORTVERSION doesn't include the epoch

Loading...