source: trunk/base/src/port1.0/portdepends.tcl @ 1560

Last change on this file since 1560 was 1503, checked in by landonf (Landon Fuller), 18 years ago

Make the whitespace foo actually work with vim

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.0 KB
Line 
1# et:ts=4
2# portdepends.tcl
3#
4# Copyright (c) 2002 Apple Computer, Inc.
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
16#    may be used to endorse or promote products derived from this software
17#    without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32# the 'main' target is provided by this package
33# main is a magic target and should not be replaced
34
35package provide portdepends 1.0
36package require portutil 1.0
37
38# define options
39options depends_fetch depends_build depends_run depends_extract depends_lib
40# Export options via PortInfo
41options_export depends_lib depends_run
42
43option_proc depends_fetch handle_depends_options
44option_proc depends_build handle_depends_options
45option_proc depends_run handle_depends_options
46option_proc depends_extract handle_depends_options
47option_proc depends_lib handle_depends_options
48
49proc handle_depends_options {option action args} {
50    global targets
51    switch -regex $action {
52        set|append {
53            foreach depspec $args {
54                        if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9_/\-\.$^\?\+\(\)\|\\]+):([-A-Za-z\./0-9_]+)} "$depspec" match deppath depregex portname] == 1} {
55                                switch $deppath {
56                                        lib { set obj [libportfile_new $portname $depregex] }
57                                        bin { set obj [binportfile_new $portname $depregex] }
58                                        path { set obj [pathportfile_new $portname $depregex] }
59                                }
60                                if {[info exists obj]} {
61                                        $obj append provides $option portfile-$portname 
62                                        lappend targets $obj
63                                        foreach obj [depspec_get_matches $targets deplist $option] {
64                                                $obj append requires portfile-$portname
65                                        }
66                                } else {
67                                        ui_error "unknown depspec type: $deppath"
68                                }
69                        } else {
70                                ui_error "invalid depspec: $depspec"
71                        }
72            }
73        }
74        delete {
75            # xxx: need to delete requirement from each item in the deplist
76        }
77    }
78}
Note: See TracBrowser for help on using the repository browser.