[24670] branches/dp2mp-move/base/src/registry1.0
source_changes at macosforge.org
source_changes at macosforge.org
Sun Apr 29 13:40:50 PDT 2007
Revision: 24670
http://trac.macosforge.org/projects/macports/changeset/24670
Author: jmpp at macports.org
Date: 2007-04-29 13:40:50 -0700 (Sun, 29 Apr 2007)
Log Message:
-----------
Moving registry1.0 to the MacPorts namespace.
Modified Paths:
--------------
branches/dp2mp-move/base/src/registry1.0/portimage.tcl
branches/dp2mp-move/base/src/registry1.0/receipt_flat.tcl
branches/dp2mp-move/base/src/registry1.0/receipt_sqlite.tcl
branches/dp2mp-move/base/src/registry1.0/registry.tcl
Modified: branches/dp2mp-move/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/dp2mp-move/base/src/registry1.0/portimage.tcl 2007-04-29 20:40:16 UTC (rev 24669)
+++ branches/dp2mp-move/base/src/registry1.0/portimage.tcl 2007-04-29 20:40:50 UTC (rev 24670)
@@ -33,14 +33,14 @@
package provide portimage 1.0
package require registry 1.0
-package require darwinports 1.0
+package require macports 1.0
package require Pextlib 1.0
set UI_PREFIX "--> "
#
# Port Images are basically just installations of the destroot of a port into
-# ${darwinports::registry.path}/software/${name}/${version}_${revision}${variants}
+# ${macports::registry.path}/software/${name}/${version}_${revision}${variants}
# They allow the user to instal multiple versions of the same port, treating
# each revision and each different combination of variants as a "version".
#
@@ -69,7 +69,7 @@
# Activate a "Port Image"
proc activate {name v optionslist} {
- global darwinports::prefix darwinports::registry.path UI_PREFIX
+ global macports::prefix macports::registry.path UI_PREFIX
array set options $optionslist
variable force
@@ -303,7 +303,7 @@
proc _activate_contents {name imagefiles imagedir} {
variable force
- global darwinports::prefix
+ global macports::prefix
set files [list]
@@ -332,7 +332,7 @@
} elseif { [file exists $file] && $force != 1 } {
return -code error "Image error: $file already exists and does not belong to a registered port. Unable to activate port $name."
} elseif { $force == 1 && [file exists $file] || $port != 0 } {
- set bakfile ${file}.dp_[clock seconds]
+ set bakfile ${file}.mp_[clock seconds]
if {[file exists $file]} {
ui_warn "File $file already exists. Moving to: $bakfile."
Modified: branches/dp2mp-move/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/dp2mp-move/base/src/registry1.0/receipt_flat.tcl 2007-04-29 20:40:16 UTC (rev 24669)
+++ branches/dp2mp-move/base/src/registry1.0/receipt_flat.tcl 2007-04-29 20:40:50 UTC (rev 24670)
@@ -2,7 +2,7 @@
# $Id$
#
# Copyright (c) 2004 Will Barton <wbb4 at opendarwin.org>
-# Copyright (c) 2004 Paul Guyot, DarwinPorts Team.
+# Copyright (c) 2004 Paul Guyot, MacPorts Team.
# Copyright (c) 2002 Apple Computer, Inc.
# All rights reserved.
#
@@ -33,7 +33,7 @@
package provide receipt_flat 1.0
-package require darwinports 1.0
+package require macports 1.0
package require Pextlib 1.0
##
@@ -68,11 +68,11 @@
# portversion the version for this port, 0 if unknown.
# return the path to the file or "" if the file couldn't be found.
proc get_head_entry_receipt_path {portname portversion} {
- global darwinports::registry.path
+ global macports::registry.path
# regex match case
if {$portversion == 0} {
- set x [glob -nocomplain [file join ${darwinports::registry.path} receipts ${portname}-*]]
+ set x [glob -nocomplain [file join ${macports::registry.path} receipts ${portname}-*]]
if {[string length $x]} {
set matchfile [lindex $x 0]
# Remove trailing .bz2, if any.
@@ -81,7 +81,7 @@
set matchfile ""
}
} else {
- set matchfile [file join ${darwinports::registry.path} receipts ${portname}-${portversion}]
+ set matchfile [file join ${macports::registry.path} receipts ${portname}-${portversion}]
}
# Might as well bail out early if no file to match
@@ -99,10 +99,10 @@
#
# Open an existing entry and return its reference number.
proc open_entry {name {version 0} {revision 0} {variants ""}} {
- global darwinports::registry.installtype
- global darwinports::registry.path
+ global macports::registry.installtype
+ global macports::registry.path
- set receipt_path [file join ${darwinports::registry.path} receipts ${name}]
+ set receipt_path [file join ${macports::registry.path} receipts ${name}]
# If the receipt path ${name} doesn't exist, then the receipt probably is
# in the old HEAD format.
@@ -141,7 +141,7 @@
return -code error "Registry error: ${name} @${version}_${revision}${variants} not registered as installed."
}
- set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+ set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
set receipt_file [file join ${receipt_path} receipt]
}
@@ -170,7 +170,7 @@
convert_entry_from_HEAD $name $version $revision $variants $receipt_contents $ref
# move the old receipt
- set convertedDirPath [file join ${darwinports::registry.path} receipts_converted]
+ set convertedDirPath [file join ${macports::registry.path} receipts_converted]
file mkdir $convertedDirPath
file rename $receipt_file $convertedDirPath
} elseif {[string match "# Version: *" $receipt_contents]} {
@@ -296,12 +296,12 @@
# version the version of the port.
# variants the variants of the port.
proc write_entry {ref name version {revision 0} {variants ""}} {
- global darwinports::registry.installtype
+ global macports::registry.installtype
variable receipt_$ref
set receipt_contents [array get receipt_$ref]
- set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+ set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
set receipt_file [file join ${receipt_path} receipt]
if { ![file isdirectory ${receipt_path}] } {
@@ -330,12 +330,12 @@
# Check to see if an entry exists
proc entry_exists {name version {revision 0} {variants ""}} {
- global darwinports::registry.path
+ global macports::registry.path
variable receipt_handle
variable receipt_file
variable receipt_path
- set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+ set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
set receipt_file [file join ${receipt_path} receipt]
if { [file exists $receipt_file] } {
@@ -383,15 +383,15 @@
# Delete an entry
proc delete_entry {name version {revision 0} {variants ""}} {
- global darwinports::registry.path
+ global macports::registry.path
- set receipt_path [file join ${darwinports::registry.path} receipts ${name} ${version}_${revision}${variants}]
+ set receipt_path [file join ${macports::registry.path} receipts ${name} ${version}_${revision}${variants}]
if { [file exists ${receipt_path}] } {
# remove port receipt directory
ui_debug "deleting directory: ${receipt_path}"
file delete -force ${receipt_path}
# remove port receipt parent directory (if empty)
- set receipt_dir [file join ${darwinports::registry.path} receipts ${name}]
+ set receipt_dir [file join ${macports::registry.path} receipts ${name}]
if { [file isdirectory ${receipt_dir}] } {
# 0 item means empty.
if { [llength [readdir ${receipt_dir}]] == 0 } {
@@ -415,9 +415,9 @@
# Note: at some point we need to change these APIs and support something
# like selecting on the version or selecting variants in any order.
proc installed {{name ""} {version ""}} {
- global darwinports::registry.path
+ global macports::registry.path
- set query_path [file join ${darwinports::registry.path} receipts]
+ set query_path [file join ${macports::registry.path} receipts]
if { $name == "" } {
set query_path [file join ${query_path} *]
@@ -448,9 +448,9 @@
# append the ports in old HEAD format.
if { $name == "" } {
- set query_path [file join ${darwinports::registry.path} receipts *]
+ set query_path [file join ${macports::registry.path} receipts *]
} else {
- set query_path [file join ${darwinports::registry.path} receipts ${name}-*]
+ set query_path [file join ${macports::registry.path} receipts ${name}-*]
}
set receiptglob [glob -nocomplain -types f ${query_path}]
foreach receipt_file $receiptglob {
@@ -488,10 +488,10 @@
# convert from the old format if required.
#
proc open_file_map {{readonly 0}} {
- global darwinports::registry.path
+ global macports::registry.path
variable file_map
- set receipt_path [file join ${darwinports::registry.path} receipts]
+ set receipt_path [file join ${macports::registry.path} receipts]
set map_file [file join ${receipt_path} file_map]
# Don't reopen it (it actually would deadlock us), unless it was open r/o.
@@ -679,10 +679,10 @@
# Dependency Map Code
proc open_dep_map {args} {
- global darwinports::registry.path
+ global macports::registry.path
variable dep_map
- set receipt_path [file join ${darwinports::registry.path} receipts]
+ set receipt_path [file join ${macports::registry.path} receipts]
set map_file [file join ${receipt_path} dep_map]
@@ -747,10 +747,10 @@
}
proc write_dep_map {args} {
- global darwinports::registry.path
+ global macports::registry.path
variable dep_map
- set receipt_path [file join ${darwinports::registry.path} receipts]
+ set receipt_path [file join ${macports::registry.path} receipts]
set map_file [file join ${receipt_path} dep_map]
Modified: branches/dp2mp-move/base/src/registry1.0/receipt_sqlite.tcl
===================================================================
--- branches/dp2mp-move/base/src/registry1.0/receipt_sqlite.tcl 2007-04-29 20:40:16 UTC (rev 24669)
+++ branches/dp2mp-move/base/src/registry1.0/receipt_sqlite.tcl 2007-04-29 20:40:50 UTC (rev 24670)
@@ -32,7 +32,7 @@
package provide receipt_sqlite 1.0
-package require darwinports 1.0
+package require macports 1.0
##
# Receipts Code supporting flat-files
Modified: branches/dp2mp-move/base/src/registry1.0/registry.tcl
===================================================================
--- branches/dp2mp-move/base/src/registry1.0/registry.tcl 2007-04-29 20:40:16 UTC (rev 24669)
+++ branches/dp2mp-move/base/src/registry1.0/registry.tcl 2007-04-29 20:40:50 UTC (rev 24670)
@@ -31,7 +31,7 @@
package provide registry 1.0
-package require darwinports 1.0
+package require macports 1.0
package require receipt_flat 1.0
package require receipt_sqlite 1.0
package require portimage 1.0
@@ -43,14 +43,14 @@
# Begin creating a new registry entry for the port version_revision+variant
# This process assembles the directory name and creates a receipt dlist
proc new_entry {name version {revision 0} {variants ""} {epoch 0} } {
- global darwinports::registry.path darwinports::registry.format darwinports::registry.installtype darwinports::prefix
+ global macports::registry.path macports::registry.format macports::registry.installtype macports::prefix
# Make sure we don't already have an entry in the Registry for this
# port version_revision+variants
if {![entry_exists $name $version $revision $variants] } {
- set ref [${darwinports::registry.format}::new_entry]
+ set ref [${macports::registry.format}::new_entry]
property_store $ref name $name
property_store $ref version $version
@@ -60,10 +60,10 @@
# Trick to have a portable GMT-POSIX epoch-based time.
# (because we'll compare this with a file mtime).
property_store $ref date [expr [clock scan now -gmt true] - [clock scan "1970-1-1 00:00:00" -gmt true]]
- property_store $ref installtype ${darwinports::registry.installtype}
- property_store $ref receipt_f ${darwinports::registry.format}
- if { ${darwinports::registry.installtype} == "image" } {
- set imagedir [file join ${darwinports::registry.path} software ${name} ${version}_${revision}${variants}]
+ property_store $ref installtype ${macports::registry.installtype}
+ property_store $ref receipt_f ${macports::registry.format}
+ if { ${macports::registry.installtype} == "image" } {
+ set imagedir [file join ${macports::registry.path} software ${name} ${version}_${revision}${variants}]
property_store $ref imagedir $imagedir
property_store $ref active 0
property_store $ref compact 0
@@ -78,13 +78,13 @@
# Check to see if an entry exists in the registry. This is passed straight
# through to the receipts system
proc entry_exists {name version {revision 0} {variants ""}} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::entry_exists $name $version $revision $variants]
+ global macports::registry.format
+ return [${macports::registry.format}::entry_exists $name $version $revision $variants]
}
# Close the registry... basically wrap the receipts systems's write process
proc write_entry {ref} {
- global darwinports::registry.format
+ global macports::registry.format
set name [property_retrieve $ref name]
set version [property_retrieve $ref version]
@@ -93,49 +93,49 @@
set epoch [property_retrieve $ref epoch]
set contents [property_retrieve $ref contents]
- ${darwinports::registry.format}::write_entry $ref $name $version $revision $variants
+ ${macports::registry.format}::write_entry $ref $name $version $revision $variants
}
# Delete an entry from the registry.
proc delete_entry {ref} {
- global darwinports::registry.format
+ global macports::registry.format
set name [property_retrieve $ref name]
set version [property_retrieve $ref version]
set revision [property_retrieve $ref revision]
set variants [property_retrieve $ref variants]
- ${darwinports::registry.format}::delete_entry $name $version $revision $variants
+ ${macports::registry.format}::delete_entry $name $version $revision $variants
}
# Open a registry entry.
proc open_entry {name {version 0} {revision 0} {variants ""}} {
- global darwinports::registry.format
+ global macports::registry.format
- return [${darwinports::registry.format}::open_entry $name $version $revision $variants]
+ return [${macports::registry.format}::open_entry $name $version $revision $variants]
}
# Store a property with the open registry entry.
proc property_store {ref property value} {
- global darwinports::registry.format
- ${darwinports::registry.format}::property_store $ref $property $value
+ global macports::registry.format
+ ${macports::registry.format}::property_store $ref $property $value
}
# Retrieve a property from the open registry entry.
proc property_retrieve {ref property} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::property_retrieve $ref $property]
+ global macports::registry.format
+ return [${macports::registry.format}::property_retrieve $ref $property]
}
# If only one version of the port is installed, this process returns that
# version's parts. Otherwise, it lists the versions installed and exists.
proc installed {{name ""} {version ""}} {
- global darwinports::registry.format
+ global macports::registry.format
- set ilist [${darwinports::registry.format}::installed $name $version]
+ set ilist [${macports::registry.format}::installed $name $version]
set rlist [list]
if { [llength $ilist] > 1 } {
@@ -175,9 +175,9 @@
# Return a list with the active version of a port (or the active versions of
# all ports if name is "").
proc active {{name ""}} {
- global darwinports::registry.format
+ global macports::registry.format
- set ilist [${darwinports::registry.format}::installed $name]
+ set ilist [${macports::registry.format}::installed $name]
set rlist [list]
if { [llength $ilist] > 0 } {
@@ -231,41 +231,41 @@
# File Map Code
proc open_file_map {args} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::open_file_map $args]
+ global macports::registry.format
+ return [${macports::registry.format}::open_file_map $args]
}
proc file_registered {file} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::file_registered $file]
+ global macports::registry.format
+ return [${macports::registry.format}::file_registered $file]
}
proc port_registered {name} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::port_registered $name]
+ global macports::registry.format
+ return [${macports::registry.format}::port_registered $name]
}
proc register_file {file port} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::register_file $file $port]
+ global macports::registry.format
+ return [${macports::registry.format}::register_file $file $port]
}
proc register_bulk_files {files port} {
- global darwinports::registry.format
+ global macports::registry.format
open_file_map
- set r [${darwinports::registry.format}::register_bulk_files $files $port]
+ set macports::registry.format}::register_bulk_files $files $port]
write_file_map
return $r
}
proc unregister_file {file} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::unregister_file $file]
+ global macports::registry.format
+ return [${macports::registry.format}::unregister_file $file]
}
proc write_file_map {args} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::write_file_map $args]
+ global macports::registry.format
+ return [${macports::registry.format}::write_file_map $args]
}
# Dependency Map Code
@@ -292,8 +292,8 @@
}
proc open_dep_map {args} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::open_dep_map $args]
+ global macports::registry.format
+ return [${macports::registry.format}::open_dep_map $args]
}
##
@@ -350,29 +350,29 @@
# List all ports this one depends on
proc list_depends {name} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::list_depends $name]
+ global macports::registry.format
+ return [${macports::registry.format}::list_depends $name]
}
# List all the ports that depend on this port
proc list_dependents {name} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::list_dependents $name]
+ global macports::registry.format
+ return [${macports::registry.format}::list_dependents $name]
}
proc register_dep {dep type port} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::register_dep $dep $type $port]
+ global macports::registry.format
+ return [${macports::registry.format}::register_dep $dep $type $port]
}
proc unregister_dep {dep type port} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::unregister_dep $dep $type $port]
+ global macports::registry.format
+ return [${macports::registry.format}::unregister_dep $dep $type $port]
}
proc write_dep_map {args} {
- global darwinports::registry.format
- return [${darwinports::registry.format}::write_dep_map $args]
+ global macports::registry.format
+ return [${macports::registry.format}::write_dep_map $args]
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070429/49f06d83/attachment.html
More information about the macports-changes
mailing list