Re: pkgs contain non URL safe characters

From: Ronald Klop <ronald-lists_at_klop.ws>
Date: Wed, 02 Mar 2022 12:50:10 UTC
 
Van: Aristedes Maniatis <ari@ish.com.au>
Datum: woensdag, 2 maart 2022 04:03
Aan: Ronald Klop <ronald-lists@klop.ws>, freebsd-ports@FreeBSD.org
Onderwerp: Re: pkgs contain non URL safe characters
> 
> 
> On 1/3/2022 10:57pm, Ronald Klop wrote:
> >
> > You could try the untested patch below as "compatibility fix", but I'm > not sure if that will not break other valid URLs passed to fetch/pkg.
> > Apparently pkg embeds libfetch statically: > https://github.com/freebsd/pkg/tree/master/external/libfetch .
> > This patch is against the FreeBSD base.
> >
> > diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
> > index 82a3c5e451a..496425cea47 100644
> > --- a/lib/libfetch/fetch.c
> > +++ b/lib/libfetch/fetch.c
> > @@ -451,7 +451,7 @@ fetchParseURL(const char *URL)
> >                 }
> >                 u->doc = doc;
> >                 while (*p != '\0') {
> > -                       if (!isspace((unsigned char)*p)) {
> > +                       if (!isspace((unsigned char)*p) && *p != '+') {
> >                                 *doc++ = *p++;
> >                         } else {
> >                                 *doc++ = '%';
> >
> 
> Thanks for that. I think there are both static and normal versions of pkg. The static binary is at pkg-static for bootstrapping a system which might be missing libraries.
> 
> Since I don't want to be patching the system libs on all our servers, I think I'll keep my poudriere hook hack for now.
> 
> 
> If the openjdk port maintainers are on this list, please consider removing the + from the package names. An underscore might do equally well.
> 
> 
> Thanks for your help and insight.
> 
> Ari
>  
> 
> 
> 


Hi,

I improved the patch which would make libfetch more compatible with broken servers like your example.
It is currently in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262283 . I have no idea when the maintainer of libfetch has time for this. His first reaction in private mail was that it looked ok. If that patch is accepted in base it will be needed for the https://github.com/freebsd/pkg maintainer to update the copy of libfetch in pkg (and release a new version) before you can use it.
So even if all signs go green eventually, you can hold on to your poudriere hook hack for a while. 😉

Regards,
Ronald.