[PATCH 1/4] spawn: expand AUR_CONFIG to the full path
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(+) 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: -- 2.28.0
Signed-off-by: Filipe Laíns <lains@archlinux.org> --- TESTING | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTING b/TESTING index d7df3672..17c6fbc7 100644 --- a/TESTING +++ b/TESTING @@ -29,7 +29,7 @@ INSTALL. 4) Prepare the testing database: $ cd /path/to/aurweb/ - $ python -m aurweb.initdb + $ AUR_CONFIG=conf/config python -m aurweb.initdb $ cd /path/to/aurweb/schema $ ./gendummydata.py out.sql @@ -37,4 +37,4 @@ INSTALL. 5) Run the test server: - $ AUR_CONFIG='/path/to/aurweb/conf/config' python -m aurweb.spawn + $ AUR_CONFIG=conf/config python -m aurweb.spawn -- 2.28.0
Signed-off-by: Filipe Laíns <lains@archlinux.org> --- TESTING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TESTING b/TESTING index 17c6fbc7..d666b3ca 100644 --- a/TESTING +++ b/TESTING @@ -14,7 +14,8 @@ INSTALL. # pacman -S --needed php php-sqlite sqlite words fortune-mod \ python python-sqlalchemy python-alembic \ python-fastapi uvicorn nginx \ - python-authlib python-itsdangerous python-httpx + python-authlib python-itsdangerous python-httpx \ + words fortune-mod Ensure to enable the pdo_sqlite extension in php.ini. -- 2.28.0
Signed-off-by: Filipe Laíns <lains@archlinux.org> --- TESTING | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TESTING b/TESTING index d666b3ca..972bce2c 100644 --- a/TESTING +++ b/TESTING @@ -30,11 +30,11 @@ INSTALL. 4) Prepare the testing database: $ cd /path/to/aurweb/ + $ AUR_CONFIG=conf/config python -m aurweb.initdb - $ cd /path/to/aurweb/schema - $ ./gendummydata.py out.sql - $ sqlite3 path/to/aurweb.sqlite3 < out.sql + $ schema/gendummydata.py data.sql + $ sqlite3 aurweb.sqlite3 < data.sql 5) Run the test server: -- 2.28.0
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!
participants (2)
-
Filipe Laíns
-
Lukas Fleischer