diff --git a/build-aux/share/portproton/scripts/functions_helper b/build-aux/share/portproton/scripts/functions_helper index 30363ef7..3910d0ec 100755 --- a/build-aux/share/portproton/scripts/functions_helper +++ b/build-aux/share/portproton/scripts/functions_helper @@ -1195,7 +1195,7 @@ init_wine_ver () { if [[ -d "${PORT_DATA_PATH}/data/dist" ]] ; then IFS=$'\n' for dist_dir in $(lsbash "${PORT_DATA_PATH}/data/dist") ; do - dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g) + dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e 's/[[:blank:]]*-[[:blank:]]*/-/g' -e 's/[[:blank:]]/_/g') if [[ ! -d "${PORT_DATA_PATH}/data/dist/${dist_dir_new^^}" ]] ; then mv -- "${PORT_DATA_PATH}/data/dist/$dist_dir" "${PORT_DATA_PATH}/data/dist/${dist_dir_new^^}" fi diff --git a/build-aux/share/portproton/scripts/start.sh b/build-aux/share/portproton/scripts/start.sh index cb1e09ce..f1980701 100755 --- a/build-aux/share/portproton/scripts/start.sh +++ b/build-aux/share/portproton/scripts/start.sh @@ -112,7 +112,7 @@ create_new_dir "${HOME}/.local/share/applications" create_new_dir "${PORT_DATA_PATH}/data/dist" IFS=$'\n' for dist_dir in $(lsbash "${PORT_DATA_PATH}/data/dist/") ; do - dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g) + dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e 's/[[:blank:]]*-[[:blank:]]*/-/g' -e 's/[[:blank:]]/_/g') if [[ ! -d "${PORT_DATA_PATH}/data/dist/${dist_dir_new^^}" ]] ; then mv -- "${PORT_DATA_PATH}/data/dist/$dist_dir" "${PORT_DATA_PATH}/data/dist/${dist_dir_new^^}" fi diff --git a/portprotonqt/debug_utils/env_utils.py b/portprotonqt/debug_utils/env_utils.py index 2ece96eb..3d26b1ee 100644 --- a/portprotonqt/debug_utils/env_utils.py +++ b/portprotonqt/debug_utils/env_utils.py @@ -1,6 +1,7 @@ """Environment variables and configuration utilities.""" import os +import re import subprocess from portprotonqt.logger import get_logger @@ -11,8 +12,9 @@ logger = get_logger(__name__) def _normalize_dist_name(value: str) -> str: - # Match scripts behavior: trim, normalize whitespace, replace blanks with "_", uppercase. - return "_".join(value.split()).upper() + # Keep spaced hyphen separators readable before replacing blanks with "_". + normalized = re.sub(r"\s*-\s*", "-", value.strip()) + return "_".join(normalized.split()).upper() def get_file_content(file_path: str, default: str = "") -> str: diff --git a/portprotonqt/debug_utils/log_processor.py b/portprotonqt/debug_utils/log_processor.py index 1a895959..a14c35f3 100644 --- a/portprotonqt/debug_utils/log_processor.py +++ b/portprotonqt/debug_utils/log_processor.py @@ -3,10 +3,7 @@ import os import re - -def _normalize_dist_name(value: str) -> str: - # Match scripts behavior: trim, normalize whitespace, replace blanks with "_", uppercase. - return "_".join(value.split()).upper() +from portprotonqt.debug_utils.env_utils import _normalize_dist_name def _strip_pw_wine_use_path(line: str) -> str: