Changeset 31028 for trunk/base


Ignore:
Timestamp:
Nov 14, 2007, 11:11:10 AM (12 years ago)
Author:
mww@…
Message:

add option 'extract.mkdir [no|yes]' which can be used instead of:
pre-extract {

file mkdir ${worksrcpath}

}
extract.dir ${worksrcpath}

This is a common pattern for distfiles which do not have a main directory but extract files directly to ${workpath}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portextract.tcl

    r26177 r31028  
    44#
    55# Copyright (c) 2002 - 2003 Apple Computer, Inc.
     6# Copyright (c) 2007 Markus W. Weissmann <mww@macports.org>
    67# All rights reserved.
    78#
     
    4142
    4243# define options
    43 options extract.only
     44options extract.only extract.mkdir
    4445commands extract
    4546
     
    5354default extract.pre_args -dc
    5455default extract.post_args {"| ${portutil::autoconf::tar_command} -xf -"}
     56default extract.mkdir no
    5557
    5658set_ui_prefix
    5759
    5860proc extract_init {args} {
    59     global extract.only extract.dir extract.cmd extract.pre_args extract.post_args distfiles use_bzip2 use_zip workpath
    60    
     61    global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir distfiles use_bzip2 use_zip workpath
     62
     63    # should the distfiles be extracted to worksrcpath instead?
     64    if {[tbool extract.mkdir]} {
     65        global worksrcpath
     66        ui_debug "Extracting to subdirectory worksrcdir"
     67        file mkdir ${worksrcpath}
     68        set extract.dir ${worksrcpath}
     69    }
     70
    6171    if {[tbool use_bzip2]} {
    6272        option extract.cmd [binaryInPath "bzip2"]
Note: See TracChangeset for help on using the changeset viewer.