mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
- only include bsd.pkgng.mk once [1]
- only read bsd.pkgng.mk in post.mk [1] - move the command definition to bsd.command.mk [1] - fix check-vulnerable [2] Submitted by: avilla [1], rene [2]
This commit is contained in:
parent
902f3b04d9
commit
7d51693e8c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=292069
@ -113,6 +113,16 @@ ECHO_CMD?= echo # Shell builtin
|
||||
# Used to print all the '===>' style prompts - override this to turn them off.
|
||||
ECHO_MSG?= ${ECHO_CMD}
|
||||
|
||||
.if defined(WITH_PKGNG)
|
||||
PKG_BIN?= ${LOCALBASE}/sbin/pkg
|
||||
PKG_CMD?= ${PKG_BIN} register
|
||||
PKG_DELETE?= ${PKG_BIN} delete -y
|
||||
PKG_INFO?= ${PKG_BIN} info -g
|
||||
PKG_VERSION?= ${PKG_BIN} version
|
||||
PKG_CREATE?= ${PKG_BIN} create
|
||||
PKG_ADD?= ${PKG_BIN} add
|
||||
PKG_QUERY?= ${PKG_BIN} query
|
||||
.else
|
||||
.if exists(${LOCALBASE}/sbin/pkg_info)
|
||||
PKG_CMD?= ${LOCALBASE}/sbin/pkg_create
|
||||
PKG_ADD?= ${LOCALBASE}/sbin/pkg_add
|
||||
@ -126,5 +136,6 @@ PKG_DELETE?= /usr/sbin/pkg_delete
|
||||
PKG_INFO?= /usr/sbin/pkg_info
|
||||
PKG_VERSION?= /usr/sbin/pkg_version
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.endif
|
||||
|
@ -3,18 +3,9 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
PKGNG_MAINTAINER= portmgr@FreeBSD.org
|
||||
|
||||
PKG_BIN?= ${LOCALBASE}/sbin/pkg
|
||||
PKG_CMD= ${PKG_BIN} register
|
||||
PKG_DELETE= ${PKG_BIN} delete -y
|
||||
PKG_INFO= ${PKG_BIN} info -g
|
||||
PKG_VERSION= ${PKG_BIN} version
|
||||
PKG_CREATE= ${PKG_BIN} create
|
||||
PKG_ADD= ${PKG_BIN} add
|
||||
PKG_QUERY= ${PKG_BIN} query
|
||||
|
||||
PKG_SUFX= .txz
|
||||
.if defined(_POSTMKINCLUDED)
|
||||
PKGNG_Include_MAINTAINER= portmgr@FreeBSD.org
|
||||
|
||||
METADIR= ${WRKDIR}/.metadir
|
||||
MANIFESTF= ${METADIR}/+MANIFEST
|
||||
@ -276,3 +267,4 @@ deinstall:
|
||||
@${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
|
||||
.endif
|
||||
|
||||
.endif # defined(_POSTMKINCLUDED)
|
||||
|
@ -1404,10 +1404,6 @@ LDCONFIG_CMD?= ${LINUXBASE}/sbin/ldconfig -r ${LINUXBASE}
|
||||
|
||||
PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
|
||||
|
||||
.if defined(WITH_PKGNG)
|
||||
.include "${PORTSDIR}/Mk/bsd.pkgng.mk"
|
||||
.endif
|
||||
|
||||
.if defined(USE_LOCAL_MK)
|
||||
.include "${PORTSDIR}/Mk/bsd.local.mk"
|
||||
.endif
|
||||
@ -2440,8 +2436,12 @@ PKG_ARGS+= -C "${CONFLICTS_INSTALL}"
|
||||
.if defined(PKG_NOCOMPRESS)
|
||||
PKG_SUFX?= .tar
|
||||
.else
|
||||
.if defined(WITH_PKGNG)
|
||||
PKG_SUFX?= .txz
|
||||
.else
|
||||
PKG_SUFX?= .tbz
|
||||
.endif
|
||||
.endif
|
||||
# where pkg_add records its dirty deeds.
|
||||
PKG_DBDIR?= /var/db/pkg
|
||||
|
||||
@ -3397,8 +3397,13 @@ check-deprecated:
|
||||
|
||||
# Check if the port is listed in the vulnerability database
|
||||
|
||||
.if defined(WITH_PKGNG)
|
||||
AUDITFILE?= ${PKG_DBDIR}/auditfile
|
||||
_EXTRACT_AUDITFILE= ${CAT} "${AUDITFILE}"
|
||||
.else
|
||||
AUDITFILE?= /var/db/portaudit/auditfile.tbz
|
||||
_EXTRACT_AUDITFILE= ${TAR} -jxOf "${AUDITFILE}" auditfile
|
||||
.endif
|
||||
|
||||
check-vulnerable:
|
||||
.if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING)
|
||||
@ -3409,12 +3414,16 @@ check-vulnerable:
|
||||
if [ "$$audit_created" -lt "$$audit_expiry" ]; then \
|
||||
${ECHO_MSG} "===> WARNING: Vulnerability database out of date, checking anyway"; \
|
||||
fi; \
|
||||
vlist=`${_EXTRACT_AUDITFILE} | ${GREP} "${PORTNAME}" | \
|
||||
${AWK} -F\| ' /^[^#]/ { \
|
||||
if (!system("${PKG_VERSION} -T \"${PKGNAME}\" \"" $$1 "\"")) \
|
||||
print "=> " $$3 ".\n Reference: " $$2 \
|
||||
} \
|
||||
'`; \
|
||||
if [ -n "${WITH_PKGNG}" ]; then \
|
||||
vlist=`${PKG_BIN} audit "${PKGNAME}"`; \
|
||||
else \
|
||||
vlist=`${_EXTRACT_AUDITFILE} | ${GREP} "${PORTNAME}" | \
|
||||
${AWK} -F\| ' /^[^#]/ { \
|
||||
if (!system("${PKG_VERSION} -T \"${PKGNAME}\" \"" $$1 "\"")) \
|
||||
print "=> " $$3 ".\n Reference: " $$2 \
|
||||
} \
|
||||
'`; \
|
||||
fi; \
|
||||
if [ -n "$$vlist" ]; then \
|
||||
${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \
|
||||
${ECHO_MSG} "$$vlist"; \
|
||||
|
Loading…
Reference in New Issue
Block a user