Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2007 15:49:36 GMT
From:      KOMATSU Shinichiro <koma2@lovepeers.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/115249: ports-mgmt/portupgrade fails to refetch mismatched distfiles.
Message-ID:  <200708061549.l76FnaNK005676@www.freebsd.org>
Resent-Message-ID: <200708061550.l76Fo3ga049342@freefall.freebsd.org>

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

>Number:         115249
>Category:       ports
>Synopsis:       ports-mgmt/portupgrade fails to refetch mismatched distfiles.
>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:   Mon Aug 06 15:50:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     KOMATSU Shinichiro
>Release:        FreeBSD 6.2-RELEASE i386
>Organization:
>Environment:
FreeBSD 6.2-RELEASE i386 
>Description:
(1) When checksum mismatch is occured and portupgrade retries to fetch mismatched distfiles,
the following error occurs and refetch fails.

--->  Retrying devel/cvs2cl
--->  Deleting mismatched files
--->  Building '/usr/ports/devel/cvs2cl'
===>  Cleaning for cvs2cl-2.67
===>  Extracting for cvs2cl-2.67
=> MD5 Checksum mismatch for cvs2cl.pl.
=> SHA256 Checksum mismatch for cvs2cl.pl.
===>  Refetch for 1 more times files: cvs2cl.pl cvs2cl.pl 
=> cvs2cl.pl doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.lab.kdd.co.jp/FreeBSD/ports/distfiles/.
env: /us/bin/fetch: No such file or directory
=> Attempting to fetch from http://www.red-bean.com/cvs2cl/.
env: /us/bin/fetch: No such file or directory
=> Attempting to fetch from ftp://ftp.lab.kdd.co.jp/FreeBSD/ports/distfiles/.
env: /us/bin/fetch: No such file or directory
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/local/ports/devel/cvs2cl.
*** Error code 1

Stop in /usr/local/ports/devel/cvs2cl.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.58159.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=cvs2cl-2.62 UPGRADE_PORT_VER=2.62 make MASTER_SORT_REGEX= MASTER_SORT= "FETCH_CMD=/us/bin/fetch -Ap" FETCH_BEFORE_ARGS=-q DEPENDS_TARGET=package
** Fix the problem and try again.


(2) Format of "Checksum mismatch" message has been changed but portupgrade does not know it,
it fails to detect and delete the mismatched distfiles.


>How-To-Repeat:

>Fix:
(1) In "rescue" clause in "build_port", "R" and "r" are removed from $fetch_cmd.
I do not know why this code exists, and removing it solves this problem.

(2) Update the "Checksum mismatch" message to the current one.



Patch attached with submission follows:

Index: bin/portupgrade
===================================================================
RCS file: /cvsroot/portupgrade/pkgtools/bin/portupgrade,v
retrieving revision 1.33.2.3
diff -u -r1.33.2.3 portupgrade
--- bin/portupgrade	3 Jul 2007 10:58:27 -0000	1.33.2.3
+++ bin/portupgrade	6 Aug 2007 15:44:04 -0000
@@ -1705,11 +1705,7 @@
   if !retried && reason == :checksum && $distclean == 1
     progress_message "Retrying #{origin}"
 
-    if /fetch/ =~ $fetch_cmd
-      $fetch_cmd.gsub!(/[Rr]/, '')
-    else
-      $fetch_cmd = nil
-    end
+    $fetch_cmd = nil
 
     return build_port(origin, logfile, true)
   end
@@ -1727,7 +1723,7 @@
   progress_message "Deleting mismatched files"
 
   if File.size(logfile) >= 65536	# 64KB
-    obj = "| grep '^>> Checksum mismatch for ' #{logfile}"
+    obj = "| grep '^=> \\(MD5\\|SHA256\\) Checksum mismatch for ' #{logfile}"
   else
     obj = logfile
   end
@@ -1737,8 +1733,8 @@
   open(obj) do |f|
     f.each do |line|
       case line
-      when /^>> Checksum mismatch for (\S+)\.\r?$/
-	distfile = File.join($portsdb.dist_dir, $1)
+      when /^=> (MD5|SHA256) Checksum mismatch for (\S+)\.\r?$/
+	distfile = File.join($portsdb.dist_dir, $2)
 
 	information_message "Deleting #{distfile}"
 


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



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