pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/pkgformat/pkg



Module Name:    pkgsrc
Committed By:   jlam
Date:           Fri Jun  2 19:13:44 UTC 2017

Modified Files:
        pkgsrc/mk/pkgformat/pkg: scripts.mk
        pkgsrc/mk/pkgformat/pkg/tests: scripts_test

Log Message:
Using script templates implies a dependency on pkgtasks.

The header template loads pkgtasks' load.subr unconditionally, so
if any script templates are used, then they imply a dependency on
pkgtasks.  Trigger the dependency in the "pkgtasks" framework by
setting USE_PKGTASKS to "yes".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/pkgformat/pkg/scripts.mk
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/pkgformat/pkg/tests/scripts_test

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

Modified files:

Index: pkgsrc/mk/pkgformat/pkg/scripts.mk
diff -u pkgsrc/mk/pkgformat/pkg/scripts.mk:1.1 pkgsrc/mk/pkgformat/pkg/scripts.mk:1.2
--- pkgsrc/mk/pkgformat/pkg/scripts.mk:1.1      Thu Jun  1 02:09:43 2017
+++ pkgsrc/mk/pkgformat/pkg/scripts.mk  Fri Jun  2 19:13:44 2017
@@ -1,4 +1,4 @@
-# $NetBSD: scripts.mk,v 1.1 2017/06/01 02:09:43 jlam Exp $
+# $NetBSD: scripts.mk,v 1.2 2017/06/02 19:13:44 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -81,6 +81,7 @@ _FOOTER_TMPL?=                ${PKGSRCDIR}/mk/pkgforma
 #
 .if ( "${USE_PKGTASKS:tl}" == "yes" ) || !empty(HEADER_TEMPLATES) ||   \
     !empty(DEINSTALL_TEMPLATES) || !empty(INSTALL_TEMPLATES)
+USE_PKGTASKS=          yes     # script templates use pkgtasks
 DEINSTALL_SRC?=                ${_HEADER_TMPL} ${HEADER_TEMPLATES}             \
                        ${DEINSTALL_TEMPLATES} ${_DEINSTALL_TMPL}       \
                        ${_FOOTER_TMPL} ${PKGTASKS_DATAFILE}

Index: pkgsrc/mk/pkgformat/pkg/tests/scripts_test
diff -u pkgsrc/mk/pkgformat/pkg/tests/scripts_test:1.1 pkgsrc/mk/pkgformat/pkg/tests/scripts_test:1.2
--- pkgsrc/mk/pkgformat/pkg/tests/scripts_test:1.1      Thu Jun  1 02:09:43 2017
+++ pkgsrc/mk/pkgformat/pkg/tests/scripts_test  Fri Jun  2 19:13:44 2017
@@ -1,6 +1,6 @@
 #!/usr/bin/env atf-sh
 #
-# $NetBSD: scripts_test,v 1.1 2017/06/01 02:09:43 jlam Exp $
+# $NetBSD: scripts_test,v 1.2 2017/06/02 19:13:44 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -181,14 +181,14 @@ EOF
 }
 
 ###
-### test3: DEINSTALL_SRC and INSTALL_SRC
+### test3: set DEINSTALL_SRC and INSTALL_SRC
 ###
 
 atf_test_case test3
 
 test3_head()
 {
-       atf_set "descr" "DEINSTALL_SRC and INSTALL_SRC"
+       atf_set "descr" "set DEINSTALL_SRC and INSTALL_SRC"
 }
 
 test3_body()
@@ -226,9 +226,43 @@ EOF
        atf_pass
 }
 
+###
+### test4
+###
+
+atf_test_case test4
+
+test4_head()
+{
+       atf_set "descr" "*_TEMPLATES trigger USE_PKGTASKS"
+}
+
+test4_body()
+{
+       : ${MAKE:=make}
+       : ${PKGSRCDIR:=/usr/pkgsrc}
+
+       setup
+       cat > Makefile << 'EOF'
+.include "mk.conf"
+
+INSTALL_TEMPLATES+=    fragment.tmpl
+
+.include "${PKGSRCDIR}/mk/pkgformat/pkg/scripts.mk"
+
+.PHONY: all
+all:
+       @echo ${USE_PKGTASKS:Q}
+EOF
+       ${MAKE} all PKGSRCDIR="${PKGSRCDIR}" > output
+       grep "yes" output || atf_fail "USE_PKGTASKS is not yes"
+       atf_pass
+}
+
 atf_init_test_cases()
 {
        atf_add_test_case test1
        atf_add_test_case test2
        atf_add_test_case test3
+       atf_add_test_case test4
 }



Home | Main Index | Thread Index | Old Index