pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Preserve any existing +INSTALLED_INFO fi...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9f946bf0eab6
branches: trunk
changeset: 531613:9f946bf0eab6
user: jlam <jlam%pkgsrc.org@localhost>
date: Thu Aug 02 23:00:18 2007 +0000
description:
Preserve any existing +INSTALLED_INFO file from an installed package
before replacing it, and restore it when the new package is installed.
This saves any state information that should be carried over to the
new package, e.g. automatic=yes.
XXX Still need to do the same when "un-replacing".
diffstat:
mk/flavor/pkg/replace.mk | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diffs (55 lines):
diff -r cf71153dd531 -r 9f946bf0eab6 mk/flavor/pkg/replace.mk
--- a/mk/flavor/pkg/replace.mk Thu Aug 02 22:53:16 2007 +0000
+++ b/mk/flavor/pkg/replace.mk Thu Aug 02 23:00:18 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.8 2007/03/17 17:17:33 rillig Exp $
+# $NetBSD: replace.mk,v 1.9 2007/08/02 23:00:18 jlam Exp $
#
# _flavor-replace:
@@ -15,6 +15,7 @@
_flavor-replace: \
replace-tarup \
replace-names \
+ replace-preserve-installed-info \
replace-preserve-required-by \
deinstall \
install-clean \
@@ -30,6 +31,7 @@
#
_flavor-undo-replace: \
undo-replace-check \
+ replace-preserve-installed-info \
replace-preserve-required-by \
deinstall \
undo-replace-install \
@@ -37,6 +39,7 @@
replace-clean \
.PHONY
+_INSTALLED_INFO_FILE= ${PKG_DB_TMPDIR}/+INSTALLED_INFO
_REQUIRED_BY_FILE= ${PKG_DB_TMPDIR}/+REQUIRED_BY
_COOKIE.replace= ${WRKDIR}/.replace_done
@@ -101,6 +104,21 @@
${CP} -f ${_REPLACE_NEWNAME_FILE} ${_COOKIE.replace}
######################################################################
+### replace-preserve-installed-info (PRIVATE)
+######################################################################
+### replace-preserve-installed-info saves and removes the +INSTALLED_INFO
+### file from the installed package.
+###
+replace-preserve-installed-info: .PHONY
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${TEST} -f ${_REPLACE_OLDNAME_FILE} || exit 0; \
+ ${STEP_MSG} "Preserving existing +INSTALLED_INFO file."; \
+ oldname=`${CAT} ${_REPLACE_OLDNAME_FILE}`; \
+ installed_info="${_PKG_DBDIR}/$$oldname/+INSTALLED_INFO"; \
+ ${TEST} ! -f "$$installed_info" || \
+ ${MV} $$installed_info ${_INSTALLED_INFO_FILE}
+
+######################################################################
### replace-preserve-required-by (PRIVATE)
######################################################################
### replace-preserve-required-by saves and removes the +REQUIRED_BY
Home |
Main Index |
Thread Index |
Old Index