New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #21864 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

bad code in fs-traverse update in portarchive.tcl

Reported by: david.osguthorpe@… Owned by: macports-tickets@…
Priority: High Milestone: MacPorts 1.9.0
Component: base Version: 1.8.0
Keywords: Cc: snc@…
Port:

Description (last modified by jmr@…) (diff)

Since 1.8.0 at least (but not at 1.7.0) the original 1.7.0 find code in archive_main in portarchive.tcl

foreach fullpath [exec find $destpath ! -type d] {
...
}

was replaced by an fs-traverse call

        fs-traverse fullpath $destpath {
            if {[file isdirectory $fullpath]} {
                continue
            }
       ....
      }

this code terminates immediately as the first fullpath is a directory which is skipped and hence the contents of the directory are not scanned - ... is never executed for anything

this means since 1.8.0 all +CONTENTS files in archives are incorrect as they do not have a file list

fixups are

        fs-traverse -depth fullpath $destpath {
            if {[file isdirectory $fullpath]} {
                continue
            }
       ....
      }

or

        fs-traverse fullpath $destpath {
            if {![file isdirectory $fullpath]} {
                ...
            }
      }

Change History

comment:1 Changed 4 years ago by snc@…

  • Cc snc@… added

Cc Me!

comment:2 Changed 4 years ago by jmr@…

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

comment:3 Changed 3 years ago by jmr@…

  • Milestone set to MacPorts 1.9.0
Note: See TracTickets for help on using tickets.