Skip site navigation (1)Skip section navigation (2)
Date:      29 Aug 2009 14:58:40 +0400
From:      "Alexey V.Degtyarev" <alexey@renatasystems.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/138306: databases/mysqlard - fix mysqlard.conf install with pkg_add
Message-ID:  <20090829105840.34456.qmail@hs-9.renatasystems.org>
Resent-Message-ID: <200908291100.n7TB09nF030915@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138306
>Category:       ports
>Synopsis:       databases/mysqlard - fix mysqlard.conf install with pkg_add
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 29 11:00:07 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Alexey V. Degtyarev
>Release:        FreeBSD 7.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD renatasystems.org 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 08:58:24 UTC 2009 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
databases/mysqlard package does not installs mysqlard.conf then installing
binary package.

$ pkg_add mysqlard-1.0.0_1.tbz
cp: /usr/local/www/mysqlard/mysqlard.cnf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/mysqlard.cnf ] || cp /usr/local/www/mysqlard/mysqlard.cnf /usr/local/etc' failed
...

$ ls /usr/local/etc/mysqlard.cnf
ls: /usr/local/etc/mysqlard.cnf: No such file or directory

This is because of incorrect @exec command sequence in pkg-plist:

@unexec if cmp -s %D/etc/mysqlard.cnf %D/www/mysqlard/mysqlard.cnf; then rm -f %D/etc/mysqlard.cnf; fi
@exec [ -f %D/etc/mysqlard.cnf ] || cp %D/www/mysqlard/mysqlard.cnf %D/etc
...
www/mysqlard/mysqlard.cnf

Command cp(1) involved before config file is beeing installed.
>How-To-Repeat:
Install mysqlard as package - no config file will be installed at PREFIX/etc
>Fix:
Place @exec command after www/mysqlard/mysqlard.cnf defenition in pkg-plist:

	

--- mysqlard.patch begins here ---
diff -u -r mysqlard.orig/pkg-plist mysqlard/pkg-plist
--- mysqlard.orig/pkg-plist	2006-10-05 00:00:40.000000000 +0400
+++ mysqlard/pkg-plist	2009-08-29 14:45:00.000000000 +0400
@@ -1,4 +1,5 @@
 @unexec if cmp -s %D/etc/mysqlard.cnf %D/www/mysqlard/mysqlard.cnf; then rm -f %D/etc/mysqlard.cnf; fi
+www/mysqlard/mysqlard.cnf
 @exec [ -f %D/etc/mysqlard.cnf ] || cp %D/www/mysqlard/mysqlard.cnf %D/etc
 bin/mysqlar_graph
 sbin/mysqlard
@@ -7,7 +8,6 @@
 www/mysqlard/mysqlar.monthly
 www/mysqlard/mysqlar.php
 www/mysqlard/mysqlar.weekly
-www/mysqlard/mysqlard.cnf
 www/mysqlard/mysqlard.server
 www/mysqlard/rrdtool.gif
 www/mysqlard/sos.gif
--- mysqlard.patch ends here ---


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090829105840.34456.qmail>