ports/108483: net/cvsup-mirror: fails to start cvsupd after first update.

Scot Hetzel swhetzel at gmail.com
Sun Jan 28 17:50:24 UTC 2007


>Number:         108483
>Category:       ports
>Synopsis:       net/cvsup-mirror: fails to start cvsupd after first update.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 28 17:50:23 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Sat Jan 27 12:10:38 CST 2007     swhetzel at hp010:/usr/src/7x/sys-patched/amd64/compile/GENERIC.debug  amd64
>Description:
When the net/cvsup-mirror port is installed on a system with OSVERSION >= 600101, the update.sh script is unable to start PREFIX/etc/rc.d/cvsupd.sh script, as it doesn't exist.  Instead the cvsupd.sh script is named cvsupd on systems with OSVERSION >= 600101.


>How-To-Repeat:
Install the port, add cvsupd_enable="YES" to /etc/rc.conf, then run PREFIX/etc/cvsup/update.sh.
>Fix:
Apply the attached patch.

Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/cvsup-mirror/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- Makefile	2 Jan 2006 10:05:11 -0000	1.23
+++ Makefile	28 Jan 2007 17:23:24 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	cvsup-mirror
 PORTVERSION=	1.3
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	net
 DISTFILES=
 
@@ -23,10 +23,19 @@
 SCRIPTS_ENV=	USA_RESIDENT=${USA_RESIDENT}
 
 USE_RC_SUBR=	cvsupd.sh
+SUB_FILES=	update.sh
 
 base=${PREFIX}/etc/cvsup
 distrib=${base}/sup.client/distrib
 
+.include <bsd.port.pre.mk>
+
+.if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101))
+SUB_LIST+=	CVSUPD="cvsupd"
+.else
+SUB_LIST+=	CVSUPD="cvsupd.sh"
+.endif
+
 do-extract:
 	@test -d ${WRKSRC} || ${MKDIR} ${WRKSRC}
 
@@ -35,7 +44,7 @@
 	@test -d ${distrib} || ${MKDIR} ${distrib}
 	@${INSTALL_DATA} ${WRKSRC}/config.sh ${base}
 	@${INSTALL_DATA} ${WRKSRC}/cvsupd.access ${base}
-	@${INSTALL_SCRIPT} ${FILESDIR}/update.sh ${base}
+	@${INSTALL_SCRIPT} ${WRKSRC}/update.sh ${base}
 	@${INSTALL_DATA} ${FILESDIR}/supfile ${base}
 	@${INSTALL_DATA} ${FILESDIR}/refuse.self ${distrib}
 	@${CP} /dev/null ${base}/.start_server
@@ -43,4 +52,4 @@
 post-install:
 	@PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: files/update.sh
===================================================================
RCS file: files/update.sh
diff -N files/update.sh
--- files/update.sh	2 Jan 2006 10:05:11 -0000	1.18
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-#! /bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
-
-export PREFIX
-export CVSUP_ARGS="$*"
-export PATH=/bin:/usr/bin:${PREFIX}/bin
-
-lock=/var/spool/lock/cvsup.lock
-log=/var/log/cvsup.log
-
-umask 22
-
-exec >>${log} 2>&1
-
-# Do the update
-
-date "+CVSup update begins at %Y-%m-%d %T"
-
-# The rest of this is executed while holding the lock file, to ensure that
-# multiple instances won't collide with one another.
-
-lockf -t 0 ${lock} /bin/sh << 'E*O*F'
-
-base=${PREFIX}/etc/cvsup
-rundir=/var/tmp
-cd ${rundir} || exit
-. ${base}/config.sh || exit
-
-colldir=sup.client
-startup=${PREFIX}/etc/rc.d
-eval chome=~${cuser}
-cmd="exec env HOME=${chome} cvsup"
-options="-1gL 1 -b ${base} -c ${colldir} ${CVSUP_ARGS}"
-
-umask 2
-ok=yes
-
-echo "Updating from ${host}"
-su -f -m ${cuser} -c \
-    "${cmd} ${options} -h ${host} ${base}/supfile" || ok=no
-
-if [ ${ok} = yes ]; then
-    if [ -f ${base}/.start_server ]; then
-	if [ -x ${startup}/cvsupd.sh ]; then
-	    echo -n "Starting the server:"
-	    /bin/sh ${startup}/cvsupd.sh start
-	    echo "."
-	fi
-	rm -f ${base}/.start_server
-    fi
-fi
-
-E*O*F
-
-date "+CVSup update ends at %Y-%m-%d %T"
Index: files/update.sh.in
===================================================================
RCS file: files/update.sh.in
diff -N files/update.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/update.sh.in	28 Jan 2007 17:10:18 -0000
@@ -0,0 +1,59 @@
+#! /bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$"); then
+    echo "$0: Cannot determine the PREFIX" >&2
+    exit 1
+fi
+
+export PREFIX
+export CVSUP_ARGS="$*"
+export PATH=/bin:/usr/bin:${PREFIX}/bin
+
+lock=/var/spool/lock/cvsup.lock
+log=/var/log/cvsup.log
+
+umask 22
+
+exec >>${log} 2>&1
+
+# Do the update
+
+date "+CVSup update begins at %Y-%m-%d %T"
+
+# The rest of this is executed while holding the lock file, to ensure that
+# multiple instances won't collide with one another.
+
+lockf -t 0 ${lock} /bin/sh << 'E*O*F'
+
+base=${PREFIX}/etc/cvsup
+rundir=/var/tmp
+cd ${rundir} || exit
+. ${base}/config.sh || exit
+
+colldir=sup.client
+startup=${PREFIX}/etc/rc.d
+eval chome=~${cuser}
+cmd="exec env HOME=${chome} cvsup"
+options="-1gL 1 -b ${base} -c ${colldir} ${CVSUP_ARGS}"
+
+umask 2
+ok=yes
+
+echo "Updating from ${host}"
+su -f -m ${cuser} -c \
+    "${cmd} ${options} -h ${host} ${base}/supfile" || ok=no
+
+if [ ${ok} = yes ]; then
+    if [ -f ${base}/.start_server ]; then
+	if [ -x ${startup}/%%CVSUPD%% ]; then
+	    echo -n "Starting the server:"
+	    /bin/sh ${startup}/%%CVSUPD%% start
+	    echo "."
+	fi
+	rm -f ${base}/.start_server
+    fi
+fi
+
+E*O*F
+
+date "+CVSup update ends at %Y-%m-%d %T"

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list