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 03:53:18PM -0400, Johnny C. Lam wrote:
> Please see the following error log:
>
> http://www.netbsd.org/~jlam/mousetar.log
>
> This is a virgin NetBSD-3.1 installation with a current pkgsrc checkout
> with your patch applied. I have:
Right, it would try again in a dependency tree. Updated patch fixes that
as well.
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 3 Apr 2008 07:00:28 -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"
@@ -147,19 +140,6 @@ PKG_FAIL_REASON+= "PKG_INSTALLATION_TYPE
PKG_FAIL_REASON+= "This package doesn't support
PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}."
.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}
-BOOTSTRAP_DEPENDS+= pkg_install>=${PKGTOOLS_REQD}:../../pkgtools/pkg_install
-. endif
-.endif # !NO_PKGTOOLS_REQD_CHECK
-
.if defined(ALL_TARGET)
PKG_FAIL_REASON+='ALL_TARGET is deprecated and must be replaced with
BUILD_TARGET.'
.endif
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 3 Apr 2008 07:34:32 -0000
@@ -132,6 +132,24 @@ _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:
+ ${RUN}if [ `${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302` -lt
${PKGTOOLS_REQD} ]; then \
+ ${PHASE_MSG} "Trying to handle out-dated pkg_install..."; \
+ cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
+ _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+ ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes clean && \
+ cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
+ _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+ ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes ${DEPENDS_TARGET:Q}; \
+ fi
+
+######################################################################
### 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 3 Apr 2008 07:39:50 -0000
@@ -35,11 +35,20 @@ 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}
.endif
+# Check that we are using up-to-date pkg_* tools with this file.
+.if !defined(NO_PKGTOOLS_REQD_CHECK) && ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
+BOOTSTRAP_DEPENDS+= pkg_install>=${PKGTOOLS_REQD}:../../pkgtools/pkg_install
+_PKG_INSTALL_DEPENDS= yes
+.endif
+
# audit-packages logic for its location depends on a variety of factors
# including OS, pkg_install version and NetBSD version. The following
# should pick the correct version to run.
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