Bug 104075 - database/postgresql-* ports: missing CONFLICTS
Summary: database/postgresql-* ports: missing CONFLICTS
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: Palle Girgensohn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-06 21:40 UTC by Sergiy Vyshnevetskiy
Modified: 2007-09-17 17:53 UTC (History)
0 users

See Also:


Attachments
postgresql-docs-Makefile.diff (1.04 KB, patch)
2006-12-12 17:42 UTC, Sergiy Vyshnevetskiy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergiy Vyshnevetskiy 2006-10-06 21:40:28 UTC
Different versions of each database/postgresql-* port are always installed into the same place regardless of PostgreSQL version. So they must be marked as conflicting with any versions of themselves.

In general, each port with dinamically generated version, that is installed in the same place regardless of version, conflicts with all other versions of itself.

Fix: 

Porters handbook says:

Please make sure that CONFLICTS does not match this port's package itself, or else forcing its installation with FORCE_PKG_REGISTER will no longer work.

.. but it worked just fine when I tested it. Re-check, please, and submit a PR to docs if this statement in handbook is outdated - this can really simplify setting of CONFLICTS variable.

If I'm correct, then just add to all databases/postgresql-*/Makefile a line like that:

CONFLICTS=${PORTNAME}${PKGNAMESUFFIX}-*

.. unless the idea of port conflicting with itself offends your delicate sence of logic. :)
Current ports .mk scripts correctly detect that packet is already installed, I checked.

If I'm wrong (or the sence was offended :) ), there are two ways to fix the bug.

1. Construct a string from version, enclosing each character into '[!' and ']':
        version -> [!v][!e][!r][!s][!i][!o][!n]
That's proper shell-globbing expression to say "any name except 'version'". Make is incapable of doing such fine character manipulations, AFAIK, so you will have to use an external program.

2. Add version to the installation path.
How-To-Repeat: Install databases/postgresql80-client port.
Install databases/postgresql-docs port. This installs postgresql-docs-8.0.* package.
Deinstall databases/postgresql80-client port.
Install  databases/postgresql81-client port.
Install databases/postgresql-docs. This installs postgresql-docs-8.1.* package ON TOP of  postgresql-docs-8.0.* package!
This can be done with any of databases/postgresql-* ports.
Comment 1 Edwin Groothuis freebsd_committer 2006-10-06 22:42:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->girgen

Over to maintainer
Comment 2 Palle Girgensohn freebsd_committer 2006-11-07 15:23:57 UTC
Hi!

The problem is that a port cannot conflict with itself. Hence all 
postgresql slave ports that install different version depending on the 
installation of postgresql-client will never conflict. Here's the relevant 
rows in Mk/bsd.ports.mk:

3635: if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; 
then \
3636:	conflicts_with="$${conflicts_with} $${entry}"; \
3637: fi; \

I think I will have to think of some way to handle this. None of your 
suggestions really help, unfortunately, since the only way I can think of 
is to create separate ports for each version of the docs, or to do some 
better magic in bsd.ports.mk. The latter would be preferred, I think, but 
I'm not sure.

/Palle
Comment 3 Palle Girgensohn freebsd_committer 2006-11-07 16:12:33 UTC
State Changed
From-To: open->analyzed

I'll have to work out a working way to handle this.
Comment 4 Sergiy Vyshnevetskiy 2006-12-12 17:42:10 UTC
On Tue, 7 Nov 2006, Palle Girgensohn wrote:

> Hi!
>
> The problem is that a port cannot conflict with itself. Hence all postgresql 
> slave ports that install different version depending on the installation of 
> postgresql-client will never conflict. Here's the relevant rows in 
> Mk/bsd.ports.mk:
>
> 3635: if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; 
> then \
> 3636:	conflicts_with="$${conflicts_with} $${entry}"; \
> 3637: fi; \
>
> I think I will have to think of some way to handle this. None of your 
> suggestions really help, unfortunately, since the only way I can think of is 
> to create separate ports for each version of the docs, or to do some better 
> magic in bsd.ports.mk. The latter would be preferred, I think, but I'm not 
> sure.

After some thinking I realized, that the problem I reported concerns 
postgresql-docs only! Other postgresql-* ports depend on 
postgresql-client-* and will be deinstalled with it.

postgresql-docs doesn't - so it won't. I strongly believe that installing 
in a path with postgresql version number included will solve the problem.
(Different versions of docs doesn't conflict as long as they are in 
separate folders.)

Approximate patch for do-install and post-install targets included.
Is it that simple or am I missing something?
Comment 5 dfilter service freebsd_committer 2007-09-17 17:45:07 UTC
girgen      2007-09-17 16:45:01 UTC

  FreeBSD ports repository

  Modified files:
    databases/postgresql73-server Makefile distinfo 
    databases/postgresql74-server Makefile distinfo 
    databases/postgresql80-server Makefile distinfo 
                                  pkg-plist-server 
    databases/postgresql81-server Makefile distinfo 
                                  pkg-plist-server 
    databases/postgresql82-server Makefile distinfo 
    databases/postgresql-docs Makefile 
  Log:
  Update PostgreSQL ports to the latest patch releases.
  
  PR: ports/104075
  
  Revision  Changes    Path
  1.15      +9 -5      ports/databases/postgresql-docs/Makefile
  1.150     +2 -2      ports/databases/postgresql73-server/Makefile
  1.48      +12 -12    ports/databases/postgresql73-server/distinfo
  1.152     +2 -2      ports/databases/postgresql74-server/Makefile
  1.48      +12 -12    ports/databases/postgresql74-server/distinfo
  1.166     +2 -2      ports/databases/postgresql80-server/Makefile
  1.58      +12 -12    ports/databases/postgresql80-server/distinfo
  1.11      +1 -0      ports/databases/postgresql80-server/pkg-plist-server
  1.167     +2 -2      ports/databases/postgresql81-server/Makefile
  1.56      +12 -12    ports/databases/postgresql81-server/distinfo
  1.11      +1 -0      ports/databases/postgresql81-server/pkg-plist-server
  1.170     +8 -8      ports/databases/postgresql82-server/Makefile
  1.56      +12 -12    ports/databases/postgresql82-server/distinfo
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Palle Girgensohn freebsd_committer 2007-09-17 17:52:23 UTC
State Changed
From-To: analyzed->closed

Committed. Thanks! 

The postgresql-docs port was modified to install into a version marked 
subdirectory.