You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
@@ -16,7 +16,10 @@ SRCS= port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl \
|
|||||||
portactivate_run.tcl portbuild_run.tcl portbump_run.tcl portchecksum_run.tcl \
|
portactivate_run.tcl portbuild_run.tcl portbump_run.tcl portchecksum_run.tcl \
|
||||||
portclean_run.tcl portconfigure_run.tcl portdeactivate_run.tcl \
|
portclean_run.tcl portconfigure_run.tcl portdeactivate_run.tcl \
|
||||||
portdestroot_run.tcl portdistcheck_run.tcl portdistfiles_run.tcl \
|
portdestroot_run.tcl portdistcheck_run.tcl portdistfiles_run.tcl \
|
||||||
portfetch_run.tcl
|
portextract_run.tcl portfetch_run.tcl portinstall_run.tcl portlint_run.tcl \
|
||||||
|
portlivecheck_run.tcl portload_run.tcl portmirror_run.tcl \
|
||||||
|
portpatch_run.tcl portreload_run.tcl portstartupitem_run.tcl \
|
||||||
|
porttest_run.tcl portuninstall_run.tcl portunload_run.tcl
|
||||||
|
|
||||||
include $(srcdir)/../../Mk/macports.subdir.mk
|
include $(srcdir)/../../Mk/macports.subdir.mk
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ package require portdeactivate 1.0
|
|||||||
package require portclean 1.0
|
package require portclean 1.0
|
||||||
package require porttest 1.0
|
package require porttest 1.0
|
||||||
package require portlint 1.0
|
package require portlint 1.0
|
||||||
package require porttrace 1.0
|
|
||||||
package require portdistcheck 1.0
|
package require portdistcheck 1.0
|
||||||
package require portlivecheck 1.0
|
package require portlivecheck 1.0
|
||||||
package require portmirror 1.0
|
package require portmirror 1.0
|
||||||
@@ -91,4 +90,3 @@ package require portunload 1.0
|
|||||||
package require portreload 1.0
|
package require portreload 1.0
|
||||||
|
|
||||||
package require portdistfiles 1.0
|
package require portdistfiles 1.0
|
||||||
package require portsandbox 1.0
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portactivate_run.tcl
|
||||||
|
|
||||||
# the 'activate' target is provided by this package
|
# the 'activate' target is provided by this package
|
||||||
|
|
||||||
package provide portactivate 1.0
|
package provide portactivate 1.0
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
package provide portactivate_run 1.0
|
package provide portactivate_run 1.0
|
||||||
package require portstartupitem 1.0
|
package require portstartupitem 1.0
|
||||||
package require portutil 1.0
|
|
||||||
|
|
||||||
namespace eval portactivate {
|
namespace eval portactivate {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
# portbuild.tcl
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2013 The MacPorts Project
|
# Copyright (c) 2007 - 2013 The MacPorts Project
|
||||||
# Copyright (c) 2002 - 2004 Apple Inc.
|
# Copyright (c) 2002 - 2004 Apple Inc.
|
||||||
@@ -28,7 +27,6 @@
|
|||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
|
||||||
|
|
||||||
package provide portbuild 1.0
|
package provide portbuild 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portbuild.tcl
|
||||||
|
|
||||||
package provide portbuild_run 1.0
|
package provide portbuild_run 1.0
|
||||||
package require portutil 1.0
|
package require portutil 1.0
|
||||||
package require portprogress 1.0
|
package require portprogress 1.0
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portbump_run.tcl
|
||||||
|
|
||||||
package provide portbump 1.0
|
package provide portbump 1.0
|
||||||
|
|
||||||
set org.macports.bump [target_new org.macports.bump portbump::bump_main]
|
set org.macports.bump [target_new org.macports.bump portbump::bump_main]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portchecksum_run.tcl
|
||||||
|
|
||||||
package provide portchecksum 1.0
|
package provide portchecksum 1.0
|
||||||
|
|
||||||
set org.macports.checksum [target_new org.macports.checksum portchecksum::checksum_main]
|
set org.macports.checksum [target_new org.macports.checksum portchecksum::checksum_main]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portclean_run.tcl
|
||||||
|
|
||||||
# the 'clean' target is provided by this package
|
# the 'clean' target is provided by this package
|
||||||
|
|
||||||
package provide portclean 1.0
|
package provide portclean 1.0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2020 The MacPorts Project
|
# Copyright (c) 2007 - 2020 The MacPorts Project
|
||||||
# Copyright (c) 2007 Markus W. Weissmann <mww@macports.org>
|
# Copyright (c) 2007 Markus W. Weissmann <mww@macports.org>
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
|
||||||
|
|
||||||
package provide portconfigure 1.0
|
package provide portconfigure 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portconfigure.tcl
|
||||||
|
|
||||||
package provide portconfigure_run 1.0
|
package provide portconfigure_run 1.0
|
||||||
package require portutil 1.0
|
package require portutil 1.0
|
||||||
package require portprogress 1.0
|
package require portprogress 1.0
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portdeactivate_run.tcl
|
||||||
|
|
||||||
# the 'deactivate' target is provided by this package
|
# the 'deactivate' target is provided by this package
|
||||||
|
|
||||||
package provide portdeactivate 1.0
|
package provide portdeactivate 1.0
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
package provide portdeactivate_run 1.0
|
package provide portdeactivate_run 1.0
|
||||||
package require portutil 1.0
|
package require portstartupitem_run 1.0
|
||||||
|
|
||||||
namespace eval portdeactivate {
|
namespace eval portdeactivate {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portdestroot_run.tcl
|
||||||
|
|
||||||
package provide portdestroot 1.0
|
package provide portdestroot 1.0
|
||||||
|
|
||||||
set org.macports.destroot [target_new org.macports.destroot portdestroot::destroot_main]
|
set org.macports.destroot [target_new org.macports.destroot portdestroot::destroot_main]
|
||||||
|
|||||||
@@ -30,7 +30,8 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
package provide portdestroot_run 1.0
|
package provide portdestroot_run 1.0
|
||||||
package require portutil 1.0
|
package require portprogress 1.0
|
||||||
|
package require portstartupitem_run 1.0
|
||||||
|
|
||||||
namespace eval portdestroot {
|
namespace eval portdestroot {
|
||||||
|
|
||||||
@@ -45,7 +46,6 @@ proc destroot_start {args} {
|
|||||||
|
|
||||||
ui_notice "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${subport}]"
|
ui_notice "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${subport}]"
|
||||||
|
|
||||||
# start gsoc08-privileges
|
|
||||||
if { [getuid] == 0 && [geteuid] != 0 } {
|
if { [getuid] == 0 && [geteuid] != 0 } {
|
||||||
# if started with sudo but have dropped the privileges
|
# if started with sudo but have dropped the privileges
|
||||||
ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
|
ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
|
||||||
@@ -60,8 +60,6 @@ proc destroot_start {args} {
|
|||||||
return -code error "You cannot run this port without root privileges. You need to re-run with 'sudo port'.";
|
return -code error "You cannot run this port without root privileges. You need to re-run with 'sudo port'.";
|
||||||
}
|
}
|
||||||
|
|
||||||
# end gsoc08-privileges
|
|
||||||
|
|
||||||
set oldmask [umask ${destroot.umask}]
|
set oldmask [umask ${destroot.umask}]
|
||||||
set mtree [findBinary mtree ${::portutil::autoconf::mtree_path}]
|
set mtree [findBinary mtree ${::portutil::autoconf::mtree_path}]
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portdistcheck_run.tcl
|
||||||
|
|
||||||
package provide portdistcheck 1.0
|
package provide portdistcheck 1.0
|
||||||
|
|
||||||
set org.macports.distcheck [target_new org.macports.distcheck portdistcheck::distcheck_main]
|
set org.macports.distcheck [target_new org.macports.distcheck portdistcheck::distcheck_main]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portdistfiles_run.tcl
|
||||||
|
|
||||||
package provide portdistfiles 1.0
|
package provide portdistfiles 1.0
|
||||||
|
|
||||||
set org.macports.distfiles [target_new org.macports.distfiles portdistfiles::distfiles_main]
|
set org.macports.distfiles [target_new org.macports.distfiles portdistfiles::distfiles_main]
|
||||||
|
|||||||
+3
-124
@@ -1,5 +1,4 @@
|
|||||||
# et:ts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
# portextract.tcl
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2005, 2007-2011, 2013-2014, 2016, 2018 The MacPorts Project
|
# Copyright (c) 2005, 2007-2011, 2013-2014, 2016, 2018 The MacPorts Project
|
||||||
# Copyright (c) 2002 - 2003 Apple Inc.
|
# Copyright (c) 2002 - 2003 Apple Inc.
|
||||||
@@ -29,16 +28,14 @@
|
|||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
|
||||||
|
|
||||||
package provide portextract 1.0
|
package provide portextract 1.0
|
||||||
package require portutil 1.0
|
|
||||||
package require port 1.0
|
|
||||||
|
|
||||||
set org.macports.extract [target_new org.macports.extract portextract::extract_main]
|
set org.macports.extract [target_new org.macports.extract portextract::extract_main]
|
||||||
target_provides ${org.macports.extract} extract
|
target_provides ${org.macports.extract} extract
|
||||||
target_requires ${org.macports.extract} main fetch checksum
|
target_requires ${org.macports.extract} main fetch checksum
|
||||||
target_prerun ${org.macports.extract} portextract::extract_start
|
target_prerun ${org.macports.extract} portextract::extract_start
|
||||||
|
target_runpkg ${org.macports.extract} portextract_run
|
||||||
|
|
||||||
namespace eval portextract {
|
namespace eval portextract {
|
||||||
variable all_use_options [list use_7z use_bzip2 use_dmg use_lzip use_lzma use_tar use_xz use_zip]
|
variable all_use_options [list use_7z use_bzip2 use_dmg use_lzip use_lzma use_tar use_xz use_zip]
|
||||||
@@ -54,7 +51,6 @@ commands extract
|
|||||||
|
|
||||||
# Set up defaults
|
# Set up defaults
|
||||||
default extract.asroot no
|
default extract.asroot no
|
||||||
# XXX call out to code in portutil.tcl XXX
|
|
||||||
# This cleans the distfiles list of all site tags
|
# This cleans the distfiles list of all site tags
|
||||||
default extract.only {[portextract::disttagclean $distfiles]}
|
default extract.only {[portextract::disttagclean $distfiles]}
|
||||||
|
|
||||||
@@ -73,8 +69,6 @@ foreach _extract_use_option ${portextract::all_use_options} {
|
|||||||
}
|
}
|
||||||
unset _extract_use_option
|
unset _extract_use_option
|
||||||
|
|
||||||
set_ui_prefix
|
|
||||||
|
|
||||||
# Map a given file name to a canonical extract method name
|
# Map a given file name to a canonical extract method name
|
||||||
proc portextract::method_for_suffix {filename} {
|
proc portextract::method_for_suffix {filename} {
|
||||||
switch -glob -nocase -- $filename {
|
switch -glob -nocase -- $filename {
|
||||||
@@ -314,123 +308,8 @@ proc portextract::add_extract_deps {} {
|
|||||||
}
|
}
|
||||||
port::register_callback portextract::add_extract_deps
|
port::register_callback portextract::add_extract_deps
|
||||||
|
|
||||||
# XXX
|
# Helper function that strips all tag names from a list
|
||||||
# Helper function for portextract.tcl that strips all tag names from a list
|
|
||||||
# Used to clean ${distfiles} for setting the ${extract.only} default
|
# Used to clean ${distfiles} for setting the ${extract.only} default
|
||||||
proc portextract::disttagclean {list} {
|
proc portextract::disttagclean {list} {
|
||||||
return [lmap fname $list {getdistname $fname}]
|
return [lmap fname $list {getdistname $fname}]
|
||||||
}
|
}
|
||||||
|
|
||||||
proc portextract::extract_start {args} {
|
|
||||||
global UI_PREFIX extract.dir extract.mkdir
|
|
||||||
|
|
||||||
ui_notice "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option subport]]"
|
|
||||||
|
|
||||||
# create any users and groups needed by the port
|
|
||||||
handle_add_users
|
|
||||||
|
|
||||||
# should the distfiles be extracted to worksrcpath instead?
|
|
||||||
if {[tbool extract.mkdir]} {
|
|
||||||
global worksrcpath
|
|
||||||
ui_debug "Extracting to subdirectory worksrcdir"
|
|
||||||
file mkdir ${worksrcpath}
|
|
||||||
set extract.dir ${worksrcpath}
|
|
||||||
}
|
|
||||||
|
|
||||||
variable methods_used
|
|
||||||
if {[dict exists $methods_used dmg]} {
|
|
||||||
variable dmg_mount [mkdtemp "/tmp/mports.XXXXXXXX"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
proc portextract::extract_main {args} {
|
|
||||||
global UI_PREFIX distpath filespath extract.dir extract.only extract.methods \
|
|
||||||
extract.cmd extract.pre_args extract.post_args extract.suffix
|
|
||||||
|
|
||||||
if {![exists distfiles] && ![exists extract.only]} {
|
|
||||||
# nothing to do
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# extract.{cmd,pre_args,post_args} options are used for distfiles
|
|
||||||
# using the method matching extract.suffix. This keeps the
|
|
||||||
# behaviour the same as it used to be for the case where all
|
|
||||||
# distfiles in extract.only use that method, which was formerly the
|
|
||||||
# only supported case.
|
|
||||||
# For files with different methods, the args are set up as per the
|
|
||||||
# defaults for the method. If custom args are needed in this case,
|
|
||||||
# a custom method should be used.
|
|
||||||
set main_method [method_for_suffix ${extract.suffix}]
|
|
||||||
foreach distfile ${extract.only} {
|
|
||||||
ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
|
|
||||||
if {[file exists $filespath/$distfile]} {
|
|
||||||
option extract.args "'$filespath/$distfile'"
|
|
||||||
} else {
|
|
||||||
option extract.args "'[file join $distpath $distfile]'"
|
|
||||||
}
|
|
||||||
|
|
||||||
if {[dict exists ${extract.methods} $distfile]} {
|
|
||||||
set method [dict get ${extract.methods} $distfile]
|
|
||||||
} else {
|
|
||||||
set method [method_for_suffix $distfile]
|
|
||||||
}
|
|
||||||
ui_debug "Using extract method: $method"
|
|
||||||
|
|
||||||
if {$method ne $main_method} {
|
|
||||||
if {![info exists saved_options]} {
|
|
||||||
set saved_options [list ${extract.cmd} ${extract.pre_args} ${extract.post_args}]
|
|
||||||
}
|
|
||||||
# set up the args for this method
|
|
||||||
set extract.cmd [get_extract_cmd $method]
|
|
||||||
set extract.pre_args [get_extract_pre_args $method]
|
|
||||||
set extract.post_args [get_extract_post_args $method]
|
|
||||||
}
|
|
||||||
# If the MacPorts user does not have the privileges to mount a
|
|
||||||
# DMG then hdiutil will fail with this error:
|
|
||||||
# hdiutil: attach failed - Device not configured
|
|
||||||
# So elevate back to root.
|
|
||||||
if {$method eq "dmg"} {
|
|
||||||
elevateToRoot {extract dmg}
|
|
||||||
}
|
|
||||||
|
|
||||||
if {${extract.cmd} ne {}} {
|
|
||||||
# built-in method
|
|
||||||
set code [catch {command_exec extract} result]
|
|
||||||
} else {
|
|
||||||
# custom method, call it as a command
|
|
||||||
set code [catch {$method [file join $distpath $distfile]} result]
|
|
||||||
}
|
|
||||||
|
|
||||||
if {$method eq "dmg"} {
|
|
||||||
dropPrivileges
|
|
||||||
}
|
|
||||||
if {$method ne $main_method} {
|
|
||||||
lassign $saved_options extract.cmd extract.pre_args extract.post_args
|
|
||||||
}
|
|
||||||
if {$code} {
|
|
||||||
return -code error "$result"
|
|
||||||
}
|
|
||||||
|
|
||||||
chownAsRoot ${extract.dir}
|
|
||||||
}
|
|
||||||
|
|
||||||
if {[option extract.rename] && ![file exists [option worksrcpath]]} {
|
|
||||||
global workpath distname
|
|
||||||
# rename whatever directory exists in $workpath to $distname
|
|
||||||
set worksubdirs [glob -nocomplain -types d -directory $workpath *]
|
|
||||||
if {[llength $worksubdirs] == 1} {
|
|
||||||
set origpath [lindex $worksubdirs 0]
|
|
||||||
set newpath [file join $workpath $distname]
|
|
||||||
if {$newpath ne $origpath} {
|
|
||||||
ui_debug [format [msgcat::mc "extract.rename: Renaming %s -> %s"] [file tail $origpath] $distname]
|
|
||||||
move $origpath $newpath
|
|
||||||
}
|
|
||||||
} elseif {[llength $worksubdirs] == 0} {
|
|
||||||
return -code error "extract.rename: no directories exist in $workpath"
|
|
||||||
} else {
|
|
||||||
return -code error "extract.rename: multiple directories exist in ${workpath}: $worksubdirs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
|
# License: see portextract.tcl
|
||||||
|
|
||||||
|
package provide portextract_run 1.0
|
||||||
|
|
||||||
|
namespace eval portextract {
|
||||||
|
|
||||||
|
proc extract_start {args} {
|
||||||
|
global UI_PREFIX extract.dir extract.mkdir
|
||||||
|
|
||||||
|
ui_notice "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option subport]]"
|
||||||
|
|
||||||
|
# create any users and groups needed by the port
|
||||||
|
handle_add_users
|
||||||
|
|
||||||
|
# should the distfiles be extracted to worksrcpath instead?
|
||||||
|
if {[tbool extract.mkdir]} {
|
||||||
|
global worksrcpath
|
||||||
|
ui_debug "Extracting to subdirectory worksrcdir"
|
||||||
|
file mkdir ${worksrcpath}
|
||||||
|
set extract.dir ${worksrcpath}
|
||||||
|
}
|
||||||
|
|
||||||
|
variable methods_used
|
||||||
|
if {[dict exists $methods_used dmg]} {
|
||||||
|
variable dmg_mount [mkdtemp "/tmp/mports.XXXXXXXX"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc extract_main {args} {
|
||||||
|
global UI_PREFIX distpath filespath extract.dir extract.only extract.methods \
|
||||||
|
extract.cmd extract.pre_args extract.post_args extract.suffix
|
||||||
|
|
||||||
|
if {![exists distfiles] && ![exists extract.only]} {
|
||||||
|
# nothing to do
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# extract.{cmd,pre_args,post_args} options are used for distfiles
|
||||||
|
# using the method matching extract.suffix. This keeps the
|
||||||
|
# behaviour the same as it used to be for the case where all
|
||||||
|
# distfiles in extract.only use that method, which was formerly the
|
||||||
|
# only supported case.
|
||||||
|
# For files with different methods, the args are set up as per the
|
||||||
|
# defaults for the method. If custom args are needed in this case,
|
||||||
|
# a custom method should be used.
|
||||||
|
set main_method [method_for_suffix ${extract.suffix}]
|
||||||
|
foreach distfile ${extract.only} {
|
||||||
|
ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
|
||||||
|
if {[file exists $filespath/$distfile]} {
|
||||||
|
option extract.args "'$filespath/$distfile'"
|
||||||
|
} else {
|
||||||
|
option extract.args "'[file join $distpath $distfile]'"
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[dict exists ${extract.methods} $distfile]} {
|
||||||
|
set method [dict get ${extract.methods} $distfile]
|
||||||
|
} else {
|
||||||
|
set method [method_for_suffix $distfile]
|
||||||
|
}
|
||||||
|
ui_debug "Using extract method: $method"
|
||||||
|
|
||||||
|
if {$method ne $main_method} {
|
||||||
|
if {![info exists saved_options]} {
|
||||||
|
set saved_options [list ${extract.cmd} ${extract.pre_args} ${extract.post_args}]
|
||||||
|
}
|
||||||
|
# set up the args for this method
|
||||||
|
set extract.cmd [get_extract_cmd $method]
|
||||||
|
set extract.pre_args [get_extract_pre_args $method]
|
||||||
|
set extract.post_args [get_extract_post_args $method]
|
||||||
|
}
|
||||||
|
# If the MacPorts user does not have the privileges to mount a
|
||||||
|
# DMG then hdiutil will fail with this error:
|
||||||
|
# hdiutil: attach failed - Device not configured
|
||||||
|
# So elevate back to root.
|
||||||
|
if {$method eq "dmg"} {
|
||||||
|
elevateToRoot {extract dmg}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {${extract.cmd} ne {}} {
|
||||||
|
# built-in method
|
||||||
|
set code [catch {command_exec extract} result]
|
||||||
|
} else {
|
||||||
|
# custom method, call it as a command
|
||||||
|
set code [catch {$method [file join $distpath $distfile]} result]
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$method eq "dmg"} {
|
||||||
|
dropPrivileges
|
||||||
|
}
|
||||||
|
if {$method ne $main_method} {
|
||||||
|
lassign $saved_options extract.cmd extract.pre_args extract.post_args
|
||||||
|
}
|
||||||
|
if {$code} {
|
||||||
|
return -code error "$result"
|
||||||
|
}
|
||||||
|
|
||||||
|
chownAsRoot ${extract.dir}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[option extract.rename] && ![file exists [option worksrcpath]]} {
|
||||||
|
global workpath distname
|
||||||
|
# rename whatever directory exists in $workpath to $distname
|
||||||
|
set worksubdirs [glob -nocomplain -types d -directory $workpath *]
|
||||||
|
if {[llength $worksubdirs] == 1} {
|
||||||
|
set origpath [lindex $worksubdirs 0]
|
||||||
|
set newpath [file join $workpath $distname]
|
||||||
|
if {$newpath ne $origpath} {
|
||||||
|
ui_debug [format [msgcat::mc "extract.rename: Renaming %s -> %s"] [file tail $origpath] $distname]
|
||||||
|
move $origpath $newpath
|
||||||
|
}
|
||||||
|
} elseif {[llength $worksubdirs] == 0} {
|
||||||
|
return -code error "extract.rename: no directories exist in $workpath"
|
||||||
|
} else {
|
||||||
|
return -code error "extract.rename: multiple directories exist in ${workpath}: $worksubdirs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,33 +1,6 @@
|
|||||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||||
#
|
|
||||||
# Copyright (c) 2004 - 2014, 2016-2018 The MacPorts Project
|
# License: see portfetch_run.tcl
|
||||||
# Copyright (c) 2002 - 2003 Apple Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
# 1. Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
|
||||||
# documentation and/or other materials provided with the distribution.
|
|
||||||
# 3. Neither the name of Apple Inc. nor the names of its contributors
|
|
||||||
# may be used to endorse or promote products derived from this software
|
|
||||||
# without specific prior written permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
#
|
|
||||||
|
|
||||||
package provide portfetch 1.0
|
package provide portfetch 1.0
|
||||||
package require portextract 1.0
|
package require portextract 1.0
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user