summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-06-29 20:51:24 +0000
committerrillig <rillig@pkgsrc.org>2020-06-29 20:51:24 +0000
commit39de0c5775b9398b1cd17df57b2132952d42b16d (patch)
tree2e048a8d6561bf584c918767cea777bf1016617e
parent32824b270e66f92c83b748c8fcb00e6d65a6eea3 (diff)
downloadpkgsrc-39de0c5775b9398b1cd17df57b2132952d42b16d.tar.gz
mk/haskell.mk: fix PLIST status detection
As seen in devel/hs-hashable/PLIST r1.1, which listed only the package-description but not the package-id.
-rw-r--r--mk/haskell.mk7
-rw-r--r--regress/infra-unittests/haskell.sh8
2 files changed, 8 insertions, 7 deletions
diff --git a/mk/haskell.mk b/mk/haskell.mk
index 308b11641d9..e2133410fb2 100644
--- a/mk/haskell.mk
+++ b/mk/haskell.mk
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.23 2020/06/29 20:30:13 rillig Exp $
+# $NetBSD: haskell.mk,v 1.24 2020/06/29 20:51:24 rillig Exp $
#
# This Makefile fragment handles Haskell Cabal packages.
# See: http://www.haskell.org/cabal/
@@ -95,6 +95,7 @@ HASKELL_MK= # defined
.include "../../mk/bsd.fast.prefs.mk"
+HS_UPDATE_PLIST?= no
# Declare HASKELL_COMPILER as one of BUILD_DEFS variables. See
# ../../mk/misc/show.mk
@@ -222,7 +223,7 @@ _HS_PLIST_STATUS= missing
_HS_PLIST_STATUS= missing
.elif ${${GREP} HS_INTF ${PKGDIR}/PLIST || ${TRUE}:L:sh}
_HS_PLIST_STATUS= lib-ok
-.elif !${${GREP} "/package-id" ${PKGDIR}/PLIST || ${TRUE}:L:sh}
+.elif !${${GREP} "/package-description" ${PKGDIR}/PLIST || ${TRUE}:L:sh}
_HS_PLIST_STATUS= plain
.else
_HS_PLIST_STATUS= outdated
@@ -261,8 +262,6 @@ _HS_PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_PKGID}", "$${HS_PKGID}") }
_HS_PRINT_PLIST_AWK+= { sub( "${_HASKELL_PL_VER}", "$${HS_VER}") }
PRINT_PLIST_AWK+= ${exists(${DESTDIR}${_HASKELL_PKG_DESCR_FILE}):?${_HS_PRINT_PLIST_AWK}:}
-HS_UPDATE_PLIST?= no
-
. if ${HS_UPDATE_PLIST} != no && ${_HS_PLIST_STATUS} == missing
GENERATE_PLIST+= ${MAKE} print-PLIST > ${PKGDIR}/PLIST;
. endif
diff --git a/regress/infra-unittests/haskell.sh b/regress/infra-unittests/haskell.sh
index fa21a26b563..b3347e5ebc1 100644
--- a/regress/infra-unittests/haskell.sh
+++ b/regress/infra-unittests/haskell.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: haskell.sh,v 1.3 2020/06/29 20:30:13 rillig Exp $
+# $NetBSD: haskell.sh,v 1.4 2020/06/29 20:51:25 rillig Exp $
#
# Tests for mk/haskell.mk.
#
@@ -149,6 +149,9 @@ fi
if test_case_begin 'PLIST status: outdated'; then
# See devel/hs-hashable/PLIST, r1.1.
+ # In that file, there was only a package-description but not
+ # package-id. After the migration, it has both the
+ # package-description and the package-id.
create_file 'Makefile' <<-EOF
DISTNAME= hashable-1.3.0.0
@@ -165,9 +168,8 @@ if test_case_begin 'PLIST status: outdated'; then
"$make" 'show-plist-status' 1> "$tmpdir/output" 2>&1 \
&& exitcode=0 || exitcode=$?
- # TODO: should be 'outdated' because of 'package-description'
assert_that "$tmpdir/output" --file-is-lines \
- 'PLIST status: plain'
+ 'PLIST status: outdated'
test_case_end
fi