From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 2 22:50:10 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C84A1065673 for ; Sun, 2 May 2010 22:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB6F8FC19 for ; Sun, 2 May 2010 22:50:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o42MoAZh064781 for ; Sun, 2 May 2010 22:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o42Mo9nB064780; Sun, 2 May 2010 22:50:09 GMT (envelope-from gnats) Resent-Date: Sun, 2 May 2010 22:50:09 GMT Resent-Message-Id: <201005022250.o42Mo9nB064780@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anonymous Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5CFB106566B for ; Sun, 2 May 2010 22:47:50 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 5333B8FC12 for ; Sun, 2 May 2010 22:47:49 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so454142fge.13 for ; Sun, 02 May 2010 15:47:36 -0700 (PDT) Received: by 10.87.63.21 with SMTP id q21mr7081728fgk.52.1272840456515; Sun, 02 May 2010 15:47:36 -0700 (PDT) Received: from localhost (95-26-204-183.broadband.corbina.ru [95.26.204.183]) by mx.google.com with ESMTPS id e11sm5926386fga.28.2010.05.02.15.47.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 May 2010 15:47:36 -0700 (PDT) Message-Id: <86wrvlc48l.fsf@gmail.com> Date: Mon, 03 May 2010 02:45:30 +0400 From: Anonymous To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: ports/146257: [patch][repocopy] sysutils/bsdstats: improper use of LOCALBASE X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2010 22:50:10 -0000 >Number: 146257 >Category: ports >Synopsis: [patch][repocopy] sysutils/bsdstats: improper use of LOCALBASE >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 May 02 22:50:09 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Anonymous >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: LOCALBASE=/usr/pkg PREFIX=$HOME/aaa >Description: It fails to run here spouting: # /usr/pkg/etc/rc.d/bsdstats.sh onestart /usr/pkg/etc/rc.d/bsdstats.sh: WARNING: run_rc_command: cannot run /usr/local/etc/periodic/monthly/300.statistics I don't have /usr/local directory. So, after a brief look at the port: - make LOCALBASE that is not /usr/local actually work - don't install outside of PREFIX, including LOCALBASE - move 300.statistics bsdstats pkg-message to ${FILESDIR}, requires repocopy $ find files files files/bsdstats.in files/pkg-message.in files/300.statistics.in - drop .sh suffix, nowadays rc.d scripts don't need it - be consistent about creating etc/periodic/monthly - silence cat(1) invocation >How-To-Repeat: >Fix: --- a.diff begins here --- Index: sysutils/bsdstats/Makefile =================================================================== RCS file: /a/.cvsup/ports/sysutils/bsdstats/Makefile,v retrieving revision 1.59 diff -u -p -r1.59 Makefile --- sysutils/bsdstats/Makefile 18 Sep 2009 21:19:34 -0000 1.59 +++ sysutils/bsdstats/Makefile 2 May 2010 22:28:20 -0000 @@ -14,14 +14,14 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Monthly script for reporting anonymous statistics about your machine NO_BUILD= yes +SUB_FILES= 300.statistics bsdstats pkg-message do-install: - ${MKDIR} ${LOCALBASE}/etc/periodic/monthly - ${CP} ${FILESDIR}/300.statistics ${LOCALBASE}/etc/periodic/monthly - ${CP} ${FILESDIR}/bsdstats.sh ${LOCALBASE}/etc/rc.d - ${CHMOD} 0755 ${LOCALBASE}/etc/rc.d/bsdstats.sh + ${MKDIR} ${PREFIX}/etc/periodic/monthly + ${INSTALL_SCRIPT} ${WRKDIR}/300.statistics ${PREFIX}/etc/periodic/monthly + ${INSTALL_SCRIPT} ${WRKDIR}/bsdstats ${PREFIX}/etc/rc.d post-install: - ${CAT} ${PKGMESSAGE} + @${CAT} ${PKGMESSAGE} .if defined(BATCH) || defined(PACKAGE_BUILDING) @${ECHO_MSG} " To activate monthly statistics reporting in /etc/periodic.conf," @${ECHO_MSG} " execute the following as root user:" Index: sysutils/bsdstats/files/pkg-message.in =================================================================== RCS file: /a/.cvsup/ports/sysutils/bsdstats/files/pkg-message.in,v retrieving revision 1.9 diff -u -p -r1.9 pkg-message --- sysutils/bsdstats/files/pkg-message.in 30 Apr 2007 18:49:08 -0000 1.9 +++ sysutils/bsdstats/files/pkg-message.in 2 May 2010 22:20:57 -0000 @@ -23,7 +23,7 @@ To enable ports reporting, add this line monthly_statistics_report_ports="YES" To run it manually the first time, just run it as: - ${LOCALBASE}/etc/periodic/monthly/300.statistics -nodelay + %%PREFIX%%/etc/periodic/monthly/300.statistics -nodelay To view current statistics, go to: http://www.bsdstats.org Index: sysutils/bsdstats/pkg-plist =================================================================== RCS file: /a/.cvsup/ports/sysutils/bsdstats/pkg-plist,v retrieving revision 1.1 diff -u -p -r1.1 pkg-plist --- sysutils/bsdstats/pkg-plist 19 Aug 2008 10:25:05 -0000 1.1 +++ sysutils/bsdstats/pkg-plist 2 May 2010 22:17:34 -0000 @@ -1,4 +1,5 @@ +@exec mkdir -p %D/etc/periodic/monthly/ etc/periodic/monthly/300.statistics -etc/rc.d/bsdstats.sh +etc/rc.d/bsdstats @dirrmtry etc/periodic/monthly @dirrmtry etc/periodic Index: sysutils/bsdstats/files/300.statistics.in =================================================================== RCS file: /a/.cvsup/ports/sysutils/bsdstats/files/300.statistics.in,v retrieving revision 1.42 diff -u -p -r1.42 300.statistics --- sysutils/bsdstats/files/300.statistics.in 18 Sep 2009 21:19:34 -0000 1.42 +++ sysutils/bsdstats/files/300.statistics.in 2 May 2010 22:05:41 -0000 @@ -28,7 +28,7 @@ checkin_server=${monthly_statistics_chec bsdstats_log=${monthly_statistics_logfile:-"/var/log/bsdstats"} id_token_file='/var/db/bsdstats' -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +PATH=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin export PATH unset HTTP_USER_AGENT Index: sysutils/bsdstats/files/bsdstats.in =================================================================== RCS file: /a/.cvsup/ports/sysutils/bsdstats/files/bsdstats.in,v retrieving revision 1.1 diff -u -p -r1.1 bsdstats.sh --- sysutils/bsdstats/files/bsdstats.in 28 Apr 2007 23:54:03 -0000 1.1 +++ sysutils/bsdstats/files/bsdstats.in 2 May 2010 22:04:45 -0000 @@ -21,7 +21,7 @@ load_rc_config bsdstats name=bsdstats rcvar=`set_rcvar` -command=/usr/local/etc/periodic/monthly/300.statistics +command=%%PREFIX%%/etc/periodic/monthly/300.statistics # default to disable bsdstats_enable=${bsdstats_enable:-"NO"} --- a.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: