Sun Feb 12 20:14:02 2023 UTC ()
mk: fix show-license-status target for mirror-distfiles

in that case, license.mk is not included and thus
DEFAULT_ACCEPTABLE_LICENSES not set, leading to a strange error message

Thanks for the analysis go to rillig@


(wiz)
diff -r1.2049 -r1.2050 pkgsrc/mk/bsd.pkg.mk

cvs diff -r1.2049 -r1.2050 pkgsrc/mk/bsd.pkg.mk (expand / switch to unified diff)

--- pkgsrc/mk/bsd.pkg.mk 2023/02/04 08:38:28 1.2049
+++ pkgsrc/mk/bsd.pkg.mk 2023/02/12 20:14:02 1.2050
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.pkg.mk,v 1.2049 2023/02/04 08:38:28 wiz Exp $ 1# $NetBSD: bsd.pkg.mk,v 1.2050 2023/02/12 20:14:02 wiz Exp $
2# 2#
3# This file is in the public domain. 3# This file is in the public domain.
4# 4#
5# Please see the pkgsrc/doc/guide manual for details on the 5# Please see the pkgsrc/doc/guide manual for details on the
6# variables used in this make file template. 6# variables used in this make file template.
7# 7#
8# Default sequence for "all" is: 8# Default sequence for "all" is:
9# 9#
10# bootstrap-depends 10# bootstrap-depends
11# fetch 11# fetch
12# checksum 12# checksum
13# depends 13# depends
14# tools 14# tools
@@ -752,27 +752,27 @@ show-license show-licence: .PHONY @@ -752,27 +752,27 @@ show-license show-licence: .PHONY
752 case "$$pager" in "") pager=${CAT:Q};; esac; \ 752 case "$$pager" in "") pager=${CAT:Q};; esac; \
753 case "$$license" in "") exit 0;; esac; \ 753 case "$$license" in "") exit 0;; esac; \
754 if ${TEST} -f "$$license_file"; then \ 754 if ${TEST} -f "$$license_file"; then \
755 $$pager "$$license_file"; \ 755 $$pager "$$license_file"; \
756 else \ 756 else \
757 ${ECHO} "Generic $$license information not available"; \ 757 ${ECHO} "Generic $$license information not available"; \
758 ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ 758 ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \
759 fi 759 fi
760.endif 760.endif
761 761
762.if !target(show-license-status) 762.if !target(show-license-status)
763show-license-status show-licence-status: .PHONY 763show-license-status show-licence-status: .PHONY
764 @${ECHO} "The license of this package is ${LICENSE}." 764 @${ECHO} "The license of this package is ${LICENSE}."
765.if ${DEFAULT_ACCEPTABLE_LICENSES:M${LICENSE}} 765.if defined(DEFAULT_ACCEPTABLE_LICENSES) && ${DEFAULT_ACCEPTABLE_LICENSES:M${LICENSE}}
766 @${ECHO}; \ 766 @${ECHO}; \
767 ${ECHO} "This license is in DEFAULT_ACCEPTABLE_LICENSES." 767 ${ECHO} "This license is in DEFAULT_ACCEPTABLE_LICENSES."
768.endif 768.endif
769.if ${ACCEPTABLE_LICENSES:M${LICENSE}} 769.if ${ACCEPTABLE_LICENSES:M${LICENSE}}
770 @${ECHO}; \ 770 @${ECHO}; \
771 ${ECHO} "This license is in ACCEPTABLE_LICENSES." 771 ${ECHO} "This license is in ACCEPTABLE_LICENSES."
772.endif 772.endif
773.endif 773.endif
774 774
775# This target is defined in bsd.options.mk for packages that use 775# This target is defined in bsd.options.mk for packages that use
776# the options framework. 776# the options framework.
777.if !target(show-options) 777.if !target(show-options)
778.PHONY: show-options 778.PHONY: show-options