Re: portsnap broken?

2019-07-06 Thread Matthew D. Fuller
On Wed, Jul 03, 2019 at 10:11:41AM +0200 I heard the voice of
Kurt Jaeger, and lo! it spake thus:
> 
> > With a little script to pull the snapdates:
> > [...]
> 
> Nice! Can you put that script somewhere for others to use ?

It's pretty small and straightforward.  Attached.  It _is_ based on a
bit of reverse-engineering of /usr/sbin/portsnap, so there may well be
a better way already extant of getting the info (and there probably
should be, if there isn't), but it Works For Me...

#!/usr/bin/env perl
use strict;
use warnings;


# Find the server list
my @servers;
{
use Net::DNS;
my $res = Net::DNS::Resolver->new;
my $srv = $res->search('_http._tcp.portsnap.freebsd.org', 'SRV');

die "Nothing from SRV request: @{[$res->errorstring]}\n" unless $srv;

foreach my $rr (grep { $_->type eq 'SRV' } $srv->answer)
{
my $si = {
'priority' => $rr->priority,
'host' => $rr->target,
};
push @servers, $si;
}

@servers = sort {
my $r;
return $r if($r = ($a->{priority} <=> $b->{priority}));
return $r if($r = ($a->{host} cmp $b->{host}));
return 0;
} @servers;
}


# We need to store temp files to go through openssl...
my $tmpdir;
{
use File::Temp qw/tempdir/;
$tmpdir = tempdir(CLEANUP => 1);
die "Failed making tempdir" unless -d $tmpdir;
}


# Load snapshot info and check timestamp from each
for my $s (@servers)
{
my $host = $s->{host};
my $key  = "http://$host/pub.ssl;;
my $snap = "http://$host/latest.ssl;;

my $keyout  = "$tmpdir/$host.key";
my $snapout = "$tmpdir/$host.snap";

use LWP::UserAgent;
my $web  = LWP::UserAgent->new(timeout => 5);
my $res = $web->get($key, ':content_file' => $keyout);
if(!$res->is_success)
{
$s->{failed} = 1;
print STDERR "$host key fetch failed: @{[$res->status_line]}\n";
next;
}

$res = $web->get($snap, ':content_file' => $snapout);
if(!$res->is_success)
{
$s->{failed} = 1;
print STDERR "$host snap fetch failed: 
@{[$res->status_line]}\n";
next;
}


# Now we use openssl to dissect
my @cmd = ( qw(openssl rsautl -pubin -inkey), $keyout, '-verify' );

use IPC::Run3;
my ($out, $err);
run3(\@cmd, $snapout, \$out, \$err);
my $rc = $? >> 8;
if($rc  != 0)
{
$s->{failed} = 1;
print STDERR "$host: openssl returned $rc\n$err\n";
next;
}

# Second field of $out is the timestamp
chomp $out;
my $ts = (split/\|/, $out)[1];
$s->{timestamp} = $ts;
}


# And show the results
my $now = time;
for my $s (@servers)
{
my $host = $s->{host};
(my $sh = $host) =~ s/\.portsnap\.freebsd\.org$//;
if($s->{failed})
{
print "$sh: failed\n";
next;
}

my $pri  = $s->{priority};
my $ts   = $s->{timestamp};

# How old?
my $old = $now - $ts;
my $age;
if($old > 86400)
{
my $days = int($old / 86400);
$age .= "$days days, ";
$old -= ($days * 86400);
}
{
my $hours = int($old / 3600);
$old -= ($hours * 3600);
my $mins = int($old / 60);
$old -= ($mins * 60);
$age .= sprintf("%02d:%02d:%02d", $hours, $mins, $old);
}

use Date::Format;
chomp(my $ftime = ctime($ts));

printf "%20s: $ftime  ($age ago)\n", $sh;
}
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: How to handle go dependencies

2019-07-06 Thread Dmitri Goutnik via freebsd-ports
Hi Matthias,

On 19-07-06 23:30:33, Matthias Fechner wrote:
> Am 06.07.2019 um 21:48 schrieb Dmitri Goutnik:
> > -USES= gmake go:no_targets
> > +USES= gmake go:modules,no_targets
> >
> > It adds -mod=vendor build flag that tells Go to not try to download
> > anything and assume that all dependencies are already in vendor directory.
> 
> hm, it does not seems to have any impact it does not stop to complain:
> # go install
> go: finding github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
> 

It appears that Go build flags need to be passed down to `go build` invocation 
with MAKE_ENV:

+MAKE_ENV=   GOFLAGS="${GO_BUILDFLAGS}"

With that change, the build then fails later due to missing statFileSystemType 
func definition for freebsd:

# gitlab.com/gitlab-org/gitaly/internal/helper/fstype
internal/helper/fstype/fstype.go:7:15: undefined: statFileSystemType

Which can be fixed by just copying the linux version (this probably needs to 
be upstreamed):

post-patch:
${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" 
${WRKSRC}/config.toml.example
${MV} ${WRKSRC}/config.toml.example ${WRKSRC}/config.toml.sample
+   ${CP} ${WRKSRC}/internal/helper/fstype/detect_linux.go 
${WRKSRC}/internal/helper/fstype/detect_freebsd.go

Best regards,

-- Dmitri Goutnik
d...@syrec.org
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: How to handle go dependencies

2019-07-06 Thread Matthias Fechner
Am 06.07.2019 um 21:48 schrieb Dmitri Goutnik:
> -USES= gmake go:no_targets
> +USES= gmake go:modules,no_targets
>
> It adds -mod=vendor build flag that tells Go to not try to download
> anything and assume that all dependencies are already in vendor directory.

hm, it does not seems to have any impact it does not stop to complain:
# go install
go: finding github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
go: finding github.com/cloudflare/tableflip
v0.0.0-20190329062924-8392f1641731
go: finding google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898
go: finding github.com/libgit2/git2go v0.0.0-20190104134018-ecaeb7a21d47
go: finding github.com/prometheus/client_golang v0.9.3
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding gitlab.com/gitlab-org/gitaly-proto v1.32.0
go: finding github.com/stretchr/testify v1.2.2
go: finding gitlab.com/gitlab-org/labkit v0.0.0-20190221122536-0c3fc7cdd57c
go: finding github.com/BurntSushi/toml v0.3.1
go: golang.org/x/net@v0.0.0-20190311183353-d8887717615a: Get
https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: gitlab.com/gitlab-org/gitaly-proto@v1.32.0: Get
https://proxy.golang.org/gitlab.com/gitlab-org/gitaly-proto/@v/v1.32.0.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/prometheus/client_golang@v0.9.3: Get
https://proxy.golang.org/github.com/prometheus/client_golang/@v/v0.9.3.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: finding github.com/tinylib/msgp v1.1.0
go: github.com/cloudflare/tableflip@v0.0.0-20190329062924-8392f1641731:
Get
https://proxy.golang.org/github.com/cloudflare/tableflip/@v/v0.0.0-20190329062924-8392f1641731.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/getsentry/raven-go v0.1.2
go: gitlab.com/gitlab-org/labkit@v0.0.0-20190221122536-0c3fc7cdd57c: Get
https://proxy.golang.org/gitlab.com/gitlab-org/labkit/@v/v0.0.0-20190221122536-0c3fc7cdd57c.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: google.golang.org/genproto@v0.0.0-20181202183823-bd91e49a0898: Get
https://proxy.golang.org/google.golang.org/genproto/@v/v0.0.0-20181202183823-bd91e49a0898.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/BurntSushi/toml@v0.3.1: Get
https://proxy.golang.org/github.com/%21burnt%21sushi/toml/@v/v0.3.1.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0: Get
https://proxy.golang.org/github.com/grpc-ecosystem/go-grpc-middleware/@v/v1.0.0.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/stretchr/testify@v1.2.2: Get
https://proxy.golang.org/github.com/stretchr/testify/@v/v1.2.2.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: finding google.golang.org/grpc v1.16.0
go: github.com/libgit2/git2go@v0.0.0-20190104134018-ecaeb7a21d47: Get
https://proxy.golang.org/github.com/libgit2/git2go/@v/v0.0.0-20190104134018-ecaeb7a21d47.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: finding github.com/sirupsen/logrus v1.2.0
go: finding github.com/golang/protobuf v1.3.1
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: finding github.com/kelseyhightower/envconfig v1.3.0
go: golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a: Get
https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190215142949-d0b11bdaac8a.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/golang/protobuf@v1.3.1: Get
https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.1.info: dial
tcp 172.217.20.113:443: connect: can't assign requested address
go: google.golang.org/grpc@v1.16.0: Get
https://proxy.golang.org/google.golang.org/grpc/@v/v1.16.0.info: dial
tcp 172.217.20.113:443: connect: can't assign requested address
go: golang.org/x/sync@v0.0.0-20181221193216-37e7f081c4d4: Get
https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20181221193216-37e7f081c4d4.info:
dial tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/tinylib/msgp@v1.1.0: Get
https://proxy.golang.org/github.com/tinylib/msgp/@v/v1.1.0.info: dial
tcp 172.217.20.113:443: connect: can't assign requested address
go: github.com/sirupsen/logrus@v1.2.0: Get
https://proxy.golang.org/github.com/sirupsen/logrus/@v/v1.2.0.info: dial
tcp 172.217.20.113:443: connect: can't assign requested address
go: gopkg.in/yaml.v2@v2.2.2: Get
https://proxy.golang.org/gopkg.in/yaml.v2/@v/v2.2.2.info: dial tcp
172.217.20.113:443: connect: can't assign requested address
go: github.com/getsentry/raven-go@v0.1.2: Get

Re: How to handle go dependencies

2019-07-06 Thread Dmitri Goutnik via freebsd-ports
Hi Matthias,

On 19-07-06 19:52:04, Matthias Fechner wrote:

> I used now USES= gmake |go:no_targets|

In addition to `no_targets`, you'd also want a `modules` arg :

-USES=   gmake go:no_targets
+USES=   gmake go:modules,no_targets

It adds -mod=vendor build flag that tells Go to not try to download anything 
and assume that all dependencies are already in vendor directory.

Best regards,

--
Dmitri Goutnik
d...@syrec.org
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: How to handle go dependencies

2019-07-06 Thread Matthias Fechner
Dear Dmitri,

at first thanks a lot for your suggestions.
The current version of the Makefile is always here:
https://gitlab.fechner.net/mfechner/Gitlab/blob/12.0/devel/gitaly/Makefile

Other answer under your suggestions.

Am 23.06.2019 um 23:40 schrieb Dmitri Goutnik via freebsd-ports:
> +USES= gmake 

I used now USES= gmake |go:no_targets|

|This pulls in go as dependency. Without go:no_targets I got an error
message that go was not found.
|

|
|

> "gitaly-proto" is not a valid group name (contains "-"); can be fixed by 
> changing the group name to e.g. "gitaly_proto"

thanks, now I was able to generate the distinfo file.

>  post-patch:
>   ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" 
> ${WRKSRC}/config.toml.example
>   ${MV} ${WRKSRC}/config.toml.example ${WRKSRC}/config.toml.sample
> - ${RM} ${WRKSRC}/go.mod

removed.

But now I have the problem that go does not find the libs.
I get now the error messages like:
# go install
go: finding github.com/getsentry/raven-go v0.1.2
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding github.com/golang/protobuf v1.3.1
go: finding gitlab.com/gitlab-org/gitaly-proto v1.32.0
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/cloudflare/tableflip
v0.0.0-20190329062924-8392f1641731
go: finding github.com/tinylib/msgp v1.1.0
go: finding github.com/sirupsen/logrus v1.2.0
go: finding github.com/libgit2/git2go v0.0.0-20190104134018-ecaeb7a21d47
go: finding github.com/BurntSushi/toml v0.3.1
go: github.com/BurntSushi/toml@v0.3.1: Get
https://proxy.golang.org/github.com/%21burnt%21sushi/toml/@v/v0.3.1.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/getsentry/raven-go@v0.1.2: Get
https://proxy.golang.org/github.com/getsentry/raven-go/@v/v0.1.2.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/cloudflare/tableflip@v0.0.0-20190329062924-8392f1641731:
Get
https://proxy.golang.org/github.com/cloudflare/tableflip/@v/v0.0.0-20190329062924-8392f1641731.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/sirupsen/logrus@v1.2.0: Get
https://proxy.golang.org/github.com/sirupsen/logrus/@v/v1.2.0.info: dial
tcp 172.217.19.209:443: connect: can't assign requested address
go: finding google.golang.org/grpc v1.16.0
go: finding google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898
go: github.com/libgit2/git2go@v0.0.0-20190104134018-ecaeb7a21d47: Get
https://proxy.golang.org/github.com/libgit2/git2go/@v/v0.0.0-20190104134018-ecaeb7a21d47.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: finding github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: github.com/stretchr/testify@v1.2.2: Get
https://proxy.golang.org/github.com/stretchr/testify/@v/v1.2.2.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: finding gopkg.in/yaml.v2 v2.2.2
go: golang.org/x/sync@v0.0.0-20181221193216-37e7f081c4d4: Get
https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20181221193216-37e7f081c4d4.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: finding gitlab.com/gitlab-org/labkit v0.0.0-20190221122536-0c3fc7cdd57c
go: finding github.com/prometheus/client_golang v0.9.3
go: github.com/tinylib/msgp@v1.1.0: Get
https://proxy.golang.org/github.com/tinylib/msgp/@v/v1.1.0.info: dial
tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/golang/protobuf@v1.3.1: Get
https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.1.info: dial
tcp 172.217.19.209:443: connect: can't assign requested address
go: gitlab.com/gitlab-org/gitaly-proto@v1.32.0: Get
https://proxy.golang.org/gitlab.com/gitlab-org/gitaly-proto/@v/v1.32.0.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: finding github.com/kelseyhightower/envconfig v1.3.0
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
go: gitlab.com/gitlab-org/labkit@v0.0.0-20190221122536-0c3fc7cdd57c: Get
https://proxy.golang.org/gitlab.com/gitlab-org/labkit/@v/v0.0.0-20190221122536-0c3fc7cdd57c.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0: Get
https://proxy.golang.org/github.com/grpc-ecosystem/go-grpc-middleware/@v/v1.0.0.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: golang.org/x/net@v0.0.0-20190311183353-d8887717615a: Get
https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.0: Get
https://proxy.golang.org/github.com/grpc-ecosystem/go-grpc-prometheus/@v/v1.2.0.info:
dial tcp 172.217.19.209:443: connect: can't assign requested address
go: 

SF and SAVANAH Shortcuts

2019-07-06 Thread Cy Schubert
Are there any shortcuts that enable GH-like download from SF or SAVANAH 
git repos? There are two projects I would like to track through -devel 
ports, one on SF and the other on SAVANAH, each with its own git repo 
not on github.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


FreeBSD ports you maintain which are out of date

2019-07-06 Thread portscout
Dear port maintainer,

The portscout new distfile checker has detected that one or more of your
ports appears to be out of date. Please take the opportunity to check
each of the ports listed below, and if possible and appropriate,
submit/commit an update. If any ports have already been updated, you can
safely ignore the entry.

You will not be e-mailed again for any of the port/version combinations
below.

Full details can be found at the following URL:
http://portscout.freebsd.org/po...@freebsd.org.html


Port| Current version | New version
+-+
sysutils/grub2  | 2.00| 2.04
+-+


If any of the above results are invalid, please check the following page
for details on how to improve portscout's detection and selection of
distfiles on a per-port basis:

http://portscout.freebsd.org/info/portscout-portconfig.txt

Thanks.
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"