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

Last change on this file was 140488, checked in by khindenburg@…, 5 years ago

Add depends_test to handle the test dependencies of ports

https://lists.macosforge.org/pipermail/macports-dev/2015-September/031366.html
#38208

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1# et:ts=4
2# portdepends.tcl
3# $Id: portdepends.tcl 140488 2015-09-20 13:43:33Z khindenburg@macports.org $
4#
5# Copyright (c) 2005, 2007-2009 The MacPorts Project
6# Copyright (c) 2002 - 2003 Apple Inc.
7# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions
11# are met:
12# 1. Redistributions of source code must retain the above copyright
13#    notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright
15#    notice, this list of conditions and the following disclaimer in the
16#    documentation and/or other materials provided with the distribution.
17# 3. Neither the name of Apple Inc. nor the names of its contributors
18#    may be used to endorse or promote products derived from this software
19#    without specific prior written permission.
20#
21# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31# POSSIBILITY OF SUCH DAMAGE.
32#
33
34package provide portdepends 1.0
35package require portutil 1.0
36
37namespace eval portdepends {
38}
39
40# define options
41options depends_fetch depends_extract depends_build depends_run depends_lib depends_test depends
42# Export options via PortInfo
43options_export depends_fetch depends_extract depends_build depends_lib depends_run depends_test
44
45option_proc depends_fetch portdepends::validate_depends_options
46option_proc depends_extract portdepends::validate_depends_options
47option_proc depends_build portdepends::validate_depends_options
48option_proc depends_run portdepends::validate_depends_options
49option_proc depends_lib portdepends::validate_depends_options
50option_proc depends_test portdepends::validate_depends_options
51
52# New option for the new dependency. We generate a warning because we don't handle this yet.
53option_proc depends portdepends::validate_depends_options_new
54
55set_ui_prefix
56
57proc portdepends::validate_depends_options {option action {value ""}} {
58    global targets
59    switch $action {
60        set {
61            foreach depspec $value {
62                # port syntax accepts colon-separated junk that we do not understand yet.
63                switch -regex $depspec {
64                    ^(lib|bin|path):([-A-Za-z0-9_/.${}^?+()|\\\\]+):([-._A-Za-z0-9]+)$ {}
65                    ^(port)(:.+)?:([-._A-Za-z0-9]+)$ {}
66                    default { return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec] }
67                }
68            }
69        }
70    }
71}
72
73proc portdepends::validate_depends_options_new {option action {value ""}} {
74    ui_warn [msgcat::mc "depends option is not handled yet"]
75}
Note: See TracBrowser for help on using the repository browser.