pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/pkgtasks



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

Modified Files:
        pkgsrc/mk/pkgtasks: bsd.pkgtasks.mk
        pkgsrc/mk/pkgtasks/tests: pkgtasks_test

Log Message:
Be more flexible about adding dependency on pkgtasks.

Check the value of ${USE_PKGTASKS} at the time of reference for
the DEPENDS variable to see whether "pkgtasks" needs to be added
or not.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mk/pkgtasks/bsd.pkgtasks.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mk/pkgtasks/tests/pkgtasks_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/pkgtasks/bsd.pkgtasks.mk
diff -u pkgsrc/mk/pkgtasks/bsd.pkgtasks.mk:1.2 pkgsrc/mk/pkgtasks/bsd.pkgtasks.mk:1.3
--- pkgsrc/mk/pkgtasks/bsd.pkgtasks.mk:1.2      Fri Jun  2 19:13:26 2017
+++ pkgsrc/mk/pkgtasks/bsd.pkgtasks.mk  Fri Jun  2 19:13:34 2017
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkgtasks.mk,v 1.2 2017/06/02 19:13:26 jlam Exp $
+# $NetBSD: bsd.pkgtasks.mk,v 1.3 2017/06/02 19:13:34 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -142,9 +142,8 @@ USE_PKGTASKS=               no
 .include "${PKGSRCDIR}/mk/pkgtasks/usergroup.mk"
 
 # Add a dependency on pkgtasks if package tasks are needed.
-.if "${USE_PKGTASKS:tl}" == "yes"
-DEPENDS+=              pkgtasks-1>=1.9:../../pkgtools/pkgtasks
-.endif
+_PKGTASKS_DEPENDS=     pkgtasks-1>=1.9:../../pkgtools/pkgtasks
+DEPENDS+=              ${"${USE_PKGTASKS:tl}" == "yes":?${_PKGTASKS_DEPENDS}:}
 TASK_MODULE_DIR?=      ${LOCALBASE}/share/pkgtasks-1
 
 # PKGTASKS_DATAFILE

Index: pkgsrc/mk/pkgtasks/tests/pkgtasks_test
diff -u pkgsrc/mk/pkgtasks/tests/pkgtasks_test:1.2 pkgsrc/mk/pkgtasks/tests/pkgtasks_test:1.3
--- pkgsrc/mk/pkgtasks/tests/pkgtasks_test:1.2  Fri Jun  2 16:12:26 2017
+++ pkgsrc/mk/pkgtasks/tests/pkgtasks_test      Fri Jun  2 19:13:34 2017
@@ -1,6 +1,6 @@
 #!/usr/bin/env atf-sh
 #
-# $NetBSD: pkgtasks_test,v 1.2 2017/06/02 16:12:26 jlam Exp $
+# $NetBSD: pkgtasks_test,v 1.3 2017/06/02 19:13:34 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -128,13 +128,40 @@ EOF
        ${MAKE} depends PKGSRCDIR="${PKGSRCDIR}" > output
        
        cat output
-       grep -q "pkgtools/pkgtasks" output ||
+       grep "pkgtools/pkgtasks" output ||
        atf_fail "pkgtasks dependency missing"
        atf_pass
 }
 
+###
+### test3
+###
+
+atf_test_case test3
+
+test3_head()
+{
+       atf_set "descr" "no pkgtasks dependency"
+}
+
+test3_body()
+{
+       : ${MAKE:=make}
+       : ${PKGSRCDIR:=/usr/pkgsrc}
+
+       setup
+
+       ${MAKE} depends PKGSRCDIR="${PKGSRCDIR}" > output
+
+       cat output
+       grep "pkgtools/pkgtasks" output &&
+       atf_fail "pkgtasks dependency present"
+       atf_pass
+}
+
 atf_init_test_cases()
 {
        atf_add_test_case test1
        atf_add_test_case test2
+       atf_add_test_case test3
 }



Home | Main Index | Thread Index | Old Index