Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2020 10:58:20 +0000
From:      Nuno Teixeira <ed.arrakis@gmail.com>
To:        Chris <portmaster@bsdforge.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: How to fix/patch hardcoded values
Message-ID:  <CAFDf7UJ5snJ4GSODm9=qaifj6jxywFoarODsq81fZHTFR_mduQ@mail.gmail.com>
In-Reply-To: <eef9ec4a89b5dc238f85c90d1d2199ee@bsdforge.com>
References:  <CAFDf7ULqj2pzPb7WX-3oee_HHye3jnk93nV-XGbr1cjAcwgYqQ@mail.gmail.com> <20201229080734.ibew4kwiejxihvob@aching.in.mat.cc> <eef9ec4a89b5dc238f85c90d1d2199ee@bsdforge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello!,

man(1) gitup only references:
Files:
${PREFIX}/etc/gitup.conf  Default location of the gitup configuration file.

But yes, thats makes sense a per-user .config file, maybe in ~ or in
~/.config folder.

Thanks!

Chris <portmaster@bsdforge.com> escreveu no dia ter=C3=A7a, 29/12/2020 =C3=
=A0(s)
08:23:

> On 2020-12-29 00:07, Mathieu Arnold wrote:
> > On Sun, Dec 27, 2020 at 09:58:13PM +0000, Nuno Teixeira wrote:
> >> Hello I've just submited a new port net/gitup
> >> <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252220>; and I use=
d a
> >> simple workaround to help program find its config in /usr/local/etc
> instead
> >> of (hardcoded) ./
> >>
> >> --- gitup.c.orig 2020-12-27 21:16:22 UTC
> >> +++ gitup.c
> >> @@ -2030,7 +2030,7 @@ main(int argc, char **argv)
> >> ...
> >> - const char         *configuration_file =3D "./gitup.conf";
> >> + const char         *configuration_file =3D "/usr/local/etc/gitup.con=
f";
> >>
> >> Now I'm thinking that this might not be the best fix in case PREFIX is=
 a
> >> different one.
> >>
> >> Could I have an opinion on this?
> >
> > You need to change the patch to use %%PREFIX%% or %%LOCALBASE%%
> > depending on whether this is a reference to a path/file installed by th=
e
> > software or by one of its dependency.  Then, in a post-patch target, yo=
u
> > need to use REINPLACE_CMD to replace those to by they variables
> > equivalent, something like:
> >
> > post-patch:
> >       ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX}' ${WRKSRC}/githup.c
> It seems to me that you might also want to allow the user to reference
> a/their config from within their home dir (~/). But of course that's
> purely optional. Just thought I might mention it in case it mattered.
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UJ5snJ4GSODm9=qaifj6jxywFoarODsq81fZHTFR_mduQ>