diff options
author | Thierry Thomas <thierry@FreeBSD.org> | 2006-05-28 19:38:52 +0000 |
---|---|---|
committer | Thierry Thomas <thierry@FreeBSD.org> | 2006-05-28 19:38:52 +0000 |
commit | 67899aa29c8842e2a22c72b68ba1712a900bfd15 (patch) | |
tree | 06e5346df68846f0b9de2a364e9e040ae0089cc4 /news/inn | |
parent | cc26a6c8bab8009634191ff17ccf33f780aea026 (diff) |
Don't remove database data files during the next upgrade.
PR: ports/98038
Submitted by: Shaun Amott <shaun (at) inerd.com> (maintainer)
Notes
Notes:
svn path=/head/; revision=163761
Diffstat (limited to 'news/inn')
-rw-r--r-- | news/inn/Makefile | 4 | ||||
-rw-r--r-- | news/inn/pkg-install | 11 | ||||
-rw-r--r-- | news/inn/pkg-plist | 25 |
3 files changed, 32 insertions, 8 deletions
diff --git a/news/inn/Makefile b/news/inn/Makefile index 9c56789c903e..4579dd6cd97f 100644 --- a/news/inn/Makefile +++ b/news/inn/Makefile @@ -7,6 +7,7 @@ PORTNAME= inn PORTVERSION= 2.4.3 +PORTREVISION= 1 CATEGORIES= news ipv6 MASTER_SITES= ${MASTER_SITE_ISC} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -147,6 +148,9 @@ post-patch: @${REINPLACE_CMD} -e 's!-ltcl!-ltcl83!' ${WRKSRC}/configure .endif +pre-install: + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + post-install: .if !defined(WITHOUT_STRIP) .for FILE in ${TO_BE_STRIPPED} diff --git a/news/inn/pkg-install b/news/inn/pkg-install index f3345e3dccac..d0de05fe1623 100644 --- a/news/inn/pkg-install +++ b/news/inn/pkg-install @@ -6,6 +6,10 @@ PKG_PREFIX=${PKG_PREFIX:-/usr/local} case $2 in PRE-INSTALL) + echo "===> Checking for old database files" + if [ ! -d ${PKG_PREFIX}/news/db ]; then + mkdir -p ${PKG_PREFIX}/news/db.dist + fi ;; CHECK-CONF) ETC_DIR=${3} @@ -37,6 +41,13 @@ case $2 in ${NEWSBASE}/spool/outgoing \ ${NEWSBASE}/spool/overview \ ${NEWSBASE}/spool/tmp + + if [ -d ${NEWSBASE}/db.dist -a ! -f ${NEWSBASE}/db.dist/* ]; then + for f in ${NEWSBASE}/db/*; do + cp -pR ${f} ${NEWSBASE}/db.dist + done + fi + ;; *) echo "Unexpected Argument $2!!!" diff --git a/news/inn/pkg-plist b/news/inn/pkg-plist index f48e59f56d1e..e33028e1958a 100644 --- a/news/inn/pkg-plist +++ b/news/inn/pkg-plist @@ -100,14 +100,22 @@ news/bin/startinnfeed news/bin/tally.control news/bin/tdx-util news/bin/writelog -news/db/active -news/db/active.times -news/db/history -news/db/history.dir -%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.hash -%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.index -%%SUB_WITH_TAGGED_HASH%%news/db/history.pag -news/db/newsgroups +@unexec f=active; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +@unexec f=active.times; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +@unexec f=history; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +@unexec f=history.dir; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +@unexec f=newsgroups; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +@unexec rm -f %D/news/db.dist/active 2> /dev/null || true +@unexec rm -f %D/news/db.dist/active.times 2> /dev/null || true +@unexec rm -f %D/news/db.dist/history 2> /dev/null || true +@unexec rm -f %D/news/db.dist/history.dir 2> /dev/null || true +@unexec rm -f %D/news/db.dist/newsgroups 2> /dev/null || true +%%SUB_WITHOUT_TAGGED_HASH%%@unexec f=history.hash; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +%%SUB_WITHOUT_TAGGED_HASH%%@unexec f=history.index; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +%%SUB_WITHOUT_TAGGED_HASH%%@unexec rm -f %D/news/db.dist/history.hash 2> /dev/null || true +%%SUB_WITHOUT_TAGGED_HASH%%@unexec rm -f %D/news/db.dist/history.index 2> /dev/null || true +%%SUB_WITH_TAGGED_HASH%%@unexec f=history.pag; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi +%%SUB_WITH_TAGGED_HASH%%@unexec rm -f %D/news/db.dist/history.pag 2> /dev/null || true news/doc/CONTRIBUTORS news/doc/GPL news/doc/HACKING @@ -265,6 +273,7 @@ news/lib/libstorage.a @dirrmtry %%ETCDIR%% @dirrm news/doc @dirrmtry news/db +@dirrmtry news/db.dist @dirrm news/bin/rnews.libexec @dirrm news/bin/filter @dirrm news/bin/control |