kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

Hooks cannot change environment variables #246

Closed f1nniboy closed 3 years ago

f1nniboy commented 3 years ago

Description

Hooks cannot change environment variables of the build script because of the recent hook change. This is more of a feature request than an issue. I assume that this is intended behaviour?

Error message

Not applicable.

Verbose log

Not applicable.

How to reproduce

Create a dummy package with a build script that just does:

#!/bin/sh -e
echo $CFLAGS

Create a hook with the following contents:

#!/bin/sh
export CFLAGS="test"

Try to build the dummy package and observe that the CFLAGS variable wasn't affected by the hook.

I made sure that the hook was actually used.


Issues without attached log file will be closed unless steps to reproduce the problem are provided in place of it. Issues not using the template will be closed. Feature requests and otherwise non-issues can disregard this notice.

dylanaraps commented 3 years ago

This is intended behavior. Hooks no longer have access to the same shell environment as the package manager (not its internals). Environment variables can of course be set the usual way. This change only affects hooks.