ignore PRTY_CONFIG if autodiscovered to prevent dupe vols

This commit is contained in:
ed 2026-08-15 09:56:13 +00:00
parent 825f1c9456
commit 14e2d79b08
3 changed files with 15 additions and 5 deletions

View file

@ -40,6 +40,9 @@ VT100 = "--ansi" in sys.argv or (
) )
# introduced in anniversary update # introduced in anniversary update
zs = os.environ.get("PRTY_CONFIG", "")
CFG_DEF = [zs] if zs else []
ANYWIN = WINDOWS or sys.platform in ["msys", "cygwin"] ANYWIN = WINDOWS or sys.platform in ["msys", "cygwin"]
MACOS = platform.system() == "Darwin" MACOS = platform.system() == "Darwin"

View file

@ -23,6 +23,7 @@ import uuid
from .__init__ import ( from .__init__ import (
ANYWIN, ANYWIN,
CFG_DEF,
CORES, CORES,
EXE, EXE,
MACOS, MACOS,
@ -63,6 +64,7 @@ from .util import (
URL_BUG, URL_BUG,
URL_PRJ, URL_PRJ,
Daemon, Daemon,
absreal,
align_tab, align_tab,
b64enc, b64enc,
ctypes, ctypes,
@ -105,10 +107,6 @@ except:
u = unicode u = unicode
zsid = uuid.uuid4().urn[4:] zsid = uuid.uuid4().urn[4:]
CFG_DEF = [os.environ.get("PRTY_CONFIG", "")]
if not CFG_DEF[0]:
CFG_DEF.pop()
FULL_HELP = os.environ.get("PRTY_FULL_HELP", "") FULL_HELP = os.environ.get("PRTY_FULL_HELP", "")
@ -2217,6 +2215,9 @@ def main(argv: Optional[list[str]] = None) -> None:
argv.pop(n) argv.pop(n)
break break
if CFG_DEF:
CFG_DEF[0] = absreal(CFG_DEF[0])
ensure_locale() ensure_locale()
ensure_webdeps() ensure_webdeps()

View file

@ -13,7 +13,7 @@ import threading
import time import time
from datetime import datetime from datetime import datetime
from .__init__ import ANYWIN, MACOS, PY2, TYPE_CHECKING, WINDOWS, E from .__init__ import ANYWIN, CFG_DEF, MACOS, PY2, TYPE_CHECKING, WINDOWS, E
from .bos import bos from .bos import bos
from .cfg import flagdescs, permdescs, vf_bmap, vf_cmap, vf_vmap from .cfg import flagdescs, permdescs, vf_bmap, vf_cmap, vf_vmap
from .pwhash import PWHash from .pwhash import PWHash
@ -25,6 +25,7 @@ from .util import (
FN_EMB, FN_EMB,
HAVE_SQLITE3, HAVE_SQLITE3,
IMPLICATIONS, IMPLICATIONS,
LOG,
META_NOBOTS, META_NOBOTS,
MIMES, MIMES,
SQLITE_VER, SQLITE_VER,
@ -4079,6 +4080,11 @@ def expand_config_file(
if fp2 in ipath: if fp2 in ipath:
continue continue
if CFG_DEF and CFG_DEF[0] == fp2:
t = "ignoring PRTY_CONFIG because it was also autodiscovered by %s -> %s"
LOG[0]("root", t % (ipath, fp))
continue
expand_config_file(log, shenvexp, ret, fp2, ipath) expand_config_file(log, shenvexp, ret, fp2, ipath)
return return