Skip to content

Commit 952405f

Browse files
author
Matthias Koeppe
committed
build/bin/sage-dist-helpers (sdh_store_[and_pip_install_]wheel): Record wheel file name in venv/var/lib/sage/scripts/PKG_BASE/spkg-requirements.txt
1 parent 4a4810e commit 952405f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

build/bin/sage-dist-helpers

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@ sdh_store_wheel() {
321321
mkdir -p "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}" && \
322322
$sudo mv "$wheel" "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/" || \
323323
sdh_die "Error storing $wheel"
324-
wheel="${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/${wheel##*/}"
324+
wheel="${SAGE_SPKG_WHEELS}/${wheel##*/}"
325+
if [ -n "${SAGE_SPKG_SCRIPTS}" -a -n "${PKG_BASE}" ]; then
326+
wheel_basename="${wheel##*/}"
327+
distname="${wheel_basename%%-*}"
328+
# Record name and wheel file location
329+
mkdir -p ${SAGE_DESTDIR}${SAGE_SPKG_SCRIPTS}/${PKG_BASE}
330+
echo "${distname} @ file://${wheel}" >> ${SAGE_DESTDIR}${SAGE_SPKG_SCRIPTS}/${PKG_BASE}/spkg-requirements.txt
331+
fi
332+
wheel="${SAGE_DESTDIR}${wheel}"
325333
}
326334

327335
sdh_store_and_pip_install_wheel() {
@@ -373,11 +381,6 @@ sdh_store_and_pip_install_wheel() {
373381
fi
374382
$sudo sage-pip-install $root $pip_options "$wheel" || \
375383
sdh_die "Error installing ${wheel##*/}"
376-
if [ -n "${SAGE_PKG_DIR}" ]; then
377-
# Record name of installed distribution name for uninstallation.
378-
wheel=${wheel##*/}
379-
echo "${wheel%%-*}" >> ${SAGE_PKG_DIR}/spkg-requirements.txt
380-
fi
381384
}
382385

383386
sdh_pip_uninstall() {

0 commit comments

Comments
 (0)