pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Mon Jun 29 22:00:58 UTC 2020

Modified Files:
        pkgsrc/mk: haskell.mk
        pkgsrc/regress/infra-unittests: haskell.sh

Log Message:
mk/haskell.mk: regenerate PLIST if it is outdated

Now that haskell.mk distinguishes between plain and outdated PLIST files,
this is possible again.  When haskell.mk knew only missing and outdated,
this was still ambiguous and therefore skipped.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 pkgsrc/mk/haskell.mk
cvs rdiff -u -r1.5 -r1.6 pkgsrc/regress/infra-unittests/haskell.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/haskell.mk
diff -u pkgsrc/mk/haskell.mk:1.24 pkgsrc/mk/haskell.mk:1.25
--- pkgsrc/mk/haskell.mk:1.24   Mon Jun 29 20:51:24 2020
+++ pkgsrc/mk/haskell.mk        Mon Jun 29 22:00:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.24 2020/06/29 20:51:24 rillig Exp $
+# $NetBSD: haskell.mk,v 1.25 2020/06/29 22:00:58 rillig Exp $
 #
 # This Makefile fragment handles Haskell Cabal packages.
 # See: http://www.haskell.org/cabal/
@@ -234,7 +234,6 @@ _HS_PLIST_STATUS=   outdated
 # the PLIST.
 #
 .if ${_HS_PLIST_STATUS} == lib-ok || ${_HS_PLIST_STATUS} == missing
-
 _HASKELL_PL_INTF=      ${_HASKELL_PKG_ID_FILE:H:S,^${PREFIX}/,,}
 _HASKELL_PL_IMPL_AWK=  prev == "import-dirs:" { dir = $$1; exit }
 _HASKELL_PL_IMPL_AWK+= { prev = $$0 }
@@ -254,6 +253,7 @@ _HS_PLIST_SUBST+=   HS_PLATFORM=${_HASKELL
 _HS_PLIST_SUBST+=      HS_PKGID=${_HASKELL_PL_PKGID}
 _HS_PLIST_SUBST+=      HS_VER=${_HASKELL_PL_VER}
 PLIST_SUBST+=          ${exists(${DESTDIR}${_HASKELL_PKG_DESCR_FILE}):?${_HS_PLIST_SUBST}:}
+
 _HS_PRINT_PLIST_AWK+=  { sub("^${_HASKELL_PL_INTF}",       "$${HS_INTF}") }
 _HS_PRINT_PLIST_AWK+=  { sub("^${_HASKELL_PL_IMPL}",       "$${HS_IMPL}") }
 _HS_PRINT_PLIST_AWK+=  { sub("^${_HASKELL_PL_DOCS}",       "$${HS_DOCS}") }
@@ -261,21 +261,21 @@ _HS_PRINT_PLIST_AWK+=     { sub("/${_HASKELL
 _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}:}
-
-.  if ${HS_UPDATE_PLIST} != no && ${_HS_PLIST_STATUS} == missing
-GENERATE_PLIST+=       ${MAKE} print-PLIST > ${PKGDIR}/PLIST;
-.  endif
 .endif
 
 .if ${_HS_PLIST_STATUS} == missing || ${_HS_PLIST_STATUS} == outdated
+.  if ${HS_UPDATE_PLIST} == yes
+GENERATE_PLIST+=       ${MAKE} print-PLIST > ${PKGDIR}/PLIST;
+.  endif
 GENERATE_PLIST+= \
        cd ${DESTDIR:Q}${PREFIX:Q} && \
                ${FIND} * \( -type f -o -type l \) | ${SORT};
-PLIST_SRC=     # none, because the PLIST file is outdated or missing
-.  if ${_HS_PLIST_STATUS} == outdated && ${HS_UPDATE_PLIST} == no
+PLIST_SRC=     # none
+.endif
+
+.if ${_HS_PLIST_STATUS} == outdated && ${HS_UPDATE_PLIST} == no
 WARNINGS+=     "[haskell.mk] The PLIST format is outdated."
 WARNINGS+=     "[haskell.mk] Set HS_UPDATE_PLIST=yes to update it automatically."
-.  endif
 .endif
 
 # Define configure target. We might not have any working Haskell

Index: pkgsrc/regress/infra-unittests/haskell.sh
diff -u pkgsrc/regress/infra-unittests/haskell.sh:1.5 pkgsrc/regress/infra-unittests/haskell.sh:1.6
--- pkgsrc/regress/infra-unittests/haskell.sh:1.5       Mon Jun 29 21:24:39 2020
+++ pkgsrc/regress/infra-unittests/haskell.sh   Mon Jun 29 22:00:58 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: haskell.sh,v 1.5 2020/06/29 21:24:39 rillig Exp $
+# $NetBSD: haskell.sh,v 1.6 2020/06/29 22:00:58 rillig Exp $
 #
 # Tests for mk/haskell.mk.
 #
@@ -71,8 +71,16 @@ ALL_ENV=             ALL_ENV_VAR=value
 .include "mk/plist/bsd.plist.mk"
 .include "mk/misc/show.mk"
 
+# from bsd.pkg.mk
+PKGNAME_NOREV?=                \${PKGNAME}
+PKGVERSION?=           \${PKGNAME:C/^.*-//}
+PKGBASE?=              \${PKGNAME:C/-[^-]*$//}
+
 show-plist-status: .PHONY
        @echo "PLIST status: "\${_HS_PLIST_STATUS:Q}
+
+show-var: .PHONY
+       @echo \${\${VARNAME}:Q}
 EOF
 
        link_from_pkgsrc 'mk/haskell.mk'
@@ -206,19 +214,12 @@ if test_case_begin 'missing, update=yes'
 
        # Based on devel/hs-asn1-parse from 2020-06-22.
 
-       create_file_lines 'Makefile' \
-               'DISTNAME=      asn1-parse-0.9.5' \
-               'PKGVERSION=    0.9.5' \
-               'PKGNAME_NOREV= ${DISTNAME}' \
-               '' \
-               'HS_UPDATE_PLIST=       yes' \
-               "PKGDIR=        $PWD" \
-               '' \
-               '.include "../../main.mk"' \
-               '.include "../../mk/haskell.mk"' \
-               '' \
-               'show-haskell-plist-status: .PHONY' \
-               '       @echo "PLIST status: "${_HS_PLIST_STATUS:Q}'
+       create_file 'Makefile' <<-EOF
+               DISTNAME=               asn1-parse-0.9.5
+               HS_UPDATE_PLIST=        yes
+
+               .include "../../main.mk"
+       EOF
        create_file "$destdir$prefix/lib/asn1-parse-0.9.5/ghc-8.8.1/package-id" <<-EOF
                asn1-parse-0.9.5-2HryHNyN1grJJzKM4AV1Gr
        EOF
@@ -392,10 +393,10 @@ if test_case_begin 'neither package-id n
                'PLIST_SUBST LOWER_VENDOR=' \
                'PLIST_SUBST LOWER_OPSYS=' \
                'PLIST_SUBST LOWER_OS_VERSION=' \
-               'PLIST_SUBST PKGBASE=' \
-               'PLIST_SUBST PKGNAME=' \
+               'PLIST_SUBST PKGBASE=hs-package' \
+               'PLIST_SUBST PKGNAME=hs-package-1.0' \
                'PLIST_SUBST PKGLOCALEDIR=' \
-               'PLIST_SUBST PKGVERSION=' \
+               'PLIST_SUBST PKGVERSION=1.0' \
                'PLIST_SUBST LOCALBASE=' \
                'PLIST_SUBST VIEWBASE=' \
                'PLIST_SUBST X11BASE=' \



Home | Main Index | Thread Index | Old Index