From d04ebade2a54124e199d193b249aa00dc827e752 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Mon, 6 Aug 2007 02:24:01 +0000 Subject: [PATCH] - Avoid clobbering existing 3dm2.conf - Don't unconditionally set mode 600 on 3dm2.conf Noticed by: Craig Leres Submitted by: maintainer (in a follup to the PR) PR: ports/114994 --- sysutils/3dm/Makefile | 10 ++++++---- sysutils/3dm/pkg-plist | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sysutils/3dm/Makefile b/sysutils/3dm/Makefile index 797c933926da..0fa7f247eeed 100644 --- a/sysutils/3dm/Makefile +++ b/sysutils/3dm/Makefile @@ -7,6 +7,7 @@ PORTNAME= 3dm PORTVERSION= 2.04.00.035 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= sysutils MASTER_SITES= http://3ware.com/download/Escalade9650SE-Series/9.4.0.1/ @@ -96,10 +97,11 @@ do-install: post-install: ${INSTALL_DATA} ${WRKSRC}/3dm2.conf.sample ${PREFIX}/etc/3dm2/ - [ -f ${PREFIX}/etc/3dm2/3dm2.conf ] || \ - ${CP} ${PREFIX}/etc/3dm2/3dm2.conf.sample \ - ${PREFIX}/etc/3dm2/3dm2.conf - @${CHMOD} 600 ${PREFIX}/etc/3dm2/3dm2.conf.sample ${PREFIX}/etc/3dm2/3dm2.conf + ${CHMOD} 400 ${PREFIX}/etc/3dm2/3dm2.conf.sample + [ -f ${PREFIX}/etc/3dm2/3dm2.conf ] || ( \ + ${INSTALL_DATA} ${WRKSRC}/3dm2.conf.sample ${PREFIX}/etc/3dm2/3dm2.conf && \ + ${CHMOD} 600 ${PREFIX}/etc/3dm2/3dm2.conf \ + ) # 3ware uses a hardcoded config dir location that doesn't match hier(9) diff --git a/sysutils/3dm/pkg-plist b/sysutils/3dm/pkg-plist index 8a453b170bb5..956549c58cf6 100644 --- a/sysutils/3dm/pkg-plist +++ b/sysutils/3dm/pkg-plist @@ -1,7 +1,7 @@ -@unexec %D/etc/rc.d/3dm2.sh stop > /dev/null 2>&1 || true +@unexec %D/etc/rc.d/3dm2 stop > /dev/null 2>&1 || true @unexec if cmp -s %D/etc/3dm2/3dm2.conf.sample %D/etc/3dm2/3dm2.conf; then rm -f %D/etc/3dm2/3dm2.conf; fi etc/3dm2/3dm2.conf.sample -@exec if [ -f %B/3dm2.conf ] ; then cp -p %D/%F %B/3dm2.conf; fi +@exec if [ ! -f %B/3dm2.conf ] ; then cp -p %D/%F %B/3dm2.conf && chmod 600 %B/3dm2.conf; fi etc/3dm2/msg/tdm_msg_en etc/3dm2/msg/tw_msg_en sbin/3dm2