Skip to content

Commit

Permalink
package names should only contain alphanumeric characters
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Mar 15, 2024
1 parent f8dfbed commit 0ba4c92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/bin/add_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ def get_platform_name():
return sys.platform


def alnum(v: str | bytes) -> str:
return "".join(v for v in filter(str.isalnum, bytestostr(v)))


BUILD_INFO_FILE = "./xpra/build_info.py"
def record_build_info():
props = get_properties(BUILD_INFO_FILE)
Expand Down Expand Up @@ -267,7 +271,7 @@ def record_build_info():
"python3",
):
#fugly magic for turning the package atom into a legal variable name:
pkg_name = pkg.lstrip("lib").replace("+", "").replace("-", "_")
pkg_name = alnum(pkg.lstrip("lib"))
if pkg_name.rsplit("_", 1)[-1].rstrip("0123456789.")=="":
pkg_name = "_".join(pkg_name.split("_")[:-1])
cmd = [PKG_CONFIG, "--modversion", pkg]
Expand Down

0 comments on commit 0ba4c92

Please sign in to comment.