tech-pkg archive

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

Re: Patterns like >=x.*



 >>  >> 0 bmpx>pwd
 >>  >> /usr/pkgsrc/audio/bmpx
 >>  >> 0 bmpx>make show-depends | grep 'boost-libs>=1'
 >>  >> boost-libs>=1.55.*:../../devel/boost-libs
 >>  >> 0 0 bmpx>
 >>  >> 
 >>  >> I believe patterns like >=x.* and the like are wrong. Can we avoid them
 >>  >> by checking {BUILD_,}DEPENDS and CONFLICTS at the time of package build?
 >> 
 >> > That does seem wrong, but it seems more like a job for pkglint.
 >> 
 >> If such patterns are allowed at build time, than such dependencies must
 >> be somehow processed by binary packages utils (nih, pkgin, pkg_chk etc.)
 >> and bulk build software (pbulk, distbb, pkg_comp). In particular >=x.*
 >> pattern are in our official packages for 2013Q4. This is why I propose
 >> to avoid such patterns as soon as possible.

> Please go ahead and fix them.
> boost-libs>=1.55 is correct.

I've just fixed devel/boost-libs/buildlink3.mk and a number of WIP
packages and would like to apply the following patch. Objections?
'pkg_info -E' both in base and pkgsrc can be improved.

Index: mk/depends/depends.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/depends/depends.mk,v
retrieving revision 1.16
diff -u -r1.16 depends.mk
--- mk/depends/depends.mk       15 Oct 2011 00:23:08 -0000      1.16
+++ mk/depends/depends.mk       12 Jan 2014 21:08:45 -0000
@@ -6,6 +6,7 @@
 ### depends is a public target to install missing dependencies for
 ### the package.
 ###
+_DEPENDS_TARGETS+=     sanity-check-depends
 _DEPENDS_TARGETS+=     acquire-depends-lock
 _DEPENDS_TARGETS+=     ${_COOKIE.depends}
 _DEPENDS_TARGETS+=     release-depends-lock
@@ -62,3 +63,26 @@
 .PHONY: pre-depends-hook
 pre-depends-hook:
        @${DO_NADA}
+
+######################################################################
+### sanity-check-depends (PRIVATE)
+######################################################################
+### sanity-check-depends is a private target to check that DEPENDS,
+### TOOL_DEPENDS, BUILD_DEPENDS and CONFLICTS contain correct values
+###
+
+_SANITY_CHECK_DEPENDS_CMD=${AWK} '        \
+  match($$1, /[<>][^,{}]*[*?\[\]].*/) {   \
+    sub(/:[^{}]*$$/, "", $$1);            \
+    print "Incorrect dependency: " $$1;   \
+    ex=1                                  \
+  } \
+  END { exit ex }'
+
+.PHONY: sanity-check-depends
+sanity-check-depends: 
+       @{ ${DEPENDS:@temp@echo '${temp}';@} \
+          ${BUILD_DEPENDS:@temp@echo '${temp}';@} \
+          ${TOOL_DEPENDS:@temp@echo '${temp}';@} \
+          ${CONFLICTS:@temp@echo '${temp}';@} \
+       } | ${_SANITY_CHECK_DEPENDS_CMD}


-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index