Ticket #2452: portdep.diff

File portdep.diff, 3.0 KB (added by jberry@…, 19 years ago)

Patch to implement port dependency.

  • base/src/darwinports1.0/darwinports.tcl

    ? base/Makefile
    ? base/config.log
    ? base/config.status
    ? base/test.c
    ? base/Mk/dports.autoconf.mk
    ? base/doc/macosx.mtree
    ? base/doc/ports.conf
    ? base/doc/prefix.mtree
    ? base/src/config.h
    ? base/src/darwinports1.0/Darwinports.dylib
    ? base/src/darwinports1.0/darwinports_autoconf.tcl
    ? base/src/darwinports1.0/darwinports_fastload.tcl
    ? base/src/pextlib1.0/Pextlib.dylib
    ? base/src/port/port
    ? base/src/port/portall
    ? base/src/port/portindex
    ? base/src/port1.0/port_autoconf.tcl
    ? base/src/programs/Makefile
    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
    retrieving revision 1.158
    diff -u -b -r1.158 darwinports.tcl
     
    621621        return [_dportsearchpath $depregex $search_path]
    622622}
    623623
     624### _porttest is private; subject to change without notice
     625
     626proc _porttest {dport depspec} {
     627        # We don't actually look for the port, but just return false
     628        # in order to let the dportdepends handle the dependency
     629        return 0
     630}
     631
    624632### _dportinstalled is private; may change without notice
    625633
    626634# Determine if a port is already *installed*, as in "in the registry".
     
    636644        }
    637645}
    638646
    639 ### _dporispresent is private; may change without notice
     647### _dportispresent is private; may change without notice
    640648
    641649# Determine if some depspec is satisfied or if the given port is installed.
    642650# We actually start with the registry (faster?)
     
    663671                        lib { return [_libtest $dport $depspec] }
    664672                        bin { return [_bintest $dport $depspec] }
    665673                        path { return [_pathtest $dport $depspec] }
     674                        port { return [_porttest $dport $depspec] }
    666675                        default {return -code error "unknown depspec type: $type"}
    667676                }
    668677                return 0
  • base/src/port1.0/portdepends.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portdepends.tcl,v
    retrieving revision 1.38
    diff -u -b -r1.38 portdepends.tcl
     
    4646    switch -regex $action {
    4747        set|append|delete {
    4848            foreach depspec $args {
    49                 if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9_/\-\.$^\?\+\(\)\|\\]+):([-A-Za-z\./0-9_]+)} "$depspec" match deppath depregex portname]} {
    50                     switch $deppath {
    51                         lib {}
    52                         bin {}
    53                         path {}
     49                if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9_/\-\.$^\?\+\(\)\|\\]*):([-A-Za-z\./0-9_]+)} "$depspec" match deppath depregex portname]} {
     50                        switch -regex $deppath {
     51                        lib|bin|path {
     52                                if {[string length $depregex] == 0} {
     53                                        return -code error [format [msgcat::mc "invalid depspec: %s (missing regex component)"] $depspec]
     54                                }
     55                        }
     56                        port {}
    5457                        default {return -code error [format [msgcat::mc "unknown depspec type: %s"] $deppath]}
    5558                    }
    5659                } else {