Bug 24749 - mysql323-server pkg-install script doesn't propagate DB_DIR
Summary: mysql323-server pkg-install script doesn't propagate DB_DIR
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
Depends on:
Reported: 2001-01-31 06:00 UTC by Tom Pavel
Modified: 2004-01-17 12:49 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Pavel 2001-01-31 06:00:01 UTC
The DB_DIR env/make variable allows one to build/installmysql
into a different default database dir.  I expected that if I built
a package using a particular setting of DB_DIR, then the binary 
package would install into that dir on another machine.  This almost 
works, but presently requires that DB_DIR be setenv-ed on the other
machine before pkg_add.  I think that the pkg-install script should 
be editted as part of the package build process to default to the 
specified directory.


I think you need to pass pkg-install through sed, just like is done for 
the mysql-server.sh script.
How-To-Repeat: /usr/ports/databases/mysql323-server 
make DB_DIR=/u1/mysql package

Try to install this on another machine (mkdir /u1 first).
The mysqld will hang up because it lacks permission to /u1/mysql
Comment 1 dirk freebsd_committer 2001-01-31 11:13:17 UTC
Responsible Changed
From-To: freebsd-ports->dirk

Over to maintainer.
Comment 2 dwcjr 2001-06-08 21:35:02 UTC
Does this problem still exist?
Comment 3 dirk freebsd_committer 2001-06-09 09:10:25 UTC
On Fri, Jun 08, 2001 at 03:35:02PM -0500, David W. Chapman Jr. wrote:
> Does this problem still exist?

Yes! A real solution isn't that easy though.
Comment 4 Tom Pavel 2001-06-11 09:34:26 UTC
> > Does this problem still exist?
> Yes! A real solution isn't that easy though.

I see two things that are a bit murky.  One is what exactly the DB_DIR
variable is supposed to achieve.  If it is just supposed to be
settable at install time to override /var/db/mysql, then I should
retract my PR.  On the other hand, the behavior that seemed obvious to
me was that the setting of DB_DIR be compiled into the pkg.  This is
akin to building emacs with WITHOUT_X11=yes, for example.

The other murky area is what is an adequate solution.  My proposal was
to make pkg-install read something like:

    if [ -z "${DB_DIR}" ]; then

and have the Makefile run something like 'sed -e s;%%DB_DIR%%;$(DB_DIR);g'
to generate the actual pkg-install file used in the binary pkg.  I
think this meets my objective of having DB_DIR be a build-time
configurable, while still having it around as an install-time

That said, I would not be too surprised if the actual situation is
much more subtle than I am able to recognize offhand.  I'm sure Dirk
has thought about these issues much more than I have.  If there is no
good way to do what I asked for, then I would think the variables
should be a little better documented so that others do not fall into
the same trap that I did.

Tom Pavel

Network Physics
pavel@networkphysics.com / pavel@alum.mit.edu
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2003-10-25 07:47:57 UTC
Responsible Changed
From-To: dirk->freebsd-ports-bugs

dirk no longer maintains this port, so set this PR free. 

Reviewed by: marcus.
Comment 6 Pav Lucistnik freebsd_committer 2004-01-16 09:28:49 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to qualified sorceror.
Comment 7 Alex Dupre freebsd_committer 2004-01-17 12:49:32 UTC
State Changed
From-To: open->closed

Patch committed, thanks!