pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Explicitly record the PKGNAME via the @n...
details: https://anonhg.NetBSD.org/pkgsrc/rev/177d3d4857ef
branches: trunk
changeset: 537290:177d3d4857ef
user: rillig <rillig%pkgsrc.org@localhost>
date: Sat Jan 05 22:06:20 2008 +0000
description:
Explicitly record the PKGNAME via the @name command. That way, it is
possible to create the package file using a temporary file first, and if
everything has succeeded, to rename it to the real name. This time, I
tested it creating various binary packages and installing them
afterwards, so I'm pretty sure it works now.
diffstat:
mk/flavor/pkg/metadata.mk | 3 ++-
mk/flavor/pkg/package.mk | 9 +++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diffs (40 lines):
diff -r f3509afd04ef -r 177d3d4857ef mk/flavor/pkg/metadata.mk
--- a/mk/flavor/pkg/metadata.mk Sat Jan 05 21:59:31 2008 +0000
+++ b/mk/flavor/pkg/metadata.mk Sat Jan 05 22:06:20 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.27 2007/09/20 18:30:34 rillig Exp $
+# $NetBSD: metadata.mk,v 1.28 2008/01/05 22:06:20 rillig Exp $
######################################################################
### The targets below are all PRIVATE.
@@ -311,6 +311,7 @@
${_DEPENDS_PLIST}: ${PLIST}
${RUN} { \
+ ${ECHO} "@name ${PKGNAME}"; \
${AWK} '$$1 == "full" { printf "@blddep %s\n@pkgdep %s\n", $$3, $$2; }' < ${_RDEPENDS_FILE}; \
${AWK} '$$1 == "bootstrap" || $$1 == "build" { printf "@blddep %s\n", $$3; }' < ${_RDEPENDS_FILE}; \
${CAT} ${PLIST}; } > ${.TARGET}
diff -r f3509afd04ef -r 177d3d4857ef mk/flavor/pkg/package.mk
--- a/mk/flavor/pkg/package.mk Sat Jan 05 21:59:31 2008 +0000
+++ b/mk/flavor/pkg/package.mk Sat Jan 05 22:06:20 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.14 2008/01/04 14:22:06 rillig Exp $
+# $NetBSD: package.mk,v 1.15 2008/01/05 22:06:20 rillig Exp $
PKG_SUFX?= .tgz
PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
@@ -40,7 +40,12 @@
${PKGFILE}: ${_CONTENTS_TARGETS}
${RUN} ${MKDIR} ${.TARGET:H}
- ${RUN} ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} ${.TARGET}
+ ${RUN} tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \
+ if ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} "$$tmpname"; then \
+ ${MV} -f "$$tmpname" ${.TARGET}; \
+ else \
+ exitcode=$$?; ${RM} -f "$$tmpname"; exit $$exitcode; \
+ fi
######################################################################
### package-remove (PRIVATE)
Home |
Main Index |
Thread Index |
Old Index