Bug 138356 - ports-mgmt/portupgrade: pkgdb -F + ALT_PKGDEP => broken logic
Summary: ports-mgmt/portupgrade: pkgdb -F + ALT_PKGDEP => broken logic
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: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-30 19:40 UTC by Dan Lukes
Modified: 2009-10-26 12:30 UTC (History)
0 users

See Also:


Attachments
patch-DAN-bin-pkgdb (524 bytes, text/plain)
2009-08-30 19:40 UTC, Dan Lukes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Lukes 2009-08-30 19:40:03 UTC
	pkgdb -F 
	deletes dependencies as irrelevant even they aren't

Fix: There are two problems:

[1] the pkgdb search the ALT_PKGDEP only for package names, not for origins. 
The second example on pkgtools.conf/ALT_PKGDEP claims the origins can be used, 
but pkgdb ignore such variant. The databases/mysql50-client is NOT recognized 
when searching for mysql-client-5.0.75 port

Because the pkgdb found no regular nor alternative dependency to mysql-client-5.0.75
for php5-mysqli the dependency is deleted.

pkgdb should use both package name and origin when searching ALT_PKGDEP definition
so current call to 
alt(dep)
needs to be replaced with
alt(dep,origin)


[2] even in the case the pkgdb correctly identified the alternative dependency
(because it's written using package name, not origin) it misinterpret such 
information. In that acse the pkgdb SKIP further processing of the package, 
leaving it in uncorrected state.

The pkgdb should continue to repair the missing dependency of the package. The
fix is simple, because the code can correct the dependency correctly 
- only unnecesarry SKIP block them to do it.

The attached patch corrects both problems. 

How-To-Repeat: 	Imagine you have a system with 
databases/php5-mysqli and databases/mysql50-client
installed. The php5-mysqli depends on MySQL.

	Then upgrade MySQL 5.0 to MySQL 5.1
	Such upgrade is properly recorded in pkgtools.conf, e.g.:

  ALT_PKGDEP = {
        'databases/mysql50-client' => 'databases/mysql51-client',
        'databases/mysql50-server' => 'databases/mysql51-server',
  }


	Now, the php5-mysqli has unsatisfied dependency to (missing) 
databases/mysql50-client. 

	pkgdb -F needs to be run

	Unfortunately, it claim the missing dependency as irrelevant and delete it.

	It's example, of course. Simmilar problem can be seen on other
	cross-port upgrades, e.g.
	lang/perl5.8 -> lang/perl5.10, lang/python25->lang/python26 and more.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-08-31 03:37:05 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2009-10-26 12:26:18 UTC
stas        2009-10-26 12:26:10 UTC

  FreeBSD projects repository

  Modified files:
    pkgtools/bin         pkgdb 
  Log:
  - Fix support for origins in ALT_PKGDEP.
  - Do not skip package processing if its name matches ALT_PKGDEP contents.
  
  PR:             ports/138356
  Submitted by:   Dan Lukes <dan@obluda.cz>
  
  Revision  Changes    Path
  1.25      +7 -5      projects/pkgtools/bin/pkgdb
_______________________________________________
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 3 Stanislav Sedov freebsd_committer freebsd_triage 2009-10-26 12:28:59 UTC
State Changed
From-To: open->closed

Committed. Thanks!