From 59f7215318a7feca5063f0d20d840531c1f25fd3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 16 May 2024 19:47:32 -0700 Subject: [PATCH] build/bin/sage-get-system-packages: When scanning pyproject.toml for package names, treat dashes and underscores as equivalent --- build/bin/sage-get-system-packages | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/bin/sage-get-system-packages b/build/bin/sage-get-system-packages index cf93b1b0d59..dd1f151295a 100755 --- a/build/bin/sage-get-system-packages +++ b/build/bin/sage-get-system-packages @@ -107,7 +107,9 @@ for PKG_BASE in $SPKGS; do # - from "[project] dependencies", # - from "[project.optional-dependencies]" # Packages are in the format "'sage-conf ~= 10.3b3'," - PACKAGE_INFO=$(sed -n '/\(requires\|dependencies\|R\) *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml") + # Accept dashes and underscores in package names as equivalent: + PKG_REGEX=$(echo $PKG_BASE | sed 's/[-_]/[-_]/g') + PACKAGE_INFO=$(sed -En '/(requires|dependencies|R) *= *\[/,/^\]/s/^ *'\''('$PKG_REGEX'.*)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml") if [ -n "$PACKAGE_INFO" ]; then echo "$PACKAGE_INFO" | ${STRIP_COMMENTS} [ $SYSTEM = versions ] || break