]> mop.ddnsfree.com - git repositories - brisk.git/commitdiff
INSTALL.sh: the -a option had no effect at all
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:35:51 +0000 (12:35 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:36:07 +0000 (12:36 +0200)
The sed looked for the BRISK_AUTH_CONF define in Obj/auth.phh, where it has
never been: it lives in Obj/dbase_file.phh. sed did not find the file, wrote
the error in the middle of the other installation lines, and the installation
carried on, so -a was ignored without anybody noticing.

The define is now looked for where it actually is, and if it is not found the
installation says so instead of keeping quiet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE

INSTALL.sh

index fe9bbdfbff82f5b8e763bb25b8bde573091f2bcd..a424076cd4f4a4597cc159b371448e72c55bfce1 100755 (executable)
@@ -449,7 +449,16 @@ s@define *( *'PROXY_PATH',[^)]*)@define('PROXY_PATH', \"$proxy_path\")@g;
 s@define *( *'BSK_BUSTING',[^)]*)@define('BSK_BUSTING', \"$bsk_busting\")@g;
 s@define *( *'BRISK_CONF',[^)]*)@define('BRISK_CONF', \"$brisk_conf\")@g;" ${web_path}__/Obj/brisk.phh
 
-sed -i "s@define *( *'BRISK_AUTH_CONF',[^)]*)@define('BRISK_AUTH_CONF', \"$brisk_auth_conf\")@g" ${web_path}__/Obj/auth.phh
+# The define is not in Obj/auth.phh, where this sed looked for it without
+# ever finding it and without saying so: -a was silently useless. It is in
+# Obj/dbase_file.phh. It is now looked for where it actually is, so that a
+# future move does not break the option again.
+auth_conf_file="$(find ${web_path}__ -type f -name '*.ph*' -exec grep -l "define *( *'BRISK_AUTH_CONF'" {} \;)"
+if [ -z "$auth_conf_file" ]; then
+    echo "WARNING: define BRISK_AUTH_CONF not found, -a not applied"
+else
+    sed -i "s@define *( *'BRISK_AUTH_CONF',[^)]*)@define('BRISK_AUTH_CONF', \"$brisk_auth_conf\")@g" $auth_conf_file
+fi
 
 sed -i "s@var \+cookiepath \+= \+\"[^\"]*\";@var cookiepath = \"$prefix_path\";@g" ${web_path}__/commons.js