tech-pkg archive

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

Re: Tentative "fix" for "pkg_info -E" problem



On Wed, Apr 02, 2008 at 05:00:06PM +0200, Joerg Sonnenberger wrote:
> On Tue, Apr 01, 2008 at 08:55:12PM +0000, Johnny C. Lam wrote:
> > The following patch allows me to do the following on NetBSD-3.1 with
> > a current pkgsrc:
> 
> How does it deal with programs embedding PKG_INFO etc?
> I would suggest to fix it by introducing a pkg_install phase before
> bootstrap-depends. It installs pkg_install alone (or updates it?) and
> afterwards calls a recursive make similiar to the barrier stuff.
> Alternatively we just set the pkg_install prefix to ${PREFIX} if
> pkg_install is outdated and in NetBSD base. What do you think?
> It should still register as a bootstrap dependency, but that would be a
> noop.

Patch for this approach is attached. Please test this.

Joerg
Index: bsd.pkg.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1940
diff -u -p -r1.1940 bsd.pkg.mk
--- bsd.pkg.mk  8 Mar 2008 14:28:05 -0000       1.1940
+++ bsd.pkg.mk  2 Apr 2008 17:41:33 -0000
@@ -116,13 +116,6 @@ REAL_ROOT_GROUP?=  ${ROOT_GROUP}
 _INSTALL_UNSTRIPPED=   # set (flag used by platform/*.mk)
 .endif
 
-##### Non-overridable constants
-
-# Latest versions of tools required for correct pkgsrc operation.
-PKGTOOLS_REQD=         20070802
-# Versions of tools that are good enough to handle dependencies
-PKGTOOLS_BASE_REQD=    20051103
-
 ##### Transform USE_* into dependencies
 
 .include "bsd.pkg.use.mk"
@@ -148,17 +141,10 @@ PKG_FAIL_REASON+= "This package doesn't 
 .endif
 
 # Check that we are using up-to-date pkg_* tools with this file.
-.if !defined(NO_PKGTOOLS_REQD_CHECK)
-.  if ${PKGTOOLS_VERSION} < ${PKGTOOLS_BASE_REQD}
-PKG_FAIL_REASON+='The package tools installed on this system are out of date.'
-PKG_FAIL_REASON+='The installed package tools are dated 
${PKGTOOLS_VERSION:C|(....)(..)(..)|\1/\2/\3|} and you must'
-PKG_FAIL_REASON+='update them to at least 
${PKGTOOLS_REQD:C|(....)(..)(..)|\1/\2/\3|} using the following command:'
-PKG_FAIL_REASON+=' '
-PKG_FAIL_REASON+='    (cd ${PKGSRCDIR}/pkgtools/pkg_install && ${MAKE} clean 
&& ${MAKE} update)'
-.  elif ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
+.if !defined(NO_PKGTOOLS_REQD_CHECK) && ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
 BOOTSTRAP_DEPENDS+=    pkg_install>=${PKGTOOLS_REQD}:../../pkgtools/pkg_install
-.  endif
-.endif # !NO_PKGTOOLS_REQD_CHECK
+_PKG_INSTALL_DEPENDS=  yes
+.endif
 
 .if defined(ALL_TARGET)
 PKG_FAIL_REASON+='ALL_TARGET is deprecated and must be replaced with 
BUILD_TARGET.'
Index: depends/depends.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/depends/depends.mk,v
retrieving revision 1.14
diff -u -p -r1.14 depends.mk
--- depends/depends.mk  22 May 2007 19:04:24 -0000      1.14
+++ depends/depends.mk  2 Apr 2008 17:26:06 -0000
@@ -37,6 +37,7 @@ ${_COOKIE.depends}: real-depends
 ### real-depends is a helper target onto which one can hook all of the
 ### targets that do the actual dependency installation.
 ###
+_REAL_DEPENDS_TARGETS+=        ${_PKG_INSTALL_DEPENDS:Dpkg_install-depends}
 _REAL_DEPENDS_TARGETS+=        bootstrap-depends
 _REAL_DEPENDS_TARGETS+=        depends-message
 _REAL_DEPENDS_TARGETS+=        pre-depends-hook
Index: fetch/fetch.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/fetch/fetch.mk,v
retrieving revision 1.32
diff -u -p -r1.32 fetch.mk
--- fetch/fetch.mk      1 Dec 2007 11:11:56 -0000       1.32
+++ fetch/fetch.mk      2 Apr 2008 17:29:07 -0000
@@ -93,6 +93,7 @@ SITES.${fetchfile:T:S/=/--/}?= ${PATCH_S
 ### fetch is a public target to fetch all of the package distribution
 ### files.
 ###
+_FETCH_TARGETS+=       ${_PKG_INSTALL_DEPENDS:Dpkg_install-depends}
 _FETCH_TARGETS+=       bootstrap-depends
 _FETCH_TARGETS+=       check-vulnerable
 _FETCH_TARGETS+=       pre-fetch
Index: flavor/pkg/depends.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/flavor/pkg/depends.mk,v
retrieving revision 1.41
diff -u -p -r1.41 depends.mk
--- flavor/pkg/depends.mk       10 Mar 2008 20:05:59 -0000      1.41
+++ flavor/pkg/depends.mk       2 Apr 2008 17:30:27 -0000
@@ -132,6 +132,22 @@ _flavor-install-dependencies: .PHONY ${_
 _flavor-post-install-dependencies: .PHONY ${_RDEPENDS_FILE}
 
 ######################################################################
+### pkg_install-depends (PUBLIC, pkgsrc/mk/depends/depends.mk)
+######################################################################
+### pkg_install-depends is a public target to install or update
+### pkg_install itself.
+###
+.PHONY: pkg_install-depends
+pkg_install-depends:
+       @${PHASE_MSG} "Trying to handle out-dated pkg_install..."
+       ${RUN} cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
+           _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+           ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes clean
+       ${RUN} cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
+           _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+           ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes ${DEPENDS_TARGET:Q}
+
+######################################################################
 ### bootstrap-depends (PUBLIC, pkgsrc/mk/depends/depends.mk)
 ######################################################################
 ### bootstrap-depends is a public target to install any missing
Index: flavor/pkg/flavor-vars.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/flavor/pkg/flavor-vars.mk,v
retrieving revision 1.7
diff -u -p -r1.7 flavor-vars.mk
--- flavor/pkg/flavor-vars.mk   10 Mar 2008 20:05:59 -0000      1.7
+++ flavor/pkg/flavor-vars.mk   2 Apr 2008 17:42:18 -0000
@@ -35,6 +35,9 @@ PKG_INFO_CMD?=                ${PKG_TOOLS_BIN}/pkg_inf
 PKG_VIEW_CMD?=         ${PKG_TOOLS_BIN}/pkg_view
 LINKFARM_CMD?=         ${PKG_TOOLS_BIN}/linkfarm
 
+# Latest versions of tools required for correct pkgsrc operation.
+PKGTOOLS_REQD=         20070813
+
 .if !defined(PKGTOOLS_VERSION)
 PKGTOOLS_VERSION!=     ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302
 MAKEFLAGS+=            PKGTOOLS_VERSION=${PKGTOOLS_VERSION}
Index: platform/NetBSD.mk
===================================================================
RCS file: /data/repo/netbsd/pkgsrc/mk/platform/NetBSD.mk,v
retrieving revision 1.29
diff -u -p -r1.29 NetBSD.mk
--- platform/NetBSD.mk  4 Mar 2008 06:45:34 -0000       1.29
+++ platform/NetBSD.mk  2 Apr 2008 17:47:14 -0000
@@ -31,11 +31,9 @@ EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dyn
 .endif
 MOTIF_TYPE_DEFAULT?=   openmotif       # default 2.0 compatible libs type
 NOLOGIN?=              /sbin/nologin
-.if exists(${LOCALBASE}/sbin/pkg_info)
-PKG_TOOLS_BIN?=                ${LOCALBASE}/sbin
-.else
-PKG_TOOLS_BIN?=                /usr/sbin
-.endif
+# This must be lazy and using :? evaluation doesn't work due to a make bugs.
+PKG_TOOLS_BIN_cmd=     if [ -x ${LOCALBASE}/sbin/pkg_info ]; then echo 
${LOCALBASE}/sbin; else echo /usr/sbin; fi
+PKG_TOOLS_BIN?=                ${PKG_TOOLS_BIN_cmd:sh}
 ROOT_CMD?=             ${SU} - root -c
 ROOT_USER?=            root
 ROOT_GROUP?=   wheel


Home | Main Index | Thread Index | Old Index