Environment Variable Support in config file
Description:
This feature request proposes adding support for referencing environment variables within the paru configuration file (paru.conf). This would allow users to dynamically configure paru based on system or user-defined environment variables.
Motivation:
Currently, paru's configuration options are statically defined within paru.conf. This can be limiting in situations where users want to adapt paru's behavior based on external factors. Environment variable support would provide greater flexibility and allow for more dynamic configuration.
Possible Use Cases:
Setting download directory based on a user-defined environment variable (e.g., $DOWNLOAD_DIR). Enabling/disabling specific repositories based on the presence of a flag variable (e.g., $ENABLE_AUR). Configuring build flags based on environment variables related to system resources (e.g., $MAKEFLAGS).
Benefits:
Increased flexibility and adaptability for paru configuration. Improved user experience by allowing for dynamic configuration based on environment variables.
Drawbacks:
Increased complexity for some users who might not be familiar with environment variables. (but if you are bidoulling paru's config file you might not be concerned) Potential for introducing errors if environment variables are not set correctly.
For some options if this issue is picked up during/after migration to .NET Core, or even just as inspiration regarding into which folder build should occur and what should get moved and patched where:
- https://github.com/dotnet/runtime/issues/3453
- https://github.com/0xd4d/dnSpy/blob/master/Build/AppHostPatcher/Program.cs
WRT 3453 above, the money shot is in vitek-karas' comment of July 8 2019 (https://github.com/dotnet/runtime/issues/3453#issuecomment-509249471)
<UsingTask TaskName="CreateAppHost" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent"
DependsOnTargets="_GetAppHostPaths">
<CreateAppHost AppHostSourcePath="$(AppHostSourcePath)"
AppHostDestinationPath="$(OutputPath)\app.exe"
AppBinaryName="bin\app.dll"
IntermediateAssembly="$(OutputPath)\app.dll"/>
</Target>