Skip to content

Commit

Permalink
build/bin/sage-spkg-info: Use 'sage-package properties', 'sage-packag…
Browse files Browse the repository at this point in the history
…e dependencies'
  • Loading branch information
Matthias Koeppe committed Dec 17, 2023
1 parent 886fe21 commit 433b9d9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions build/bin/sage-spkg-info
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
#
# Assumes SAGE_ROOT is set
PKG_BASE=$1
PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
if ! props=$(sage-package properties $PKG_BASE 2> /dev/null); then
echo >&2 "sage-spkg-info: unknown package $PKG_BASE"
exit 1
fi
eval "$props"
eval PKG_SCRIPTS=\$path_$PKG_BASE
for ext in rst txt; do
SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext"
if [ -f "$SPKG_FILE" ]; then
Expand All @@ -25,29 +30,23 @@ echo
echo "Dependencies"
echo "------------"
echo
dep=
for dep_file in dependencies dependencies_order_only; do
if [ -r "$PKG_SCRIPTS/$dep_file" ] ; then
for dep in $(sed 's/^ *//; s/ *#.*//; q' "$PKG_SCRIPTS/$dep_file"); do
case "$dep" in
# Do not use order-only syntax, too much information
\|) ;;
# Suppress dependencies on source file of the form $(SAGE_ROOT)/..., $(SAGE_SRC)/...
\$\(SAGE_*) ;;
eval $(sage-package properties :all:)
for dep in $(sage-package dependencies $PKG_BASE); do
case "$dep" in
# Suppress dependencies on source files, e.g. of the form $(SAGE_ROOT)/..., $(SAGE_SRC)/...
*/*) ;;
# Suppress FORCE
FORCE) ;;
# Dependencies like $(BLAS)
\$\(*) echo "- $dep";;
# Looks like a package
*) if [ -n "$OUTPUT_RST" -a -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
*) if [ -n "$OUTPUT_RST" ] && eval test -r "\$path_$dep/SPKG.rst"; then
# This RST label is set in src/doc/bootstrap
echo "- :ref:\`spkg_$dep\`"
else
echo "- $dep"
fi;;
esac
done
fi
esac
done
echo
echo "Version Information"
Expand Down

0 comments on commit 433b9d9

Please sign in to comment.