Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2004 11:50:14 +0800 (CST)
From:      Leland Wang <llwang@infor.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        knu@FreeBSD.org
Subject:   ports/62990: portupgrade fails to use package even with -PP when package name changes
Message-ID:  <20040218035014.AE0EE52EE4@muse.csie.ntu.edu.tw>
Resent-Message-ID: <200402180350.i1I3oSmg038523@freefall.freebsd.org>

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

>Number:         62990
>Category:       ports
>Synopsis:       portupgrade fails to use package even with -PP when package name changes
>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:   Tue Feb 17 19:50:28 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Leland Wang
>Release:        FreeBSD 4.9-RELEASE-p1 i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD muse.csie.ntu.edu.tw 4.9-RELEASE-p1 FreeBSD 4.9-RELEASE-p1 #3: Sun Feb 1 23:56:10 CST 2004 root@muse.csie.ntu.edu.tw:/home/admin/usr/obj/home/admin/usr/src/sys/MUSE i386


	
>Description:
When a port's name changes to a alphabetically smaller one, portupgrade
fails to use package with -P or -PP options. This is because it compares
oldpkg and newpkg directly rather than oldpkg.version and newpkg.version.
I am not sure if a similiar condition will occur in the case like 
upgrading 4.9 to 4.10.
	
>How-To-Repeat:
In the recent mozilla-firebird -> firefox change, get a firefox package
and do portupgrade -PP mozilla-firebird.
	
>Fix:

--- portupgrade.orig	Wed Feb 18 11:37:11 2004
+++ portupgrade	Wed Feb 18 11:36:42 2004
@@ -941,22 +941,22 @@
   have_package = false
   newpkg = newpkgname = nil
 
-  if (oldpkg < portpkg || $force) && $use_packages
+  if (oldpkg.version < portpkg.version || $force) && $use_packages
     progress_message "Checking the availability of the latest package of '#{origin}'"
 
     newpkg, pkgfile = find_pkg(origin)
 
-    if !newpkg || newpkg < oldpkg || newpkg < portpkg
+    if !newpkg || newpkg.version < oldpkg.version || newpkg.version < portpkg.version
       if fetch_pkg(origin, logfile)
 	newpkg, pkgfile = find_pkg(origin)
       end
 
-      if !newpkg || newpkg < portpkg
+      if !newpkg || newpkg.version < portpkg.version
 	warning_message "Could not fetch the latest version '#{portpkg.version}'"
       end
 
-      if newpkg && newpkg < portpkg
-	if oldpkg < newpkg && $use_packages_only
+      if newpkg && newpkg.version < portpkg.version
+	if oldpkg.version < newpkg.version && $use_packages_only
 	  progress_message "Putting up with the version '#{newpkg.version}'"
 	else
 	  newpkg = nil
	


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



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