git: 8c54911133d9 - main - Uses/cabal.mk: Fix make-use-cabal-revs after upstream changes.
Gleb Popov
arrowd at FreeBSD.org
Fri Jun 4 16:43:41 UTC 2021
The branch main has been updated by arrowd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=8c54911133d9418d2d4a1d006965a223f72ab98e
commit 8c54911133d9418d2d4a1d006965a223f72ab98e
Author: Gleb Popov <arrowd at FreeBSD.org>
AuthorDate: 2021-06-04 16:41:15 +0000
Commit: Gleb Popov <arrowd at FreeBSD.org>
CommitDate: 2021-06-04 16:43:20 +0000
Uses/cabal.mk: Fix make-use-cabal-revs after upstream changes.
Hackage now returns a JSON array with all revisions, so sed/grep trickery
is not working anymore. Use Python to parse the reply and extract revision
number.
---
Mk/Uses/cabal.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk
index 5154bcca81b3..a0ccf3226d0a 100644
--- a/Mk/Uses/cabal.mk
+++ b/Mk/Uses/cabal.mk
@@ -164,7 +164,7 @@ cabal-extract-deps:
cd ${WRKSRC} && \
${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} cabal new-configure --disable-benchmarks --disable-tests --flags="${CABAL_FLAGS}" ${CONFIGURE_ARGS}
cd ${WRKSRC} && \
- ${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} cabal new-build --disable-benchmarks --disable-tests --dependencies-only ${BUILD_ARGS}
+ ${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} cabal new-build --disable-benchmarks --disable-tests --dependencies-only ${BUILD_ARGS} ${BUILD_TARGET}
. endif
# Generates USE_CABAL= ... line ready to be pasted into the port based on artifacts of cabal-extract-deps.
@@ -179,8 +179,8 @@ make-use-cabal:
# Re-generates USE_CABAL items to have revision numbers.
make-use-cabal-revs:
. for package in ${_use_cabal}
- @(${SETENV} HTTP_ACCEPT="application/json" fetch -q -o - http://hackage.haskell.org/package/${package:C/_[0-9]+//}/revisions/ | sed -Ee 's/.*":([0-9]+)}\]/${package:C/_[0-9]+//}_\1 /' -e 's/_0//')
- @echo '\'
+ @(${SETENV} HTTP_ACCEPT="application/json" fetch -q -o - http://hackage.haskell.org/package/${package:C/_[0-9]+//}/revisions/ | python3 -c "import sys, json; print('${package:C/_[0-9]+//}_' + str(json.load(sys.stdin)[-1]['number']), end='')")
+ @echo ' \'
. endfor
. if !defined(CABAL_BOOTSTRAP)
More information about the dev-commits-ports-all
mailing list