fix: normalize Proton dist hyphen spacing #163

Merged
Boria138 merged 1 commits from proton-naming into main 2026-05-24 03:24:50 +00:00
4 changed files with 7 additions and 8 deletions

No files matched your search

@@ -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
+1 -1
View File
@@ -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
+4 -2
View File
@@ -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:
+1 -4
View File
@@ -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: