pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: www/gitea: remove barriers for new users (git binary not found in PATH)



Hello Greg,

Am 05.01.2022 um 14:31 schrieb Greg Troxel:

Matthias Petermann <mp%petermann-it.de@localhost> writes:

So, since gitea already has the pkg git-base as a dependency, the git
binary can be assumed to exist under ${PREFIX}/bin. What do you think
about adding the following to the app.ini.sample?

```
[git]
PATH = @PREFIX@/bin/git
```

The norm in pkgsrc is usually to discover and substitute explicit paths
in the code.  That may be too hard.

But changing an example as a workaround does not seem like a bad thing.

I guess another question is what else is needed, and if gitea should
prefix it's @BINDIR@ to PATH itself.

Thank you for your quick reply and your assessment.

Specifically in the case of gitea, it defaults to looking for the git binary in the PATH set in the environment, so I *suspect* that there is no explicit path set in the Go code.

So, in theory, it should be enough to add /usr/pkg/bin to the PATH before starting gitea. However, I have not been able to do this in the following ways so far:

a) create a .profile in the $HOME of the "git" user (/var/db/gitea) with the corresponding exports.

b) inserting "export PATH=$PATH:/usr/pkg/bin" in the rc-script of gitea

I must confess that I haven't fully understood the whole thing yet. At least b) had mostly worked in similar cases in the past, since the process running the script normally passes the PATH to all child processes by exporting it.

What else I noticed: in the rc-script of gitea a variable gitea_env is defined. But in rc.subr it looks like it extends the environment and does not replace it. Accordingly, the PATH should also remain unaffected.

I should investigate this again in detail....

Kind regards
Matthias


Home | Main Index | Thread Index | Old Index