fix: normalize Proton dist hyphen spacing #163
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user