[51515] branches/images-and-archives/base
blb at macports.org
blb at macports.org
Tue May 26 22:55:07 PDT 2009
Revision: 51515
http://trac.macports.org/changeset/51515
Author: blb at macports.org
Date: 2009-05-26 22:55:07 -0700 (Tue, 26 May 2009)
Log Message:
-----------
Remove last vestiges of archive and older image code
Switch activate to require imagefile instead of install
Install now simply requires activate, vastly simplifying it
Modified Paths:
--------------
branches/images-and-archives/base/Mk/macports.upgrade.mk
branches/images-and-archives/base/src/macports1.0/macports.tcl
branches/images-and-archives/base/src/package1.0/Makefile
branches/images-and-archives/base/src/package1.0/package.tcl
branches/images-and-archives/base/src/port/port-help.tcl
branches/images-and-archives/base/src/port/port.tcl
branches/images-and-archives/base/src/port1.0/portactivate.tcl
branches/images-and-archives/base/src/port1.0/portclean.tcl
branches/images-and-archives/base/src/port1.0/portinstall.tcl
branches/images-and-archives/base/src/port1.0/portutil.tcl
branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl
branches/images-and-archives/base/src/registry1.0/registry.tcl
Removed Paths:
-------------
branches/images-and-archives/base/src/package1.0/portarchive.tcl
Modified: branches/images-and-archives/base/Mk/macports.upgrade.mk
===================================================================
--- branches/images-and-archives/base/Mk/macports.upgrade.mk 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/Mk/macports.upgrade.mk 2009-05-27 05:55:07 UTC (rev 51515)
@@ -24,7 +24,7 @@
# Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first:
[ -d $(DESTDIR)${localstatedir}/macports ] || mkdir -vp $(DESTDIR)${localstatedir}/macports
- for dir in distfiles packages receipts software; do \
+ for dir in distfiles images receipts software; do \
[ ! -d $(DESTDIR)${localstatedir}/db/dports/$${dir} ] || mv -v $(DESTDIR)${localstatedir}/db/dports/$${dir} $(DESTDIR)${localstatedir}/macports ; \
done
Modified: branches/images-and-archives/base/src/macports1.0/macports.tcl
===================================================================
--- branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -41,8 +41,8 @@
namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
variable bootstrap_options "\
portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
- portarchivepath portarchivetype portautoclean \
- porttrace portverbose destroot_umask variants_conf rsync_server rsync_options \
+ portautoclean porttrace \
+ portverbose destroot_umask variants_conf rsync_server rsync_options \
rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir frameworks_dir universal_target universal_sysroot universal_archs \
@@ -50,8 +50,8 @@
variable user_options "submitter_name submitter_email submitter_key"
variable portinterp_options "\
portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
- registry.path registry.format portimagefilepath portarchivepath \
- portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server \
+ registry.path registry.format portimagefilepath portautoclean \
+ porttrace portverbose destroot_umask rsync_server \
rsync_options rsync_dir startupitem_type place_worksymlink \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir frameworks_dir universal_target universal_sysroot universal_archs $user_options \
@@ -544,27 +544,6 @@
}
}
- # Archive path, where to store/retrieve binary archive packages
- set macports::portarchivepath [file join $portdbpath packages]
- global macports::portarchivepath
- if {![file isdirectory $portarchivepath]} {
- if {![file exists $portarchivepath]} {
- if {[catch {file mkdir $portarchivepath} result]} {
- return -code error "portarchivepath $portarchivepath does not exist and could not be created: $result"
- }
- }
- }
- if {![file isdirectory $portarchivepath]} {
- return -code error "$portarchivepath is not a directory. Please create the directory $portarchivepath and try again"
- }
-
- set macports::portarchivetype "tbz"
- global macports::portarchivetype
- # Convert archive type to a list for multi-archive support, colon or
- # comma separators indicates to use multiple archive formats
- # (reading and writing)
- set macports::portarchivetype [split $portarchivetype {:,}]
-
# Set rync options
if {![info exists rsync_server]} {
set macports::rsync_server rsync.macports.org
@@ -1345,8 +1324,8 @@
set dlist {}
if {$target == "configure" || $target == "build"
|| $target == "test"
- || $target == "destroot" || $target == "imagefile" || $target == "install"
- || $target == "archive"
+ || $target == "destroot" || $target == "imagefile"
+ || $target == "install"
|| $target == "dmg" || $target == "mdmg"
|| $target == "pkg" || $target == "mpkg"
|| $target == "rpm" || $target == "dpkg"
@@ -1369,7 +1348,7 @@
dlist_delete dlist $mport
# install them
- set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
+ set result [dlist_eval $dlist _mportactive [list _mportexec "install"]]
if {$result != {}} {
set errstring "The following dependencies failed to build:"
@@ -1392,12 +1371,6 @@
set clean 1
}
- # If we're doing image installs, then we should activate after install
- # xxx: This isn't pretty
- if {[string equal $target "install"]} {
- set target activate
- }
-
# Build this port with the specified target
set result [$workername eval eval_targets $target]
@@ -1674,9 +1647,7 @@
set source_url $source
}
}
- if {[info exists portinfo(portarchive)]} {
- set porturl ${source_url}/$portinfo(portarchive)
- } elseif {[info exists portinfo(portdir)]} {
+ if {[info exists portinfo(portdir)]} {
set porturl ${source_url}/$portinfo(portdir)
}
if {[info exists porturl]} {
@@ -1758,9 +1729,7 @@
set source_url $source
}
}
- if {[info exists portinfo(portarchive)]} {
- set porturl ${source_url}/$portinfo(portarchive)
- } elseif {[info exists portinfo(portdir)]} {
+ if {[info exists portinfo(portdir)]} {
set porturl ${source_url}/$portinfo(portdir)
}
if {[info exists porturl]} {
@@ -1940,7 +1909,6 @@
destroot -
imagefile -
install -
- archive -
dmg -
pkg -
portpkg -
@@ -2397,13 +2365,10 @@
}
- # build or unarchive version_in_tree
- set upgrade_action "archive"
-
# avoid building again unnecessarily
if {[info exists options(ports_force)] || $epoch_override == 1
|| ![registry::entry_exists $portname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]} {
- if {[catch {set result [mportexec $workername $upgrade_action]} result] || $result != 0} {
+ if {[catch {set result [mportexec $workername imagefile]} result] || $result != 0} {
global errorInfo
ui_debug "$errorInfo"
ui_error "Unable to upgrade port: $result"
Modified: branches/images-and-archives/base/src/package1.0/Makefile
===================================================================
--- branches/images-and-archives/base/src/package1.0/Makefile 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/package1.0/Makefile 2009-05-27 05:55:07 UTC (rev 51515)
@@ -1,7 +1,7 @@
INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/package1.0
SRCS= package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl portportpkg.tcl \
- portrpm.tcl portsrpm.tcl portdpkg.tcl portarchive.tcl
+ portrpm.tcl portsrpm.tcl portdpkg.tcl
include ../../Mk/macports.autoconf.mk
Modified: branches/images-and-archives/base/src/package1.0/package.tcl
===================================================================
--- branches/images-and-archives/base/src/package1.0/package.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/package1.0/package.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -40,4 +40,3 @@
package require portmdmg 1.0
package require portdpkg 1.0
package require portportpkg 1.0
-package require portarchive 1.0
Deleted: branches/images-and-archives/base/src/package1.0/portarchive.tcl
===================================================================
--- branches/images-and-archives/base/src/package1.0/portarchive.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/package1.0/portarchive.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -1,490 +0,0 @@
-# vim:ts=4 sw=4 fo=croq
-# portarchive.tcl
-# $Id$
-#
-# Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
-# Copyright (c) 2002 - 2003 Apple Computer, 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 Computer, 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 portarchive 1.0
-package require portutil 1.0
-
-set org.macports.archive [target_new org.macports.archive portarchive::archive_main]
-target_init ${org.macports.archive} portarchive::archive_init
-target_provides ${org.macports.archive} archive
-target_requires ${org.macports.archive} main fetch extract checksum patch configure build destroot
-target_prerun ${org.macports.archive} portarchive::archive_start
-target_postrun ${org.macports.archive} portarchive::archive_finish
-
-namespace eval portarchive {
-}
-
-# defaults
-default archive.dir {${destpath}}
-default archive.env {}
-default archive.cmd {}
-default archive.pre_args {}
-default archive.args {}
-default archive.post_args {}
-
-default archive.destpath {${portarchivepath}}
-default archive.type {}
-default archive.file {}
-default archive.path {}
-
-default archive.meta false
-default archive.metaname {}
-default archive.metapath {}
-
-set_ui_prefix
-
-proc portarchive::archive_init {args} {
- global UI_PREFIX target_state_fd
- global variations package.destpath workpath
- global ports_force
- global portname portversion portrevision portvariants
- global archive.destpath archive.type archive.meta
- global archive.file archive.path archive.fulldestpath
-
- # Define port variants if not already defined
- if { ![info exists portvariants] } {
- set portvariants ""
- set vlist [lsort -ascii [array names variations]]
- # Put together variants in the form +foo+bar for the archive name
- foreach v $vlist {
- if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
- set portvariants "${portvariants}+${v}"
- }
- }
- }
-
- # Define archive destination directory and target filename
- if {![string equal ${archive.destpath} ${workpath}] && ![string equal ${archive.destpath} ""]} {
- set archive.fulldestpath [file join ${archive.destpath} [option os.platform] [option os.arch]]
- } else {
- set archive.fulldestpath ${archive.destpath}
- }
-
- # Determine if archive should be skipped
- set skipped 0
- if {[check_statefile target org.macports.archive $target_state_fd]} {
- return 0
- } else {
- set unsupported 0
- set any_missing no
- foreach archive.type [option portarchivetype] {
- if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
- set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
- set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
- if {![file exists ${archive.path}]} {
- set any_missing yes
- }
- } else {
- ui_debug "Skipping [string toupper ${archive.type}] archive: $errmsg"
- set unsupported [expr $unsupported + 1]
- }
- }
- if {!$any_missing} {
- # might be nice to allow forcing, but let's fix #16061 first
- ui_debug "Skipping archive ($portname) since archive(s) already exist"
- set skipped 1
- }
- if {${archive.type} == "xpkg"} {
- set archive.meta true
- }
- if {[llength [option portarchivetype]] == $unsupported} {
- ui_debug "Skipping archive ($portname) since specified archive types not supported"
- set skipped 1
- }
- }
- # Skip archive target by setting state
- if {$skipped == 1} {
- write_statefile target "org.macports.archive" $target_state_fd
- }
-
- return 0
-}
-
-proc portarchive::archive_start {args} {
- global UI_PREFIX
- global portname portversion portrevision portvariants
-
- if {[llength [option portarchivetype]] > 1} {
- ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
- } else {
- ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
- }
-
- return 0
-}
-
-proc portarchive::archive_command_setup {args} {
- global archive.env archive.cmd
- global archive.pre_args archive.args archive.post_args
- global archive.type archive.path
- global archive.metaname archive.metapath
- global os.platform os.version
-
- # Define appropriate archive command and options
- set archive.env {}
- set archive.cmd {}
- set archive.pre_args {}
- set archive.args {}
- set archive.post_args {}
- switch -regex ${archive.type} {
- cp(io|gz) {
- set pax "pax"
- if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
- ui_debug "Using $pax"
- set archive.cmd "$pax"
- set archive.pre_args {-w -v -x cpio}
- if {[regexp {z$} ${archive.type}]} {
- set gzip "gzip"
- if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
- ui_debug "Using $gzip"
- set archive.args {.}
- set archive.post_args "| $gzip -c9 > ${archive.path}"
- } else {
- ui_debug $errmsg
- return -code error "No '$gzip' was found on this system!"
- }
- } else {
- set archive.args "-f ${archive.path} ."
- }
- } else {
- ui_debug $errmsg
- return -code error "No '$pax' was found on this system!"
- }
- }
- t(ar|bz|lz|xz|gz) {
- set tar "tar"
- if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
- ui_debug "Using $tar"
- set archive.cmd "$tar"
- set archive.pre_args {-cvf}
- if {[regexp {z2?$} ${archive.type}]} {
- if {[regexp {bz2?$} ${archive.type}]} {
- set gzip "bzip2"
- set level 9
- } elseif {[regexp {lz$} ${archive.type}]} {
- set gzip "lzma"
- set level 7
- } elseif {[regexp {xz$} ${archive.type}]} {
- set gzip "xz"
- set level 6
- } else {
- set gzip "gzip"
- set level 9
- }
- if {[info exists portutil::autoconf::${gzip}_path]} {
- set hint [set portutil::autoconf::${gzip}_path]
- } else {
- set hint ""
- }
- if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
- ui_debug "Using $gzip"
- set archive.args {- .}
- set archive.post_args "| $gzip -c$level > ${archive.path}"
- } else {
- ui_debug $errmsg
- return -code error "No '$gzip' was found on this system!"
- }
- } else {
- set archive.args "${archive.path} ."
- }
- } else {
- ui_debug $errmsg
- return -code error "No '$tar' was found on this system!"
- }
- }
- xar {
- set xar "xar"
- if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
- ui_debug "Using $xar"
- set archive.cmd "$xar"
- set archive.pre_args {-cvf}
- set archive.args "${archive.path} ."
- } else {
- ui_debug $errmsg
- return -code error "No '$xar' was found on this system!"
- }
- }
- xpkg {
- set xar "xar"
- set compression "bzip2"
- if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
- ui_debug "Using $xar"
- set archive.cmd "$xar"
- set archive.pre_args "-cv --exclude='\./\+.*' --compression=${compression} -n ${archive.metaname} -s ${archive.metapath} -f"
- set archive.args "${archive.path} ."
- } else {
- ui_debug $errmsg
- return -code error "No '$xar' was found on this system!"
- }
- }
- zip {
- set zip "zip"
- if {[catch {set zip [findBinary $zip ${portutil::autoconf::zip_path}]} errmsg] == 0} {
- ui_debug "Using $zip"
- set archive.cmd "$zip"
- set archive.pre_args {-ry9}
- set archive.args "${archive.path} ."
- } else {
- ui_debug $errmsg
- return -code error "No '$zip' was found on this system!"
- }
- }
- default {
- return -code error "Invalid port archive type '${archive.type}' specified!"
- }
- }
-
- return 0
-}
-
-proc portarchive::putel { fd el data } {
- # Quote xml data
- set quoted [string map { & & < < > > } $data]
- # Write the element
- puts $fd "<${el}>${quoted}</${el}>"
-}
-
-proc portarchive::putlist { fd listel itemel list } {
- puts $fd "<$listel>"
- foreach item $list {
- putel $fd $itemel $item
- }
- puts $fd "</$listel>"
-}
-
-proc portarchive::archive_main {args} {
- global UI_PREFIX variations
- global workpath destpath portpath ports_force
- global portname portepoch portversion portrevision portvariants
- global archive.fulldestpath archive.type archive.file archive.path
- global archive.meta archive.metaname archive.metapath
- global os.platform os.arch
-
- # Create archive destination path (if needed)
- if {![file isdirectory ${archive.fulldestpath}]} {
- system "mkdir -p ${archive.fulldestpath}"
- }
-
- # Create (if no files) destroot for archiving
- if {![file isdirectory ${destpath}]} {
- system "mkdir -p ${destpath}"
- }
-
- # Copy state file into destroot for archiving
- # +STATE contains a copy of the MacPorts state information
- set statefile [file join $workpath .macports.${portname}.state]
- file copy -force $statefile [file join $destpath "+STATE"]
-
- # Copy Portfile into destroot for archiving
- # +PORTFILE contains a copy of the MacPorts Portfile
- set portfile [file join $portpath Portfile]
- file copy -force $portfile [file join $destpath "+PORTFILE"]
-
- # Create some informational files that we don't really use just yet,
- # but we may in the future in order to allow port installation from
- # archives without a full "ports" tree of Portfiles.
- #
- # Note: These have been modeled after FreeBSD type package files to
- # start. We can change them however we want for actual future use if
- # needed.
- #
- # +COMMENT contains the port description
- set fd [open [file join $destpath "+COMMENT"] w]
- if {[exists description]} {
- puts $fd "[option description]"
- }
- close $fd
- # +DESC contains the port long_description and homepage
- set fd [open [file join $destpath "+DESC"] w]
- if {[exists long_description]} {
- puts $fd "[option long_description]"
- }
- if {[exists homepage]} {
- puts $fd "\nWWW: [option homepage]"
- }
- close $fd
- # +CONTENTS contains the port version/name info and all installed
- # files and checksums
- set control [list]
- set fd [open [file join $destpath "+CONTENTS"] w]
- puts $fd "@name ${portname}-${portversion}_${portrevision}${portvariants}"
- puts $fd "@portname ${portname}"
- puts $fd "@portepoch ${portepoch}"
- puts $fd "@portversion ${portversion}"
- puts $fd "@portrevision ${portrevision}"
- set vlist [lsort -ascii [array names variations]]
- foreach v $vlist {
- if {![string equal $v [option os.platform]] && ![string equal $v [option os.arch]]} {
- puts $fd "@portvariant +${v}"
- }
- }
- foreach fullpath [exec find $destpath ! -type d] {
- set relpath [strsed $fullpath "s|^$destpath/||"]
- if {![regexp {^[+]} $relpath]} {
- puts $fd "$relpath"
- if {[file isfile $fullpath]} {
- ui_debug "checksum file: $fullpath"
- set checksum [md5 file $fullpath]
- puts $fd "@comment MD5:$checksum"
- }
- } else {
- lappend control $relpath
- }
- }
- foreach relpath $control {
- puts $fd "@ignore"
- puts $fd "$relpath"
- }
- close $fd
-
- # the XML package metadata, for XAR package
- # (doesn't contain any file list/checksums)
- if {${archive.meta}} {
- set archive.metaname "xpkg"
- set archive.metapath [file join $workpath "${archive.metaname}.xml"]
- set sd [open ${archive.metapath} w]
- puts $sd "<xpkg version='0.2'>"
- # TODO: split contents into <buildinfo> (new) and <package> (current)
- # see existing <portpkg> for the matching source package layout
-
- putel $sd name ${portname}
- putel $sd epoch ${portepoch}
- putel $sd version ${portversion}
- putel $sd revision ${portrevision}
- putel $sd major 0
- putel $sd minor 0
-
- putel $sd platform ${os.platform}
- putel $sd arch ${os.arch}
- set vlist [lsort -ascii [array names variations]]
- putlist $sd variants variant $vlist
-
- if {[exists categories]} {
- set primary [lindex [split [option categories] " "] 0]
- putel $sd category $primary
- }
- if {[exists description]} {
- putel $sd comment "[option description]"
- }
- if {[exists long_description]} {
- putel $sd desc "[option long_description]"
- }
- if {[exists homepage]} {
- putel $sd homepage "[option homepage]"
- }
-
- # Emit dependencies provided by this package
- puts $sd "<provides>"
- set name ${portname}
- puts $sd "<item>"
- putel $sd name $name
- putel $sd major 0
- putel $sd minor 0
- puts $sd "</item>"
- puts $sd "</provides>"
-
- set res [mport_lookup $portname]
- if {[llength $res] < 2} {
- ui_error "Dependency $portname not found"
- } else {
- array set portinfo [lindex $res 1]
-
- # Emit build, library, and runtime dependencies
- puts $sd "<requires>"
- foreach {key type} {
- depends_build "build"
- depends_lib "library"
- depends_run "runtime"
- } {
- if {[info exists portinfo($key)]} {
- set name [lindex [split $portinfo($key) :] end]
- puts $sd "<item type=\"$type\">"
- putel $sd name $name
- putel $sd major 0
- putel $sd minor 0
- puts $sd "</item>"
- }
- }
- puts $sd "</requires>"
- }
-
- puts $sd "</xpkg>"
- close $sd
- }
-
- # Now create the archive(s)
- # Loop through archive types
- foreach archive.type [option portarchivetype] {
- if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
- # Define archive file/path
- set archive.file "${portname}-${portversion}_${portrevision}${portvariants}.[option os.arch].${archive.type}"
- set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
-
- # Setup archive command
- archive_command_setup
-
- # Remove existing archive
- if {[file exists ${archive.path}]} {
- ui_info "$UI_PREFIX [format [msgcat::mc "Deleting previous %s"] ${archive.file}]"
- file delete -force ${archive.path}
- }
-
- ui_info "$UI_PREFIX [format [msgcat::mc "Creating %s"] ${archive.file}]"
- command_exec archive
- ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s packaged"] ${archive.file}]"
- }
- }
-
- return 0
-}
-
-proc portarchive::archive_finish {args} {
- global UI_PREFIX
- global portname portversion portrevision portvariants
- global destpath
-
- # Cleanup all control files when finished
- set control_files [glob -nocomplain -types f [file join $destpath +*]]
- foreach file $control_files {
- ui_debug "removing file: $file"
- file delete -force $file
- }
-
- if {[llength [option portarchivetype]] > 1} {
- ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
- } else {
- ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $portname $portversion $portrevision $portvariants]"
- }
- return 0
-}
-
Modified: branches/images-and-archives/base/src/port/port-help.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port-help.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port/port-help.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -11,10 +11,6 @@
Activate the given ports
}
-set porthelp(archive) {
-Archive the given ports
-}
-
set porthelp(build) {
Build the given ports
}
@@ -36,7 +32,6 @@
set porthelp(clean) {
Removes file associates with given ports
---archive Removes created archives
--dist Removes downloaded distfiles
--work Removes work directory (default)
--all Removes everything from above
Modified: branches/images-and-archives/base/src/port/port.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port/port.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -2971,7 +2971,6 @@
unload [list action_target [action_args_const ports]] \
distfiles [list action_target [action_args_const ports]] \
\
- archive [list action_target [action_args_const ports]] \
dmg [list action_target [action_args_const ports]] \
mdmg [list action_target [action_args_const ports]] \
dpkg [list action_target [action_args_const ports]] \
@@ -3035,7 +3034,7 @@
selfupdate {nosync}
uninstall {follow-dependents}
variants {index}
- clean {all archive dist work}
+ clean {all dist work}
mirror {new}
lint {nitpick}
select {list set show}
Modified: branches/images-and-archives/base/src/port1.0/portactivate.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portactivate.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port1.0/portactivate.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -40,7 +40,7 @@
target_runtype ${org.macports.activate} always
target_state ${org.macports.activate} no
target_provides ${org.macports.activate} activate
-target_requires ${org.macports.activate} main fetch extract checksum patch configure build destroot archive install
+target_requires ${org.macports.activate} main fetch extract checksum patch configure build destroot imagefile
namespace eval portactivate {
}
Modified: branches/images-and-archives/base/src/port1.0/portclean.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portclean.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port1.0/portclean.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -57,7 +57,7 @@
proc portclean::clean_main {args} {
global UI_PREFIX
- global ports_clean_dist ports_clean_work ports_clean_archive
+ global ports_clean_dist ports_clean_work
global ports_clean_all usealtworkpath
if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
@@ -66,14 +66,8 @@
clean_dist
}
if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
- [info exists ports_clean_archive] && $ports_clean_archive == "yes"} {
- ui_info "$UI_PREFIX [format [msgcat::mc "Removing archives for %s"] [option portname]]"
- clean_archive
- }
- if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
[info exists ports_clean_work] && $ports_clean_work == "yes" || \
- (!([info exists ports_clean_dist] && $ports_clean_dist == "yes") && \
- !([info exists ports_clean_archive] && $ports_clean_archive == "yes"))} {
+ (!([info exists ports_clean_dist] && $ports_clean_dist == "yes"))} {
ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option portname]]"
clean_work
}
@@ -199,54 +193,3 @@
return 0
}
-proc portclean::clean_archive {args} {
- global workpath portarchivepath portname portversion ports_version_glob
-
- # Define archive destination directory and target filename
- if {$portarchivepath ne $workpath && $portarchivepath ne ""} {
- set archivepath [file join $portarchivepath [option os.platform] [option os.arch]]
- }
-
- if {[info exists ports_version_glob]} {
- # Match all possible archive variatns that match the version
- # glob specified by the user for this OS.
- set fileglob "$portname-[option ports_version_glob]*.[option os.arch].*"
- } else {
- # Match all possible archive variants for the current version on
- # this OS. If you want to delete previous versions, use the
- # version glob argument to clean.
- #
- # We do this because if we don't, then ports that match the
- # first part of the name (e.g. trying to remove foo-*, it will
- # pick up anything foo-bar-* as well, which is undesirable).
- set fileglob "$portname-$portversion*.[option os.arch].*"
- }
-
- # Remove the archive files
- set count 0
- if {![catch {set archivelist [glob [file join $archivepath $fileglob]]} result]} {
- foreach path $archivelist {
- set file [file tail $path]
- # Make sure file is truly a port archive file, and not
- # and accidental match with some other file that might exist.
- if {[regexp "^$portname-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\][option os.arch]\[\.\]\[a-z\]+\$" $file]} {
- if {[file isfile $path]} {
- ui_debug "Removing archive: $path"
- if {[catch {delete $path} result]} {
- ui_debug "$::errorInfo"
- ui_error "$result"
- }
- set count [expr $count + 1]
- }
- }
- }
- }
- if {$count > 0} {
- ui_debug "$count archive(s) removed."
- } else {
- ui_debug "No archives found to remove at $archivepath"
- }
-
- return 0
-}
-
Modified: branches/images-and-archives/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portinstall.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port1.0/portinstall.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -36,163 +36,17 @@
set org.macports.install [target_new org.macports.install portinstall::install_main]
target_provides ${org.macports.install} install
-target_requires ${org.macports.install} main fetch extract checksum patch configure build destroot archive
-target_prerun ${org.macports.install} portinstall::install_start
+target_requires ${org.macports.install} main fetch extract checksum patch configure build destroot imagefile activate
namespace eval portinstall {
}
-# define options
-options install.asroot
-
-# Set defaults
-default install.asroot no
-
set_ui_prefix
-proc portinstall::install_start {args} {
- global UI_PREFIX portname portversion portrevision variations portvariants
- global install.asroot prefix
+proc portinstall::install_main {args} {
+ global UI_PREFIX portname portversion portrevision portvariants
ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
- # start gsoc08-privileges
- if { [tbool install.asroot] } {
- # if port is marked as needing root
- elevateToRoot "install"
- } elseif { ![file writable $prefix] } {
- # if install location is not writable, need root privileges to install
- elevateToRoot "install"
- }
- # end gsoc08-privileges
-}
-
-proc portinstall::install_element {src_element dst_element} {
- # don't recursively copy directories
- if {[file isdirectory $src_element] && [file type $src_element] != "link"} {
- file mkdir $dst_element
- } else {
- file copy -force $src_element $dst_element
- }
-
- # if the file is a symlink, do not try to set file attributes
- # if the destination file is an existing directory,
- # do not overwrite its file attributes
- if {[file type $src_element] != "link" || [file isdirectory $dst_element]} {
- set attributes [file attributes $src_element]
- for {set i 0} {$i < [llength $attributes]} {incr i} {
- set opt [lindex $attributes $i]
- incr i
- set arg [lindex $attributes $i]
- file attributes $dst_element $opt $arg
- # set mtime on installed element
- exec touch -r $src_element $dst_element
- }
- }
-}
-
-proc portinstall::directory_dig {rootdir workdir regref {cwd ""}} {
- global installPlist
- set pwd [pwd]
- if {[catch {_cd $workdir} err]} {
- puts $err
- return
- }
-
- foreach name [readdir .] {
- set element [file join $cwd $name]
-
- if {![info exists root]} {
- set root [file separator]
- }
-
- set imagedir [registry_prop_retr $regref imagedir]
- set root [file join $root $imagedir]
-
- set dst_element [file join $root $element]
- set src_element [file join $rootdir $element]
- # overwrites files but not directories
- if {![file exists $dst_element] || ![file isdirectory $dst_element]} {
- if {[file type $src_element] == "link"} {
- ui_debug "installing link: $dst_element"
- } elseif {[file isdirectory $src_element]} {
- ui_debug "installing directory: $dst_element"
- } else {
- ui_debug "installing file: $dst_element"
- }
- install_element $src_element $dst_element
- # only track files/links for registry, not directories
- if {[file type $dst_element] != "directory"} {
- lappend installPlist $dst_element
- }
- }
- if {[file isdirectory $name] && [file type $name] != "link"} {
- directory_dig $rootdir $name $regref [file join $cwd $name]
- }
- }
- _cd $pwd
-}
-
-proc portinstall::install_main {args} {
- global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
-
- # Begin the registry entry
- set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
-
- # Install the files
- directory_dig ${destroot} ${destroot} ${regref}
-
- registry_prop_store $regref categories $categories
-
- if {[info exists description]} {
- registry_prop_store $regref description [string map {\n \\n} ${description}]
- }
- if {[info exists long_description]} {
- registry_prop_store $regref long_description [string map {\n \\n} ${long_description}]
- }
- if {[info exists license]} {
- registry_prop_store $regref license ${license}
- }
- if {[info exists homepage]} {
- registry_prop_store $regref homepage ${homepage}
- }
- if {[info exists maintainers]} {
- registry_prop_store $regref maintainers ${maintainers}
- }
- if {[info exists depends_run]} {
- registry_prop_store $regref depends_run $depends_run
- registry_register_deps $depends_run $portname
- }
- if {[info exists depends_lib]} {
- registry_prop_store $regref depends_lib $depends_lib
- registry_register_deps $depends_lib $portname
- }
- if {[info exists installPlist]} {
- registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
- }
- if {[info exists package-install]} {
- registry_prop_store $regref package-install ${package-install}
- }
- if {[info proc pkg_uninstall] == "pkg_uninstall"} {
- registry_prop_store $regref uninstall [proc_disasm pkg_uninstall]
- }
-
- registry_write $regref
-
return 0
}
-proc portinstall::proc_disasm {pname} {
- set p "proc "
- append p $pname " \{"
- set space ""
- foreach arg [info args $pname] {
- if {[info default $pname $arg value]} {
- append p "$space{" [list $arg $value] "}"
- } else {
- append p $space $arg
- }
- set space " "
- }
- append p "\} \{" [info body $pname] "\}"
- return $p
-}
Modified: branches/images-and-archives/base/src/port1.0/portutil.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portutil.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/port1.0/portutil.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -1250,7 +1250,6 @@
# Enable the fence to prevent any creation/modification
# outside the sandbox.
if {$target != "activate"
- && $target != "archive"
&& $target != "fetch"
&& $target != "imagefile"
&& $target != "install"} {
@@ -1274,7 +1273,6 @@
destroot -
imagefile -
install -
- archive -
dmg -
pkg -
portpkg -
@@ -2182,73 +2180,6 @@
}
}
-# check if archive type is supported by current system
-# returns an error code if it is not
-proc archiveTypeIsSupported {type} {
- global os.platform os.version
- set errmsg ""
- switch -regex $type {
- cp(io|gz) {
- set pax "pax"
- if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
- if {[regexp {z$} $type]} {
- set gzip "gzip"
- if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
- return 0
- }
- } else {
- return 0
- }
- }
- }
- t(ar|bz|lz|xz|gz) {
- set tar "tar"
- if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
- if {[regexp {z2?$} $type]} {
- if {[regexp {bz2?$} $type]} {
- set gzip "bzip2"
- } elseif {[regexp {lz$} $type]} {
- set gzip "lzma"
- } elseif {[regexp {xz$} $type]} {
- set gzip "xz"
- } else {
- set gzip "gzip"
- }
- if {[info exists portutil::autoconf::${gzip}_path]} {
- set hint [set portutil::autoconf::${gzip}_path]
- } else {
- set hint ""
- }
- if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
- return 0
- }
- } else {
- return 0
- }
- }
- }
- xar {
- set xar "xar"
- if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
- return 0
- }
- }
- zip {
- set zip "zip"
- if {[catch {set zip [findBinary $zip ${portutil::autoconf::zip_path}]} errmsg] == 0} {
- set unzip "unzip"
- if {[catch {set unzip [findBinary $unzip ${portutil::autoconf::unzip_path}]} errmsg] == 0} {
- return 0
- }
- }
- }
- default {
- return -code error [format [msgcat::mc "Invalid port archive type '%s' specified!"] $type]
- }
- }
- return -code error [format [msgcat::mc "Unsupported port archive type '%s': %s"] $type $errmsg]
-}
-
#
# merge function for universal builds
#
Modified: branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/registry1.0/receipt_flat.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -130,11 +130,10 @@
regexp "^$name-(.*)\$" $theFileName match version
}
} else {
- # If version wasn't specified, find out the version number. This will
- # depend on which installtype mode we're in, "direct" or "image"
+ # If version wasn't specified, find out the version number.
if { $version == "" } {
- # xxx: If we're in image mode, we really should have had the
- # version given to us. How should we handle this?
+ # xxx: We really should have had the version given to us, how
+ # should we handle this?
set x [glob -nocomplain [file join ${receipt_path} *]]
if { [string length $x] } {
set v [lindex [file split [lindex $x 0]] end]
Modified: branches/images-and-archives/base/src/registry1.0/registry.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/registry.tcl 2009-05-27 05:53:33 UTC (rev 51514)
+++ branches/images-and-archives/base/src/registry1.0/registry.tcl 2009-05-27 05:55:07 UTC (rev 51515)
@@ -38,7 +38,7 @@
package require msgcat
package require Pextlib 1.0
-set UI_PREFIX "--> "
+set UI_PREFIX "---> "
namespace eval registry {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090526/d8be7c93/attachment-0001.html>
More information about the macports-changes
mailing list