Skip to content

Commit d09c5aa

Browse files
author
Matthias Koeppe
committed
build/bin/sage-spkg-info: Use 'sage-package properties', 'sage-package dependencies'
1 parent 138b776 commit d09c5aa

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

build/bin/sage-spkg-info

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ else
2323
code () { echo "$1"; }
2424
tab () { echo "$1:"; }
2525
fi
26-
PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
26+
if ! props=$(sage-package properties $PKG_BASE 2> /dev/null); then
27+
echo >&2 "sage-spkg-info: unknown package $PKG_BASE"
28+
exit 1
29+
fi
30+
eval "$props"
31+
eval PKG_SCRIPTS=\$path_$PKG_BASE
2732
for ext in rst txt; do
2833
SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext"
2934
if [ -f "$SPKG_FILE" ]; then
@@ -44,29 +49,23 @@ echo
4449
echo "Dependencies"
4550
echo "------------"
4651
echo
47-
dep=
48-
for dep_file in dependencies dependencies_order_only; do
49-
if [ -r "$PKG_SCRIPTS/$dep_file" ] ; then
50-
for dep in $(sed 's/^ *//; s/ *#.*//; q' "$PKG_SCRIPTS/$dep_file"); do
51-
case "$dep" in
52-
# Do not use order-only syntax, too much information
53-
\|) ;;
54-
# Suppress dependencies on source file of the form $(SAGE_ROOT)/..., $(SAGE_SRC)/...
55-
\$\(SAGE_*) ;;
52+
eval $(sage-package properties :all:)
53+
for dep in $(sage-package dependencies $PKG_BASE); do
54+
case "$dep" in
55+
# Suppress dependencies on source files, e.g. of the form $(SAGE_ROOT)/..., $(SAGE_SRC)/...
56+
*/*) ;;
5657
# Suppress FORCE
5758
FORCE) ;;
5859
# Dependencies like $(BLAS)
5960
\$\(*) echo "- $dep";;
6061
# Looks like a package
61-
*) if [ -r "$SAGE_ROOT/build/pkgs/$dep/SPKG.rst" ]; then
62+
*) if eval test -r "\$path_$dep/SPKG.rst"; then
6263
# This RST label is set in src/doc/bootstrap
6364
echo "- $(spkg $dep)"
6465
else
6566
echo "- $dep"
6667
fi;;
67-
esac
68-
done
69-
fi
68+
esac
7069
done
7170
echo
7271
echo "Version Information"

0 commit comments

Comments
 (0)