pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Fix a number of bugs in the DESTDIR support:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ad23f2641fda
branches:  trunk
changeset: 532246:ad23f2641fda
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Aug 14 23:58:24 2007 +0000

description:
Fix a number of bugs in the DESTDIR support:
- check-perms.mk was not DESTDIR aware, prefix files before passing it
  to the directory extraction
- PKG_FILELIST_CMD was calling pkg_info, which is fine for normal
  installation, but fails of course for DESTDIR. Just drop the @ lines
  from ${_DEPENDS_PLIST} and use that.
- To make he former work, ensure that _flavor-generate-metadata is part
  of _INSTALL_ALL_TARGETS. It was normally a dependency of
  _flavor-register, but that is skipped for DESTDIR.
- Remove ${_DEPENDS_PLIST} when running install-clean.

diffstat:

 mk/check/check-perms.mk |  4 ++--
 mk/flavor/pkg/flavor.mk |  8 +++++++-
 mk/install/install.mk   |  6 ++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diffs (68 lines):

diff -r d79ae0755327 -r ad23f2641fda mk/check/check-perms.mk
--- a/mk/check/check-perms.mk   Tue Aug 14 22:47:51 2007 +0000
+++ b/mk/check/check-perms.mk   Tue Aug 14 23:58:24 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: check-perms.mk,v 1.9 2007/07/23 12:10:56 joerg Exp $
+# $NetBSD: check-perms.mk,v 1.10 2007/08/14 23:58:24 joerg Exp $
 #
 # This file checks that after installation of a package, all files and
 # directories of that package have sensible permissions set.
@@ -90,7 +90,7 @@
                ${CHECK_PERMS_SKIP:@p@${PREFIX}/${p}|${p}) continue ;;@}\
                *) ;;                                                   \
                esac;                                                   \
-               printf "%s\\n" "$$file";                                \
+               printf "%s\\n" "${DESTDIR}$$file";                      \
          done                                                          \
        | awk ${_CHECK_PERMS_GETDIRS_AWK:Q}                             \
        | ${_CHECK_PERMS_CMD} ${_CHECK_PERMS_FLAGS}
diff -r d79ae0755327 -r ad23f2641fda mk/flavor/pkg/flavor.mk
--- a/mk/flavor/pkg/flavor.mk   Tue Aug 14 22:47:51 2007 +0000
+++ b/mk/flavor/pkg/flavor.mk   Tue Aug 14 23:58:24 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: flavor.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: flavor.mk,v 1.2 2007/08/14 23:58:24 joerg Exp $
 #
 # This Makefile fragment provides variable and target overrides that are
 # specific to the pkgsrc native package format.
@@ -7,7 +7,13 @@
 # PKG_FILELIST_CMD outputs the list of files owned by ${PKGNAME} as
 # registered on the system.
 #
+# For DESTDIR support, just use _DEPENDS_PLIST instead.
+#
+.if ${_USE_DESTDIR} == "no"
 PKG_FILELIST_CMD=      ${PKG_INFO} -qL ${PKGNAME:Q}
+.else
+PKG_FILELIST_CMD=      ${SED} -e "/^@/d" -e "s|^|${PREFIX}/|" ${_DEPENDS_PLIST}
+.endif
 
 .include "${PKGSRCDIR}/mk/flavor/pkg/depends.mk"
 .include "${PKGSRCDIR}/mk/flavor/pkg/check.mk"
diff -r d79ae0755327 -r ad23f2641fda mk/install/install.mk
--- a/mk/install/install.mk     Tue Aug 14 22:47:51 2007 +0000
+++ b/mk/install/install.mk     Tue Aug 14 23:58:24 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.44 2007/08/10 04:00:43 jlam Exp $
+# $NetBSD: install.mk,v 1.45 2007/08/14 23:58:24 joerg Exp $
 #
 # This file provides the code for the "install" phase.
 #
@@ -168,6 +168,8 @@
 .endif
 .if ${_USE_DESTDIR} == "no"
 _INSTALL_ALL_TARGETS+=         _flavor-register
+.else
+_INSTALL_ALL_TARGETS+=         _flavor-generate-metadata
 .endif
 _INSTALL_ALL_TARGETS+=         privileged-install-hook
 .if ${_USE_DESTDIR} != "user-destdir"
@@ -333,7 +335,7 @@
 ### later phases so that the "install" target may be re-invoked.
 ###
 install-clean: .PHONY package-clean check-clean _flavor-install-clean
-       ${RUN} ${RM} -f ${PLIST} ${_COOKIE.install}
+       ${RUN} ${RM} -f ${PLIST} ${_COOKIE.install} ${_DEPENDS_PLIST}
 
 ######################################################################
 ### bootstrap-register (PUBLIC)



Home | Main Index | Thread Index | Old Index