From owner-freebsd-ports Fri Nov 10 20:22:47 2000 Delivered-To: freebsd-ports@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-206-90-77.dsl.snfc21.pacbell.net [63.206.90.77]) by hub.freebsd.org (Postfix) with ESMTP id 6E42737B479 for ; Fri, 10 Nov 2000 20:22:41 -0800 (PST) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.11.0/8.11.1) with ESMTP id eAB4SM909717 for ; Fri, 10 Nov 2000 20:28:23 -0800 (PST) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200011110428.eAB4SM909717@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: ports@freebsd.org Subject: Patches for PIB 1.2 Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_-9559119500" Date: Fri, 10 Nov 2000 20:28:22 -0800 From: Mike Smith Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multipart MIME message. --==_Exmh_-9559119500 Content-Type: text/plain; charset=us-ascii Satoshi pointed out that PIB 1.2 doesn't actually deal with the new ports layout properly (it's still looking for the md5 file in the wrong place). The attached patch should fix this; can I ask anyone that uses PIB at all to test and let me know how they go with it? Also, the distfile tool is showing up a few checksum mismatches again. Thanks! (please keep me on the cc: list as I'm not subscribed to -ports) --==_Exmh_-9559119500 Content-Type: text/plain ; name="pib.diff"; charset=us-ascii Content-Description: pib.diff Content-Disposition: attachment; filename="pib.diff" --- orig/pib-1.2/pib.tcl Sat Oct 28 02:01:12 2000 +++ pib.tcl Fri Nov 10 20:01:38 2000 @@ -3,7 +3,7 @@ exec wish8.2 -f $0 $* ################################################################################ # -# Copyright (C) 1996, 1997 +# Copyright (C) 1996, 1997, 2000 # Michael Smith. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -368,7 +368,7 @@ " Ports INDEX Browser" \ " ===================" \ "" \ - " Copyright (c) 1996,1997 Michael Smith" \ + " Copyright (c) 1996,1997, 2000 Michael Smith" \ " msmith@FreeBSD.org" \ "" \ " Please report any bugs to the above address." \ @@ -396,7 +396,6 @@ " OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF" \ " SUCH DAMAGE." \ "" \ - { $Id: pib.tcl,v 1.14 1997/09/11 09:16:56 msmith Exp $ } \ ]; # ########################################################################### @@ -442,9 +441,9 @@ " completion of processing, which is performed the first time the " \ " Distfile browser is opened, or when the \[Rescan\] function is selected." \ "" \ - " No MD5 file The port's 'files' directory has no 'MD5' file." \ - " No files directory The port has no 'files' directory" \ + " No distinfo file The port's directory has no 'distinfo' file." \ " Port directory missing The port's skeleton directory is missing" \ + " Obsolete port The port still has old layout components" \ "" \ " Runtime warnings" \ " ----------------" \ @@ -583,12 +582,12 @@ pack $w.t2 -side top -fill x; # Options - set sf [op_sframe $w "w_md5" "No MD5 file"]; - checkbutton $sf.w -variable Options(warn_no_md5); + set sf [op_sframe $w "w_distinfo" "No distinfo file"]; + checkbutton $sf.w -variable Options(warn_no_distinfo); pack $sf.w -side left; - set sf [op_sframe $w "w_files" "No files directory"]; - checkbutton $sf.w -variable Options(warn_no_fdir); + set sf [op_sframe $w "w_olddir" "Bad directory structure"]; + checkbutton $sf.w -variable Options(warn_dir); pack $sf.w -side left; set sf [op_sframe $w "w_pres" "Port directory missing"]; @@ -795,8 +794,8 @@ # Set program options set Options(version_string) "\# PIB options v1"; - set Options(warn_no_md5) 1; - set Options(warn_no_fdir) 0; + set Options(warn_no_distinfo) 0; + set Options(warn_dir) 1; set Options(warn_no_port) 0; set Options(warn_dup_names) 1; set Options(warn_del_errs) 1; @@ -1899,7 +1898,7 @@ ################################################################################ # df_gather # -# Walk the list of ports and parse the md5 files, build the AllDistfiles and +# Walk the list of ports and parse the distinfo files, build the AllDistfiles and # Checksums arrays. Also walk the collection of present distfiles. # proc df_gather {} { @@ -1930,43 +1929,36 @@ set rate [expr int($psize / (1000 * ([clock seconds] - $stamp) + 1))]; update_pwin df_getdinfo [format "%d/%d ports, %dK/sec" $pports $Status(nports) $rate]; - # Find the md5 file. - if {[catch {set fh [open "$path/files/md5" "r"]}]} { - - # Nope. Perhaps we're dealing with US ITAR braindamage - if {[op_elookup USA_RESIDENT]} { - set aname "$path/files.usa/md5"; - } else { - set aname "$path/files.non_usa/md5"; + # Check there's no old files directory + if {$Options(warn_dir)} { + if {[file isdirectory "$path/patches"]} { + lappend errs "$pname: obsolete patches directory '$path/patches' found"; } + if {[file isdirectory "$path/pkg"]} { + lappend errs "$pname: obsolete package directory '$path/pkg' found"; + } + } - # try again with a new name - if {[catch {set fh [open $aname "r"]}]} { - - # Can't find an md5 file; give up - if {[file isdirectory "$path/files"]} { - if {$Options(warn_no_md5)} { - lappend errs "$pname: '$path/files/md5' not found"; - } - } else { - if {[file isdirectory $path]} { - if {$Options(warn_no_fdir)} { - lappend errs "$pname: '$path/files' not found"; - } - } else { - if {$Options(warn_no_port)} { - lappend errs "$pname: directory missing."; - } - } + # Find the distinfo file. + # XXX How are USA/non-USA md5's handled now? + if {[catch {set fh [open "$path/distinfo" "r"]}]} { + + if {[file isdirectory $path]} { + if {$Options(warn_no_distinfo)} { + lappend errs "$pname: '$path/distinfo' not found"; + } + } else { + if {$Options(warn_no_port)} { + lappend errs "$pname: directory '$path' missing"; } - continue ; # if no port info, assume it's not wanted } + continue ; # if no port info, assume it's not wanted } # initialise state for this port set Ports($pname:distfiles) ""; # list of distfiles for the port - # Process md5 file to get distfiles and checksums + # Process distinfo file to get distfiles and checksums while {[gets $fh line] >= 0} { if {[scan $line "MD5 (%\[^)\]) = %s" df ck] == 2} { # get name and checksum --==_Exmh_-9559119500 Content-Type: text/plain; charset=us-ascii ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E --==_Exmh_-9559119500-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message