[1/4] spawn: expand AUR_CONFIG to the full path

Message ID 20200813144600.3703433-1-lains@archlinux.org
State New
Headers show
Series [1/4] spawn: expand AUR_CONFIG to the full path | expand

Commit Message

Filipe Laíns Aug. 13, 2020, 2:45 p.m. UTC
This allows using a relative path for the config. PHP didn't play well
with it.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
---
 aurweb/spawn.py | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Lukas Fleischer Aug. 14, 2020, 1:02 a.m. UTC | #1
On Thu, 13 Aug 2020 at 10:45:58, Filipe Laíns wrote:
> This allows using a relative path for the config. PHP didn't play well
> with it.
> 
> Signed-off-by: Filipe Laíns <lains@archlinux.org>
> ---
>  aurweb/spawn.py | 4 ++++
>  1 file changed, 4 insertions(+)

Merged into pu (with a typo fix for the commit message of patch 3/4).
Thanks!

Patch

diff --git a/aurweb/spawn.py b/aurweb/spawn.py
index 46d534d9..3c5130d7 100644
--- a/aurweb/spawn.py
+++ b/aurweb/spawn.py
@@ -11,6 +11,7 @@  configuration anyway.
 import argparse
 import atexit
 import os
+import os.path
 import subprocess
 import sys
 import tempfile
@@ -87,6 +88,9 @@  def start():
         return
     atexit.register(stop)
 
+    if 'AUR_CONFIG' in os.environ:
+        os.environ['AUR_CONFIG'] = os.path.realpath(os.environ['AUR_CONFIG'])
+
     try:
         terminal_width = os.get_terminal_size().columns
     except OSError: