[103913] branches/new-help-system/base
raimue at macports.org
raimue at macports.org
Sat Mar 9 17:15:31 PST 2013
Revision: 103913
https://trac.macports.org/changeset/103913
Author: raimue at macports.org
Date: 2013-03-09 17:15:31 -0800 (Sat, 09 Mar 2013)
Log Message:
-----------
Merge from trunk
Modified Paths:
--------------
branches/new-help-system/base/ChangeLog
branches/new-help-system/base/LICENSE
branches/new-help-system/base/config/RELEASE_URL
branches/new-help-system/base/configure
branches/new-help-system/base/configure.ac
branches/new-help-system/base/doc/portfile.7
branches/new-help-system/base/m4/tcl.m4
branches/new-help-system/base/portmgr/dmg/License.html
branches/new-help-system/base/regen.sh
branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c
branches/new-help-system/base/src/macports1.0/macports.tcl
branches/new-help-system/base/src/macports1.0/macports_index.tcl
branches/new-help-system/base/src/package1.0/Makefile
branches/new-help-system/base/src/package1.0/package.tcl
branches/new-help-system/base/src/package1.0/portarchivefetch.tcl
branches/new-help-system/base/src/package1.0/portdmg.tcl
branches/new-help-system/base/src/package1.0/portmdmg.tcl
branches/new-help-system/base/src/package1.0/portmpkg.tcl
branches/new-help-system/base/src/package1.0/portpkg.tcl
branches/new-help-system/base/src/pextlib1.0/uid.c
branches/new-help-system/base/src/port/port-help.tcl
branches/new-help-system/base/src/port/port.tcl
branches/new-help-system/base/src/port1.0/Makefile
branches/new-help-system/base/src/port1.0/fetch_common.tcl
branches/new-help-system/base/src/port1.0/port.tcl
branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in
branches/new-help-system/base/src/port1.0/portbuild.tcl
branches/new-help-system/base/src/port1.0/portconfigure.tcl
branches/new-help-system/base/src/port1.0/portdestroot.tcl
branches/new-help-system/base/src/port1.0/portextract.tcl
branches/new-help-system/base/src/port1.0/portlint.tcl
branches/new-help-system/base/src/port1.0/portload.tcl
branches/new-help-system/base/src/port1.0/portunload.tcl
branches/new-help-system/base/src/port1.0/portutil.tcl
Removed Paths:
-------------
branches/new-help-system/base/src/package1.0/portportpkg.tcl
branches/new-help-system/base/src/port1.0/portsubmit.tcl
branches/new-help-system/base/src/portindex/
Property Changed:
----------------
branches/new-help-system/base/
Property changes on: branches/new-help-system/base
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/gsoc11-rev-upgrade/base:78828-88375
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:49341-101106
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
+ /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/gsoc11-rev-upgrade/base:78828-88375
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:49341-103912
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
Modified: branches/new-help-system/base/ChangeLog
===================================================================
--- branches/new-help-system/base/ChangeLog 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/ChangeLog 2013-03-10 01:15:31 UTC (rev 103913)
@@ -4,6 +4,12 @@
###
Release 2.2.0 (unreleased)
+ - Remove unimplemented 'port submit'.
+ (cal in r103400)
+
+ - Add 'port space --total' which displays the grand total only.
+ (raimue in r102248)
+
- Added 'subport:' pseudo-portname that expands to ports that provide
a matching subport; added 'subportof:' pseudo-portname that expands to
the list of subports of the given port name
@@ -13,7 +19,11 @@
the number of builds trace mode breaks.
(cal in r100071-100073, r100077, r100126, r100221)
-Release 2.1.3 (unreleased)
+ - Began using sandbox-exec(1) on 10.5+ to prevent commands executed using
+ the 'system' procedure from writing files outside of the build directory
+ and selected other locations like /tmp. (jmr in r98156, r98193, etc.)
+
+Release 2.1.3 (2013-01-31 by jmr)
- Fixed a bug where a certain order of starting and aborting a build,
running selfupdate and continuing a build would resume building although
it should start from the beginning.
@@ -23,9 +33,10 @@
ccache >= 3.1.7 by running the initialization step as the macportsuser.
(raimue in r97868)
- - Fix an endless loop that could be triggered in rev-upgrade when a user
- hasn't run selfupdate in more than a year or the portindex is corrupt.
- (cal in r100129)
+ - Fix an endless loop that could be triggered in rev-upgrade when a broken
+ port is not in the index, e.g. when it has been deleted from the tree,
+ or it was installed directly from a Portfile not in the tree.
+ (cal in r100129, jmr in r101313)
- Set a busy timeout on SQLite connections to prevent MacPorts from
uselessly burning CPU cycles when waiting for a database lock.
@@ -37,8 +48,26 @@
- Fix a problem where interrupting the uninstallation process could leave
the registry database in a corrupted state.
- (cal in r100219)
+ (#34482, cal in r100219)
+ - Fixed a failure in the fallback code used by 'port pkg' when
+ PackageMaker is not installed. (#36597, jmr in r96262)
+
+ - Fixed an incorrect lint error about the port directory name when a full
+ @macports.org maintainer address is used. (#35925, ryandesign in r97264)
+
+ - Fixed creation of disk images with flat packages. (jmr in r99167)
+
+ - Fixed a bug where not all requested variants would be passed on to
+ dependencies when building an mpkg. (#36363, jmr in r100679)
+
+ - Added configure.compiler options macports-clang-3.2 and
+ macports-clang-3.3 (jeremyhu, ryandesign, jmr in r92588, r101163,
+ r101166, r101270)
+
+ - Added configure.compiler options macports-dragonegg-3.0 through
+ macports-dragonegg-3.3. (jeremyhu in r101933)
+
Release 2.1.2 (2012-07-26 by jmr):
- Fixed autodetection of developer_dir with Xcode 4.4
(#35150, mfeiri in r95552)
Modified: branches/new-help-system/base/LICENSE
===================================================================
--- branches/new-help-system/base/LICENSE 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/LICENSE 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,5 +1,5 @@
Copyright (c) 2002 - 2003, Apple Inc.
-Copyright (c) 2004 - 2012, The MacPorts Project.
+Copyright (c) 2004 - 2013, The MacPorts Project.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Modified: branches/new-help-system/base/config/RELEASE_URL
===================================================================
--- branches/new-help-system/base/config/RELEASE_URL 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/config/RELEASE_URL 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1 +1 @@
-https://svn.macports.org/repository/macports/tags/release_2_1_2/base
+https://svn.macports.org/repository/macports/tags/release_2_1_3/base
Modified: branches/new-help-system/base/configure
===================================================================
--- branches/new-help-system/base/configure 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/configure 2013-03-10 01:15:31 UTC (rev 103913)
@@ -733,6 +733,7 @@
GNUPATCH
GNUMAKE
GIT
+FIND
FILE
DSEDITGROUP
DSCL
@@ -2954,13 +2955,13 @@
as_fn_error $? "This version of Mac OS X is not supported
Please upgrade at http://store.apple.com/" "$LINENO" 5
;;
- 10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-7]|10.7.[0-2])
+ 10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-7]|10.7.[0-4]|10.8.[0-1])
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This version of Mac OS X is out of date" >&5
$as_echo "$as_me: WARNING: This version of Mac OS X is out of date" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please run Software Update to update it" >&5
$as_echo "$as_me: WARNING: Please run Software Update to update it" >&2;}
;;
- 10.4*|10.5*|10.6*|10.7*)
+ 10.4*|10.5*|10.6*|10.7*|10.8*)
;;
*)
;;
@@ -4646,6 +4647,46 @@
fi
+# Extract the first word of "find", so it can be a program name with args.
+set dummy find; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_FIND+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $FIND in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_FIND="$FIND" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+FIND=$ac_cv_path_FIND
+if test -n "$FIND"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5
+$as_echo "$FIND" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "git", so it can be a program name with args.
set dummy git; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9240,8 +9281,10 @@
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.4 2>/dev/null` \
+ `ls -d /usr/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/lib/tcl8.5 2>/dev/null` \
`ls -d /usr/lib/tcl8.4 2>/dev/null` \
; do
Modified: branches/new-help-system/base/configure.ac
===================================================================
--- branches/new-help-system/base/configure.ac 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/configure.ac 2013-03-10 01:15:31 UTC (rev 103913)
@@ -32,11 +32,11 @@
AC_MSG_ERROR([This version of Mac OS X is not supported
Please upgrade at http://store.apple.com/])
;;
- 10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]]|10.7.[[0-2]])
+ 10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]]|10.7.[[0-4]]|10.8.[[0-1]])
AC_MSG_WARN([This version of Mac OS X is out of date])
AC_MSG_WARN([Please run Software Update to update it])
;;
- 10.4*|10.5*|10.6*|10.7*)
+ 10.4*|10.5*|10.6*|10.7*|10.8*)
dnl Supported version
;;
*)
@@ -111,6 +111,7 @@
AC_PATH_PROG(DSCL, [dscl], [])
AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [])
AC_PATH_PROG(FILE, [file], [])
+AC_PATH_PROG(FIND, [find], [])
AC_PATH_PROG(GIT, [git], [])
AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [], [$PATH:/usr/local/bin])
@@ -346,7 +347,6 @@
SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
AC_SUBST(INCLUDES)
-AC_SUBST(PATHCONF)
AC_SUBST(STLIB_LD)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_CFLAGS)
Modified: branches/new-help-system/base/doc/portfile.7
===================================================================
--- branches/new-help-system/base/doc/portfile.7 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/doc/portfile.7 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,6 +1,6 @@
.\" portfile.7
.\"
-.\" Copyright (c) 2004-2011 The MacPorts Project
+.\" Copyright (c) 2004-2013 The MacPorts Project
.\" Copyright (c) 2002-2003 Apple Inc.
.\" All rights reserved.
.\"
@@ -1110,7 +1110,7 @@
.Em optional
.br
.Sy Default:
-.Em -O2
+.Em -Os
.br
.Sy Example:
.Dl configure.optflags -O3
Modified: branches/new-help-system/base/m4/tcl.m4
===================================================================
--- branches/new-help-system/base/m4/tcl.m4 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/m4/tcl.m4 2013-03-10 01:15:31 UTC (rev 103913)
@@ -110,8 +110,10 @@
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.4 2>/dev/null` \
+ `ls -d /usr/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/lib/tcl8.5 2>/dev/null` \
`ls -d /usr/lib/tcl8.4 2>/dev/null` \
; do
Modified: branches/new-help-system/base/portmgr/dmg/License.html
===================================================================
--- branches/new-help-system/base/portmgr/dmg/License.html 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/portmgr/dmg/License.html 2013-03-10 01:15:31 UTC (rev 103913)
@@ -15,7 +15,7 @@
<body>
- <p>Copyright (c) 2002 - 2003, Apple Inc.<br>Copyright (c) 2004 - 2012, The MacPorts Project.</p>
+ <p>Copyright (c) 2002 - 2003, Apple Inc.<br>Copyright (c) 2004 - 2013, The MacPorts Project.</p>
<p>All rights reserved.</p>
<p><br></p>
Modified: branches/new-help-system/base/regen.sh
===================================================================
--- branches/new-help-system/base/regen.sh 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/regen.sh 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,4 +1,4 @@
#!/bin/sh
-autoconf --warnings=all
-autoheader --warnings=all
+autoconf --warnings=all --force
+autoheader --warnings=all --force
Modified: branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/darwintracelib1.0/darwintrace.c 2013-03-10 01:15:31 UTC (rev 103913)
@@ -140,7 +140,7 @@
void __darwintrace_copy_env() __attribute__((constructor));
inline char* __darwintrace_alloc_env(const char* varName, const char* varValue);
inline char* const* __darwintrace_restore_env(char* const envp[]);
-inline void __darwintrace_setup();
+static inline void __darwintrace_setup();
inline void __darwintrace_cleanup_path(char *path);
static char * exchange_with_port(const char * buf, size_t len, int answer);
@@ -341,7 +341,7 @@
}
__attribute__((always_inline))
-inline void __darwintrace_setup() {
+static inline void __darwintrace_setup() {
#define open(x,y,z) syscall(SYS_open, (x), (y), (z))
#define close(x) syscall(SYS_close, (x))
pid_t oldpid = __darwintrace_pid;
Modified: branches/new-help-system/base/src/macports1.0/macports.tcl
===================================================================
--- branches/new-help-system/base/src/macports1.0/macports.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/macports1.0/macports.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -45,23 +45,23 @@
portarchivetype portautoclean \
porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
rsync_dir startupitem_type startupitem_install place_worksymlink xcodeversion xcodebuildcmd \
- mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
+ configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
master_site_local patch_site_local archive_site_local buildfromsource \
revupgrade_autorun revupgrade_mode revupgrade_check_id_loadcmds \
host_blacklist preferred_hosts\
- packagemaker_path default_compiler"
- variable user_options "submitter_name submitter_email submitter_key"
+ packagemaker_path default_compilers"
+ variable user_options ""
variable portinterp_options "\
portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
registry.path registry.format user_home \
portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
rsync_server rsync_options rsync_dir startupitem_type startupitem_install place_worksymlink macportsuser \
- mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
+ configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target \
- packagemaker_path default_compiler $user_options"
+ packagemaker_path default_compilers $user_options"
# deferred options are only computed when needed.
# they are not exported to the trace thread.
@@ -887,14 +887,6 @@
set macports::place_worksymlink yes
}
- # Default mp remote options
- if {![info exists macports::mp_remote_url]} {
- set macports::mp_remote_url "http://db.macports.org"
- }
- if {![info exists macports::mp_remote_submit_url]} {
- set macports::mp_remote_submit_url "${macports::mp_remote_url}/submit"
- }
-
# Default mp configure options
if {![info exists macports::configureccache]} {
set macports::configureccache no
@@ -1291,6 +1283,7 @@
$workername alias registry_active registry::active
$workername alias registry_file_registered registry::file_registered
$workername alias registry_port_registered registry::port_registered
+ $workername alias registry_list_depends registry::list_depends
# deferred options processing.
$workername alias getoption macports::getoption
@@ -1616,6 +1609,8 @@
error "Error evaluating variants"
}
+ $workername eval port::run_callbacks
+
ditem_key $mport provides [$workername eval return \$subport]
return $mport
@@ -1730,6 +1725,10 @@
break
}
}
+
+ if {$found} {
+ break
+ }
}
if {$return_match} {
if {$found} {
@@ -4176,9 +4175,9 @@
set broken_files {};
set binaries [registry::file search active 1 binary 1]
- ui_msg -nonewline "$macports::ui_prefix Scanning binaries for linking errors"
set binary_count [llength $binaries]
if {$binary_count > 0} {
+ ui_msg -nonewline "$macports::ui_prefix Scanning binaries for linking errors"
set handle [machista::create_handle]
if {$handle == "NULL"} {
error "Error creating libmachista handle"
@@ -4363,23 +4362,35 @@
}
set broken_ports [lsort -unique $broken_ports]
- set temp_broken_ports $broken_ports
- set broken_ports {}
-
- foreach port $temp_broken_ports {
- set portname [$port name]
+ if {${macports::revupgrade_mode} == "rebuild"} {
# don't try to rebuild ports that don't exist in the tree
- if {${macports::revupgrade_mode} == "rebuild"} {
+ set temp_broken_ports {}
+ foreach port $broken_ports {
+ set portname [$port name]
if {[catch {mportlookup $portname} result]} {
ui_debug "$::errorInfo"
error "lookup of portname $portname failed: $result"
}
- if {[llength $result] < 2} {
+ if {[llength $result] >= 2} {
+ lappend temp_broken_ports $port
+ } else {
ui_warn "No port $portname found in the index; can't rebuild"
- ui_warn "Either your portindex is corrupt or $portname has been removed; consider uninstalling it."
- error "Port $portname not found in index"
}
}
+
+ if {[llength $temp_broken_ports] == 0} {
+ ui_msg "$macports::ui_prefix Broken files found, but all associated ports are not in the index and so cannot be rebuilt."
+ return 0
+ }
+ } else {
+ set temp_broken_ports $broken_ports
+ }
+
+ set broken_ports {}
+
+ foreach port $temp_broken_ports {
+ set portname [$port name]
+
if {![info exists broken_port_counts($portname)]} {
set broken_port_counts($portname) 0
}
Modified: branches/new-help-system/base/src/macports1.0/macports_index.tcl
===================================================================
--- branches/new-help-system/base/src/macports1.0/macports_index.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/macports1.0/macports_index.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -278,8 +278,7 @@
# Checks for a locally cached copy of the port, or downloads the port
# from the specified URL. The port is extracted into the current working
# directory along with a .mports_source file containing the url of the
-# source the port came from. (This can be later used as a default for
-# "port submit")
+# source the port came from.
#
# The cached portfiles are in the same directory as the cached remote index.
#
Modified: branches/new-help-system/base/src/package1.0/Makefile
===================================================================
--- branches/new-help-system/base/src/package1.0/Makefile 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/Makefile 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,6 +1,6 @@
INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/package1.0
-SRCS= package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl portportpkg.tcl \
+SRCS= package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl \
portrpm.tcl portsrpm.tcl portdpkg.tcl portunarchive.tcl \
portarchivefetch.tcl
Modified: branches/new-help-system/base/src/package1.0/package.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/package.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/package.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -40,6 +40,5 @@
package require portdmg 1.0
package require portmdmg 1.0
package require portdpkg 1.0
-package require portportpkg 1.0
package require portarchivefetch 1.0
package require portunarchive 1.0
Modified: branches/new-help-system/base/src/package1.0/portarchivefetch.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portarchivefetch.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portarchivefetch.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -209,6 +209,7 @@
ui_error [format [msgcat::mc "No defined site for tag: %s, using archive_sites"] $url_var]
set urlmap($url_var) $urlmap(archive_sites)
}
+ set failed_sites 0
unset -nocomplain fetched
foreach site $urlmap($url_var) {
if {[string index $site end] != "/"} {
@@ -226,6 +227,10 @@
} else {
ui_debug "[msgcat::mc "Fetching archive failed:"]: $result"
file delete -force "${incoming_path}/${archive}.TMP"
+ incr failed_sites
+ if {$failed_sites > 2 && ![tbool ports_binary_only] && ![_archive_available]} {
+ break
+ }
}
}
if {[info exists fetched]} {
@@ -248,14 +253,16 @@
ui_debug "openssl output: $result"
}
}
+ file delete -force $signature
if {!$verified} {
- return -code error "Failed to verify signature for archive!"
- }
- if {[catch {file rename -force "${incoming_path}/${archive}.TMP" "${archivefetch.fulldestpath}/${archive}"} result]} {
+ # fall back to building from source (or error out later if binary only mode)
+ ui_warn "Failed to verify signature for archive!"
+ file delete -force "${incoming_path}/${archive}.TMP"
+ break
+ } elseif {[catch {file rename -force "${incoming_path}/${archive}.TMP" "${archivefetch.fulldestpath}/${archive}"} result]} {
ui_debug "$::errorInfo"
return -code error "Failed to move downloaded archive into place: $result"
}
- file delete -force $signature
set archive_exists 1
break
}
Modified: branches/new-help-system/base/src/package1.0/portdmg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portdmg.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portdmg.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -50,7 +50,7 @@
ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${subport} ${version}]"
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
}
return [package_dmg $subport $version $revision]
Modified: branches/new-help-system/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portmdmg.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portmdmg.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -45,18 +45,18 @@
set_ui_prefix
proc portmdmg::mdmg_main {args} {
- global subport version revision package.destpath UI_PREFIX
+ global subport epoch version revision package.destpath UI_PREFIX
ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${subport} ${version}]"
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
}
- return [package_mdmg $subport $version $revision]
+ return [package_mdmg $subport $epoch $version $revision]
}
-proc portmdmg::package_mdmg {portname portversion portrevision} {
+proc portmdmg::package_mdmg {portname portepoch portversion portrevision} {
global UI_PREFIX package.destpath portpath
global os.platform os.arch os.version os.major
@@ -68,7 +68,7 @@
set tmp_image ${package.destpath}/${imagename}.tmp.dmg
set final_image ${package.destpath}/${imagename}.dmg
- set mpkgpath ${package.destpath}/${portname}-${portversion}.mpkg
+ set mpkgpath [portmpkg::mpkg_path $portname $portepoch $portversion $portrevision]
if {[file readable $final_image] && ([file mtime ${final_image}] >= [file mtime ${portpath}/Portfile])} {
ui_msg "$UI_PREFIX [format [msgcat::mc "Disk Image for %s-%s is up-to-date"] ${portname} ${portversion}]"
Modified: branches/new-help-system/base/src/package1.0/portmpkg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portmpkg.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portmpkg.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -48,14 +48,14 @@
set_ui_prefix
proc portmpkg::mpkg_main {args} {
- global subport version revision os.major package.destpath package.flat UI_PREFIX
+ global subport epoch version revision os.major package.destpath package.flat UI_PREFIX
if {!${package.flat} || ${os.major} < 10} {
# Make sure the destination path exists.
file mkdir ${package.destpath}
}
- return [package_mpkg $subport $version $revision]
+ return [package_mpkg $subport $epoch $version $revision]
}
proc portmpkg::make_dependency_list {portname destination} {
@@ -69,7 +69,7 @@
array set portinfo [lindex $res 1]
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
set deprivileged 1
}
@@ -96,13 +96,13 @@
}
}
- lappend result [list $portinfo(name) $portinfo(version) $portinfo(revision) $mport]
+ lappend result [list $portinfo(name) $portinfo(epoch) $portinfo(version) $portinfo(revision) $mport]
return $result
}
proc portmpkg::make_one_package {portname mport} {
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
set deprivileged 1
}
@@ -120,17 +120,43 @@
}
}
-proc portmpkg::package_mpkg {portname portversion portrevision} {
+proc portmpkg::epoch_namestr {portepoch} {
+ set portepoch_namestr ""
+ if {${portepoch} != "0"} {
+ set portepoch_namestr "${portepoch}_"
+ }
+ return ${portepoch_namestr}
+}
+
+proc portmpkg::revision_namestr {portrevision} {
+ set portrevision_namestr ""
+ if {${portrevision} != "0"} {
+ set portrevision_namestr "_${portrevision}"
+ }
+ return ${portrevision_namestr}
+}
+
+proc portmpkg::mpkg_path {portname portepoch portversion portrevision} {
+ global package.destpath
+ set portepoch_namestr [portmpkg::epoch_namestr ${portepoch}]
+ set portrevision_namestr [portmpkg::revision_namestr ${portrevision}]
+ set mpkgpath ${package.destpath}/${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}.mpkg
+ return $mpkgpath
+}
+
+proc portmpkg::package_mpkg {portname portepoch portversion portrevision} {
global portdbpath os.major destpath workpath prefix porturl description package.destpath package.flat long_description homepage depends_run depends_lib
- set mpkgpath ${package.destpath}/${portname}-${portversion}_${portrevision}.mpkg
+ set mpkgpath [portmpkg::mpkg_path $portname $portepoch $portversion $portrevision]
+ set portepoch_namestr [portmpkg::epoch_namestr ${portepoch}]
+ set portrevision_namestr [portmpkg::revision_namestr ${portrevision}]
if {${package.flat} && ${os.major} >= 10} {
- set pkgpath ${package.destpath}/${portname}-${portversion}_${portrevision}-component.pkg
+ set pkgpath ${package.destpath}/${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}-component.pkg
set packages_path ${workpath}/mpkg_packages
set resources_path ${workpath}/mpkg_resources
} else {
- set pkgpath ${package.destpath}/${portname}-${portversion}_${portrevision}.pkg
+ set pkgpath ${package.destpath}/${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}.pkg
set packages_path ${mpkgpath}/Contents/Packages
set resources_path ${mpkgpath}/Contents/Resources
}
@@ -143,23 +169,32 @@
set deps [lsort -unique $deps]
foreach dep $deps {
set name [lindex $dep 0]
- set vers [lindex $dep 1]
- set rev [lindex $dep 2]
- set mport [lindex $dep 3]
+ set epoch [lindex $dep 1]
+ set epoch_namestr ""
+ if {$epoch != "0"} {
+ set epoch_namestr "${epoch}_"
+ }
+ set vers [lindex $dep 2]
+ set rev [lindex $dep 3]
+ set rev_namestr ""
+ if {$rev != "0"} {
+ set rev_namestr "_${rev}"
+ }
+ set mport [lindex $dep 4]
# don't re-package ourself
if {$name != $portname} {
make_one_package $name $mport
if {${package.flat} && ${os.major} >= 10} {
- lappend dependencies org.macports.${name} ${name}-${vers}_${rev}-component.pkg
+ lappend dependencies org.macports.${name} ${name}-${epoch_namestr}${vers}${rev_namestr}-component.pkg
} else {
- lappend dependencies ${name}-${vers}_${rev}.pkg
+ lappend dependencies ${name}-${epoch_namestr}${vers}${rev_namestr}.pkg
}
}
}
if {${package.flat} && ${os.major} >= 10} {
- lappend dependencies org.macports.${portname} ${portname}-${portversion}_${portrevision}-component.pkg
+ lappend dependencies org.macports.${portname} ${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}-component.pkg
} else {
- lappend dependencies ${portname}-${portversion}_${portrevision}.pkg
+ lappend dependencies ${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}.pkg
}
# copy our own pkg into the mpkg
@@ -179,13 +214,14 @@
set pkg_$variable [set $variable]
}
}
- portpkg::write_welcome_html ${resources_path}/Welcome.html $portname $portversion $portrevision $pkg_long_description $pkg_description $pkg_homepage
+ portpkg::write_welcome_html ${resources_path}/Welcome.html $portname $portepoch $portversion $portrevision $pkg_long_description $pkg_description $pkg_homepage
file copy -force -- [getportresourcepath $porturl "port1.0/package/background.tiff"] ${resources_path}/background.tiff
if {${package.flat} && ${os.major} >= 10} {
write_distribution ${workpath}/Distribution $portname $dependencies
set productbuild [findBinary productbuild]
- set cmdline "$productbuild --resources ${resources_path} --identifier org.macports.mpkg.${portname} --distribution ${workpath}/Distribution --package-path ${packages_path} --version ${portversion}.${portrevision} ${mpkgpath}"
+ set v [portpkg::mp_version_to_apple_version $portepoch $portversion $portrevision]
+ set cmdline "$productbuild --resources ${resources_path} --identifier org.macports.mpkg.${portname} --distribution ${workpath}/Distribution --package-path ${packages_path} --version ${v} ${mpkgpath}"
ui_debug "Running command line: $cmdline"
system $cmdline
}
Modified: branches/new-help-system/base/src/package1.0/portpkg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portpkg.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portpkg.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -59,7 +59,7 @@
global packagemaker_path portpkg::packagemaker \
portpkg::language xcodeversion portpath porturl \
package.resources package.scripts package.flat \
- subport version revision description long_description \
+ subport epoch version revision description long_description \
homepage workpath os.major
if {![info exists packagemaker_path]} {
@@ -88,34 +88,43 @@
set pkg_$variable [set $variable]
}
}
- write_welcome_html ${package.resources}/${language}.lproj/Welcome.html $subport $version $revision $pkg_long_description $pkg_description $pkg_homepage
+ write_welcome_html ${package.resources}/${language}.lproj/Welcome.html $subport $epoch $version $revision $pkg_long_description $pkg_description $pkg_homepage
file copy -force -- [getportresourcepath $porturl "port1.0/package/background.tiff"] ${package.resources}/${language}.lproj/background.tiff
if {${package.flat} && ${os.major} >= 9} {
- write_distribution "${workpath}/Distribution" $subport $version $revision
+ write_distribution "${workpath}/Distribution" $subport $epoch $version $revision
}
}
proc portpkg::pkg_main {args} {
- global subport version revision UI_PREFIX
+ global subport epoch version revision UI_PREFIX
- ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s_%s"] ${subport} ${version} ${revision}]"
+ ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s_%s_%s"] ${subport} ${epoch} ${version} ${revision}]"
if {[getuid] == 0 && [geteuid] != 0} {
elevateToRoot "pkg"
}
- return [package_pkg $subport $version $revision]
+ return [package_pkg $subport $epoch $version $revision]
}
-proc portpkg::package_pkg {portname portversion portrevision} {
+proc portpkg::package_pkg {portname portepoch portversion portrevision} {
global UI_PREFIX portdbpath destpath workpath prefix description \
package.flat package.destpath portpath os.version os.major \
package.resources package.scripts portpkg::packagemaker portpkg::language
- set pkgpath "${package.destpath}/${portname}-${portversion}_${portrevision}.pkg"
+ set portepoch_namestr ""
+ if {${portepoch} != "0"} {
+ set portepoch_namestr "${portepoch}_"
+ }
+ set portrevision_namestr ""
+ if {${portrevision} != "0"} {
+ set portrevision_namestr "_${portrevision}"
+ }
+
+ set pkgpath "${package.destpath}/${portname}-${portepoch_namestr}${portversion}${portrevision_namestr}.pkg"
if {[file readable $pkgpath] && ([file mtime ${pkgpath}] >= [file mtime ${portpath}/Portfile])} {
- ui_msg "$UI_PREFIX [format [msgcat::mc "Package for %s-%s_%s is up-to-date"] ${portname} ${portversion} ${portrevision}]"
+ ui_msg "$UI_PREFIX [format [msgcat::mc "Package for %s-%s_%s_%s is up-to-date"] ${portname} ${portepoch} ${portversion} ${portrevision}]"
return 0
}
@@ -145,7 +154,8 @@
}
set cmdline "PMResourceLocale=${language} $packagemaker --root ${destpath} --out ${pkgpath} ${pkgresources} --info $infofile --target $pkgtarget --domain system --id org.macports.$portname"
if {${os.major} >= 10} {
- append cmdline " --version ${portversion}.${portrevision}"
+ set v [mp_version_to_apple_version $portepoch $portversion $portrevision]
+ append cmdline " --version $v"
append cmdline " --no-relocate"
} else {
# 10.5 Leopard does not use current language, manually specify
@@ -291,15 +301,28 @@
close $infofd
}
-proc portpkg::write_welcome_html {filename portname portversion portrevision long_description description homepage} {
+proc portpkg::write_welcome_html {filename portname portepoch portversion portrevision long_description description homepage} {
set fd [open ${filename} w+]
if {$long_description == ""} {
set long_description $description
}
set portname [xml_escape $portname]
+ if {$portepoch != "0"} {
+ set portepoch [xml_escape $portepoch]
+ set portepoch_str "${portepoch}_"
+ } else {
+ set portepoch ""
+ set portepoch_str ""
+ }
set portversion [xml_escape $portversion]
- set portrevision [xml_escape $portrevision]
+ if {$portrevision != "0"} {
+ set portrevision [xml_escape $portrevision]
+ set portrevision_str "_${portrevision}"
+ } else {
+ set portrevision ""
+ set portrevision_str ""
+ }
set long_description [xml_escape $long_description]
set description [xml_escape $description]
set homepage [xml_escape $homepage]
@@ -320,7 +343,7 @@
puts $fd "<font face=\"Helvetica\"><a href=\"${homepage}\">${homepage}</a></font><p>"
}
- puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion}_${portrevision} for Mac OS X. To get started, click Continue.</font>
+ puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portepoch_str}${portversion}${portrevision_str} for Mac OS X. To get started, click Continue.</font>
</body>
</html>"
@@ -362,10 +385,24 @@
close $infofd
}
-proc portpkg::write_distribution {dfile portname portversion portrevision} {
+proc portpkg::write_distribution {dfile portname portepoch portversion portrevision} {
global macosx_deployment_target
set portname [xml_escape $portname]
+ if {$portepoch != "0"} {
+ set portepoch [xml_escape $portepoch]
+ set portepoch_str "${portepoch}_"
+ } else {
+ set portepoch ""
+ set portepoch_str ""
+ }
set portversion [xml_escape $portversion]
+ if {$portrevision != "0"} {
+ set portrevision [xml_escape $portrevision]
+ set portrevision_str "_${portrevision}"
+ } else {
+ set portrevision ""
+ set portrevision_str ""
+ }
set dfd [open $dfile w+]
puts $dfd "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<installer-gui-script minSpecVersion=\"1\">
@@ -383,8 +420,98 @@
<choice id=\"org.macports.${portname}\" visible=\"false\">
<pkg-ref id=\"org.macports.${portname}\"/>
</choice>
- <pkg-ref id=\"org.macports.${portname}\">${portname}-${portversion}_${portrevision}-component.pkg</pkg-ref>
+ <pkg-ref id=\"org.macports.${portname}\">${portname}-${portepoch_str}${portversion}${portrevision_str}-component.pkg</pkg-ref>
</installer-gui-script>
"
close $dfd
}
+
+# To create Apple packages, Apple version numbers consist of three
+# period separated integers [1][2]. Munki supports any number of
+# integers [3], so incorporate the port epoch, version and revision
+# numbers in the Apple package version number so that Munki can do
+# upgrades. The Apple package number consists of the port epoch
+# number followed by the port version number followed by the port
+# revision number.
+#
+# Munki also requires that version numbers only consist of integers
+# and periods. So replace all non-periods and non-digits in the
+# version number with periods so that any digits following the
+# non-digits can properly version the package.
+#
+# There is an edge case when upstream releases a new version which
+# adds an additional integer to its version number and the Portfile's
+# revision number is reset to 0. For example, aspell epoch 0,
+# upstream 0.60.6, revision 4 was updated to epoch 0, upstream
+# 0.60.6.1, revision 0, which maps to 0.60.6.4 and 0.60.6.1.0
+# respectively, but the new Apple package version number is less than
+# the old one. To handle this, all upstream version numbers are
+# mapped to seven period separated integers, appending 0 as necessary.
+# Six was the largest number of integers in all upstream version
+# numbers as of January 2013 [4], so add one to make space for
+# trailing [a-zA-Z] in the upstream version number. This generates a
+# fixed format version number that will correctly upgrade the package,
+# e.g. 0.60.6.4.0.0.0.0.4 and 0.60.6.1.0.0.0.1 for aspell.
+#
+# [1] https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW1
+# [2] https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW1
+# [3] https://groups.google.com/d/msg/munki-dev/-DCERUz6rrM/zMbY6iimIGwJ
+# [4] http://lists.macosforge.org/pipermail/macports-dev/2013-January/021477.html
+proc portpkg::mp_version_to_apple_version {portepoch portversion portrevision} {
+ # Assume that portepoch and portrevision are non-negative integers
+ # so they do not need to be specially handled like the upstream
+ # version number.
+ set v $portversion
+
+ # Replace all non-period and non-digit characters with a period.
+ regsub -all -- {[^.0-9]+} $v . v
+
+ # Replace two or more consecutive periods with a single period.
+ regsub -all -- {[.]+} $v . v
+
+ # Trim trailing periods.
+ regsub -- {[.]+$} $v {} v
+
+ # Split the string into a list of integers.
+ set vs [split $v {.}]
+
+ # If the upstream version number ends in [a-zA-Z]+, e.g. openssl's
+ # 1.0.1c, then treat the trailing characters as a base 26 number,
+ # mapping 'A' and 'a' to 1, 'B' and 'b' to 2, etc.
+ if {[regexp -- {\d([a-zA-Z]+)} $portversion ignored chars]} {
+ # Get the integer ordinals of 'A' and 'a'.
+ scan "A" %c ord_A
+ scan "a" %c ord_a
+
+ set i 0
+ foreach char [split $chars ""] {
+ scan $char %c ord
+
+ # Treat uppercase and lowercase characters as the same
+ # value. Ordinal values less then 'a' should have 'A'
+ # subtracted, otherwise subtract 'a'. Add 1 to the value
+ # so that 'a' and 'A' are mapped to 1, not 0.
+ if {$ord < $ord_a} {
+ set j [expr $ord - $ord_A + 1]
+ } else {
+ set j [expr $ord - $ord_a + 1]
+ }
+ set i [expr 26*$i + $j]
+ }
+ lappend vs $i
+ }
+
+ # Add integers so that the total number of integers in the version
+ # number is seven.
+ while {[llength $vs] < 7} {
+ lappend vs 0
+ }
+
+ # Prepend the epoch and append the revision number.
+ set vs [linsert $vs 0 $portepoch]
+ lappend vs $portrevision
+
+ set v [join $vs {.}]
+
+ return $v
+}
Deleted: branches/new-help-system/base/src/package1.0/portportpkg.tcl
===================================================================
--- branches/new-help-system/base/src/package1.0/portportpkg.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/package1.0/portportpkg.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,209 +0,0 @@
-# et:ts=4
-# portportpkg.tcl
-# $Id$
-#
-# Copyright (c) 2002 - 2004 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 portportpkg 1.0
-package require portutil 1.0
-
-set org.macports.portpkg [target_new org.macports.portpkg portportpkg::portpkg_main]
-target_runtype ${org.macports.portpkg} always
-target_provides ${org.macports.portpkg} portpkg
-target_requires ${org.macports.portpkg} main
-
-namespace eval portportpkg {
-}
-
-set_ui_prefix
-
-
-proc portportpkg::xar_path {args} {
- global prefix_frozen
- set xar ""
- foreach path "${portutil::autoconf::xar_path} ${prefix_frozen}/bin/xar xar" {
- if { [file executable ${path}] } {
- set xar $path
- break;
- }
- }
- if { "${xar}" == "" } {
- ui_error "The xar tool is required to make portpkgs"
- ui_error "Please install the xar port before proceeding."
- return -code error [msgcat::mc "Portpkg failed"]
- }
-
- return $xar
-}
-
-
-# escape quotes, and things that make the shell cry
-proc portportpkg::shell_escape {str} {
- regsub -all -- {\\} $str {\\\\} str
- regsub -all -- {"} $str {\"} str
- regsub -all -- {'} $str {\'} str
- return $str
-}
-
-
-proc portportpkg::putel { fd el data } {
- # Quote xml data
- set quoted [string map { & & < < > > } $data]
- # Write the element
- puts $fd "<${el}>${quoted}</${el}>"
-}
-
-
-proc portportpkg::putlist { fd listel itemel list } {
- puts $fd "<$listel>"
- foreach item $list {
- putel $fd $itemel $item
- }
- puts $fd "</$listel>"
-}
-
-
-proc portportpkg::create_portpkg {} {
- global name prefix UI_PREFIX workpath portpath
-
- set xar [xar_path]
-
- set dirname "portpkg"
- set dirpath "${workpath}/${dirname}"
- set pkgpath "${workpath}/${name}.portpkg"
- set metaname "portpkg_meta.xml"
- set metapath "${workpath}/${metaname}"
-
- # Expose and default some global variables
- set vars " maintainers categories description \
- long_description master_sites homepage epoch version revision \
- PortInfo \
- submitter_name submitter_email submitter_key \
- "
- eval "global $vars"
- foreach var $vars {
- if {![info exists $var]} { set $var {} }
- }
-
- # Unobscure the maintainer addresses
- set maintainers [unobscure_maintainers $maintainers]
-
- # Make sure our workpath is clean
- file delete -force $dirpath $metapath $pkgpath
-
- # Create the portpkg directory
- file mkdir $dirpath
-
- # Move in the Portfile
- file copy Portfile ${dirpath}
-
- # Move in files
- if {[file isdirectory "files"]} {
- file copy files ${dirpath}
- }
-
- # Create the metadata subdoc
- set sd [open ${metapath} w]
- puts $sd "<portpkg version='1'>"
-
- puts $sd "<submitter>"
- putel $sd name $submitter_name
- putel $sd email $submitter_email
-
- # TODO provide means to set notes?
- putel $sd notes ""
- puts $sd "</submitter>"
-
- puts $sd "<package>"
- putel $sd name $name
- putel $sd homepage $homepage
- putlist $sd categories category $categories
- putlist $sd maintainers maintainer $maintainers
-
- putel $sd epoch $epoch
- putel $sd version $version
- putel $sd revision $revision
-
- putel $sd description [join $description]
- putel $sd long_description [join $long_description]
-
- # TODO: variants has platforms in it
- if {[info exists PortInfo(variants)]} {
- if {[info exists PortInfo(variant_desc)]} {
- array set descs $PortInfo(variant_desc)
- } else {
- array set descs ""
- }
-
- puts $sd "<variants>"
- foreach v $PortInfo(variants) {
- puts $sd "<variant>"
- putel $sd name $v
- if {[info exists descs($v)]} {
- putel $sd description $descs($v)
- }
- puts $sd "</variant>"
- }
- puts $sd "</variants>"
- } else {
- putel $sd variants ""
- }
-
- # TODO: Dependencies and platforms
- #putel $sd dependencies ""
- #putel $sd platforms ""
-
- puts $sd "</package>"
-
- puts $sd "</portpkg>"
- close $sd
-
- # Create portpkg.xar, including the metadata and the portpkg directory contents
- set cmd "cd ${workpath}; ${xar} -cf ${pkgpath} --exclude \\.DSStore --exclude \\.svn ${dirname} -s ${metapath} -n ${metaname}"
- if {[system $cmd] != ""} {
- return -code error [format [msgcat::mc "Failed to create portpkg for port : %s"] $name]
- }
-
- return ${pkgpath}
-}
-
-
-proc portportpkg::portpkg_main {args} {
- global name version portverbose prefix UI_PREFIX workpath portpath
-
- ui_msg "$UI_PREFIX [format [msgcat::mc "Creating portpkg for %s-%s"] ${name} ${version}]"
-
- # Make sure we have a work directory
- file mkdir ${workpath}
-
- # Create portpkg.xar in the work directory
- set pkgpath [create_portpkg]
-
- return 0
-}
Modified: branches/new-help-system/base/src/pextlib1.0/uid.c
===================================================================
--- branches/new-help-system/base/src/pextlib1.0/uid.c 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/pextlib1.0/uid.c 2013-03-10 01:15:31 UTC (rev 103913)
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#include <tcl.h>
@@ -107,9 +108,9 @@
/* set the uid */
if (0 != setuid(uid)) {
- Tcl_Obj *result = Tcl_NewStringObj("could not set uid to ", -1);
- Tcl_AppendObjToObj(result, objv[1]);
- Tcl_SetObjResult(interp, result);
+ char buffer[128];
+ snprintf(buffer, sizeof(buffer), "could not set uid to %ld: %d %s", uid, errno, strerror(errno));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1));
return TCL_ERROR;
}
@@ -137,9 +138,9 @@
/* set the euid */
if (0 != seteuid(uid)) {
- Tcl_Obj *result = Tcl_NewStringObj("could not set effective uid to ", -1);
- Tcl_AppendObjToObj(result, objv[1]);
- Tcl_SetObjResult(interp, result);
+ char buffer[128];
+ snprintf(buffer, sizeof(buffer), "could not set effective uid to %ld: %d %s", uid, errno, strerror(errno));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1));
return TCL_ERROR;
}
@@ -163,9 +164,9 @@
}
if (0 != setgid(gid)) {
- Tcl_Obj *result = Tcl_NewStringObj("could not set gid to ", -1);
- Tcl_AppendObjToObj(result, objv[1]);
- Tcl_SetObjResult(interp, result);
+ char buffer[128];
+ snprintf(buffer, sizeof(buffer), "could not set gid to %ld: %d %s", gid, errno, strerror(errno));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1));
return TCL_ERROR;
}
@@ -189,9 +190,9 @@
}
if (0 != setegid(gid)) {
- Tcl_Obj *result = Tcl_NewStringObj("could not set effective gid to ", -1);
- Tcl_AppendObjToObj(result, objv[1]);
- Tcl_SetObjResult(interp, result);
+ char buffer[128];
+ snprintf(buffer, sizeof(buffer), "could not set effective gid to %ld: %d %s", gid, errno, strerror(errno));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1));
return TCL_ERROR;
}
Modified: branches/new-help-system/base/src/port/port-help.tcl
===================================================================
--- branches/new-help-system/base/src/port/port-help.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port/port-help.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -314,6 +314,7 @@
--units <units> Specify units to use. Accepted units are: B, kB, KiB, MB, MiB,
GB, GiB. The 'B' may be omitted.
+--total Display the grand total only
}
set porthelp(srpm) {
@@ -328,10 +329,6 @@
Marks each of the given ports as unrequested
}
-set porthelp(submit) {
-Submit a port to the MacPorts Web Application (unimplemented)
-}
-
set porthelp(sync) {
Synchronize the set of Portfiles
}
Modified: branches/new-help-system/base/src/port/port.tcl
===================================================================
--- branches/new-help-system/base/src/port/port.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port/port.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -2139,7 +2139,7 @@
set inf "$portinfo(name) @$portinfo(version)"
set ropt "heading"
if {[info exists portinfo(revision)] && $portinfo(revision) > 0} {
- append inf ", Revision $portinfo(revision)"
+ append inf "_$portinfo(revision)"
}
if {[info exists portinfo(categories)]} {
append inf " ([join $portinfo(categories) ", "])"
@@ -2673,13 +2673,19 @@
proc action_version { action portlist opts } {
- puts "Version: [macports::version]"
+ if ![macports::ui_isset ports_quiet] {
+ puts -nonewline "Version: "
+ }
+ puts [macports::version]
return 0
}
proc action_platform { action portlist opts } {
- puts "Platform: ${macports::os_platform} ${macports::os_major} ${macports::os_arch}"
+ if ![macports::ui_isset ports_quiet] {
+ puts -nonewline "Platform: "
+ }
+ puts "${macports::os_platform} ${macports::os_major} ${macports::os_arch}"
return 0
}
@@ -3360,20 +3366,22 @@
set space [expr $space + [file size $file] ]
}
}
- set msg "[bytesize $space $units] $portname"
- if { $portversion != {} } {
- append msg " @$portversion"
+ if {![info exists options(ports_space_total)] || $options(ports_space_total) != "yes"} {
+ set msg "[bytesize $space $units] $portname"
+ if { $portversion != {} } {
+ append msg " @$portversion"
+ }
+ puts $msg
}
- puts $msg
set spaceall [expr $space + $spaceall]
} else {
- puts "Port $portname does not contain any file or is not active."
+ puts stderr "Port $portname does not contain any file or is not active."
}
} else {
- puts "Port $portname is not installed."
+ puts stderr "Port $portname is not installed."
}
}
- if {[llength $portlist] > 1} {
+ if {[llength $portlist] > 1 || ([info exists options(ports_space_total)] && $options(ports_space_total) == "yes")} {
puts "[bytesize $spaceall $units] total"
}
return 0
@@ -3623,6 +3631,9 @@
puts -nonewline $joiner
puts -nonewline "$portinfo(name) @$portinfo(version)"
+ if {[info exists portinfo(revision)] && $portinfo(revision) > 0} {
+ puts -nonewline "_$portinfo(revision)"
+ }
if {[info exists portinfo(categories)]} {
puts -nonewline " ([join $portinfo(categories) ", "])"
}
@@ -4127,7 +4138,6 @@
clean [list action_target [ACTION_ARGS_PORTS]] \
test [list action_target [ACTION_ARGS_PORTS]] \
lint [list action_target [ACTION_ARGS_PORTS]] \
- submit [list action_target [ACTION_ARGS_PORTS]] \
livecheck [list action_target [ACTION_ARGS_PORTS]] \
distcheck [list action_target [ACTION_ARGS_PORTS]] \
mirror [list action_target [ACTION_ARGS_PORTS]] \
@@ -4237,7 +4247,7 @@
long_description maintainer maintainers name platform
platforms portdir regex revision variant variants version}
selfupdate {nosync}
- space {{units 1}}
+ space {{units 1} total}
activate {no-exec}
deactivate {no-exec}
install {no-rev-upgrade unrequested}
Modified: branches/new-help-system/base/src/port1.0/Makefile
===================================================================
--- branches/new-help-system/base/src/port1.0/Makefile 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/Makefile 2013-03-10 01:15:31 UTC (rev 103913)
@@ -4,7 +4,7 @@
portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl \
portinstall.tcl portuninstall.tcl portdepends.tcl portdestroot.tcl \
portlint.tcl portclean.tcl porttest.tcl portactivate.tcl \
- portdeactivate.tcl portsubmit.tcl port_autoconf.tcl portstartupitem.tcl \
+ portdeactivate.tcl port_autoconf.tcl portstartupitem.tcl \
porttrace.tcl portlivecheck.tcl portdistcheck.tcl portmirror.tcl \
portload.tcl portunload.tcl portdistfiles.tcl fetch_common.tcl \
portsandbox.tcl
Modified: branches/new-help-system/base/src/port1.0/fetch_common.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/fetch_common.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/fetch_common.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -243,8 +243,7 @@
if {[getuid] == 0 && [geteuid] != 0} {
set oldeuid [geteuid]
set oldegid [getegid]
- seteuid 0
- setegid 0
+ seteuid 0; setegid 0
}
foreach site $urllist {
Modified: branches/new-help-system/base/src/port1.0/port.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/port.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/port.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -32,6 +32,33 @@
# standard package load
package provide port 1.0
+# Provide a callback registration mechanism for port subpackages. This needs to
+# be done _before_ loading the subpackages.
+namespace eval port {
+ variable _callback_list [list]
+
+ # Append a new procedure to a list of callbacks to be called when
+ # port::run_callbacks is called from macports1.0 after evaluating
+ # a Portfile
+ proc register_callback {callback} {
+ variable _callback_list
+ lappend _callback_list ${callback}
+ }
+
+ # Run the callbacks registered in the callback list. Called from
+ # macports1.0 in the child interpreter after evaluating the Portfile and
+ # the variants. Clears the list of callbacks.
+ proc run_callbacks {} {
+ variable _callback_list
+ foreach callback ${_callback_list} {
+ ui_debug "Running callback ${callback}"
+ ${callback}
+ ui_debug "Finished running callback ${callback}"
+ }
+ set _callback_list [list]
+ }
+}
+
package require mp_package 1.0
package require portmain 1.0
package require portdepends 1.0
@@ -49,7 +76,6 @@
package require portclean 1.0
package require porttest 1.0
package require portlint 1.0
-package require portsubmit 1.0
package require porttrace 1.0
package require portdistcheck 1.0
package require portlivecheck 1.0
Modified: branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/port_autoconf.tcl.in 2013-03-10 01:15:31 UTC (rev 103913)
@@ -40,6 +40,7 @@
variable diff_path "@DIFF@"
variable dscl_path "@DSCL@"
variable file_path "@FILE@"
+ variable find_path "@FIND@"
variable bzr_path "@BZR@"
variable cvs_path "@CVS@"
variable svn_path "@SVN@"
Modified: branches/new-help-system/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portbuild.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portbuild.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -60,32 +60,22 @@
default build.type "default"
default use_parallel_build yes
-# proc to add dependency on bsdmake, if necessary
-option_proc build.type portbuild::set_build_type
-
set_ui_prefix
-proc portbuild::set_build_type {option action args} {
- array set build_type_map {
- bsd {bin:bsdmake:bsdmake}
+# Automatically called from macports1.0 after evaluating the Portfile. If
+# ${build.type} == bsd, ensures bsdmake is present by adding a bin:-style
+# dependency.
+proc portbuild::add_automatic_buildsystem_dependencies {} {
+ if {[option build.type] == "bsd" && [option os.platform] == "darwin"} {
+ ui_debug "build.type is BSD, adding bin:bsdmake:bsdmake build dependency"
+ depends_build-delete bin:bsdmake:bsdmake
+ depends_build-append bin:bsdmake:bsdmake
+ depends_skip_archcheck-delete bsdmake
+ depends_skip_archcheck-append bsdmake
}
-
- if {$action == "set"} {
- switch $option {
- build.type {
- # using [exists foo] doesn't work with arrays!
- if {[info exists build_type_map([option build.type])]} {
- # remove dependencies added before when setting build.type more than once
- eval depends_build-delete $build_type_map([option build.type])
- }
- if {[info exists build_type_map($args)]} {
- # add dependency if needed
- eval depends_build-append $build_type_map($args)
- }
- }
- }
- }
}
+# Register the above procedure as a callback after Portfile evaluation
+port::register_callback portbuild::add_automatic_buildsystem_dependencies
proc portbuild::build_getmaketype {args} {
if {[option build.type] == "default"} {
Modified: branches/new-help-system/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portconfigure.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portconfigure.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,8 +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
-# portconfigure.tcl
# $Id$
#
-# Copyright (c) 2007 - 2012 The MacPorts Project
+# Copyright (c) 2007 - 2013 The MacPorts Project
# Copyright (c) 2007 Markus W. Weissmann <mww at macports.org>
# Copyright (c) 2002 - 2003 Apple Inc.
# All rights reserved.
@@ -129,7 +128,7 @@
default configure.mtune {}
# We could have debug/optimizations be global configurable at some point.
options configure.optflags configure.cflags configure.cppflags configure.cxxflags configure.objcflags configure.ldflags configure.libs configure.fflags configure.f90flags configure.fcflags configure.classpath
-default configure.optflags {-O2}
+default configure.optflags {-Os}
# compiler flags section
default configure.cflags {${configure.optflags}}
default configure.cppflags {-I${prefix}/include}
@@ -210,20 +209,19 @@
apple-gcc-4.0 { set name "MacPorts Apple gcc 4.0" }
apple-gcc-4.2 { set name "MacPorts Apple gcc 4.2" }
macports-gcc { set name "MacPorts gcc (port select)" }
- macports-gcc-4.2 { set name "MacPorts gcc 4.2" }
- macports-gcc-4.3 { set name "MacPorts gcc 4.3" }
- macports-gcc-4.4 { set name "MacPorts gcc 4.4" }
- macports-gcc-4.5 { set name "MacPorts gcc 4.5" }
- macports-gcc-4.6 { set name "MacPorts gcc 4.6" }
- macports-gcc-4.7 { set name "MacPorts gcc 4.7" }
- macports-gcc-4.8 { set name "MacPorts gcc 4.8" }
macports-llvm-gcc-4.2 { set name "MacPorts llvm-gcc 4.2" }
macports-clang { set name "MacPorts clang (port select)" }
- macports-clang-2.9 { set name "MacPorts clang 2.9" }
- macports-clang-3.0 { set name "MacPorts clang 3.0" }
- macports-clang-3.1 { set name "MacPorts clang 3.1" }
- macports-clang-3.2 { set name "MacPorts clang 3.2" }
- default { return -code error "Invalid value for configure.compiler" }
+ default {
+ if {[regexp {macports-clang-(.*)\.(.*)} ${configure.compiler} -> major minor]} {
+ set name "MacPorts clang ${major}.${minor}"
+ } elseif {[regexp {macports-dragonegg-(.*)\.(.*)} ${configure.compiler} -> major minor]} {
+ set name "MacPorts dragonegg ${major}.${minor}"
+ } elseif {[regexp {macports-gcc-(.*)\.(.*)} ${configure.compiler} -> major minor]} {
+ set name "MacPorts gcc ${major}.${minor}"
+ } else {
+ return -code error "Invalid value for configure.compiler: ${configure.compiler}"
+ }
+ }
}
ui_debug "Using compiler '$name'"
@@ -288,7 +286,7 @@
} elseif {[tbool configure.m32]} {
set flags "-m32"
} elseif {${configure.build_arch} != ""} {
- if {[arch_flag_supported] && ($tool == "cc" || $tool == "cxx" || $tool == "objc")} {
+ if {[arch_flag_supported ${configure.compiler}] && ($tool == "cc" || $tool == "cxx" || $tool == "objc")} {
set flags "-arch ${configure.build_arch}"
} elseif {${configure.build_arch} == "x86_64" || ${configure.build_arch} == "ppc64"} {
set flags "-m64"
@@ -304,8 +302,8 @@
# doesn't support -arch, because it could be used to link rather than using
# ld directly. So we punt and let portfiles deal with that case.
proc portconfigure::configure_get_ld_archflags {args} {
- global configure.build_arch
- if {${configure.build_arch} != "" && [arch_flag_supported]} {
+ global configure.build_arch configure.compiler
+ if {${configure.build_arch} != "" && [arch_flag_supported ${configure.compiler}]} {
return "-arch ${configure.build_arch}"
} else {
return ""
@@ -358,41 +356,12 @@
}
# internal proc to determine if the compiler supports -arch
-proc portconfigure::arch_flag_supported {args} {
- global configure.compiler
- switch -exact ${configure.compiler} {
- gcc-4.0 -
- gcc-4.2 -
- llvm-gcc-4.2 -
- clang -
- apple-gcc-4.0 -
- apple-gcc-4.2 -
- macports-clang-2.9 -
- macports-clang-3.0 -
- macports-clang-3.1 -
- macports-clang-3.2 -
- macports-clang {
- return yes
- }
- default {
- return no
- }
- }
+proc portconfigure::arch_flag_supported {compiler} {
+ return [regexp {^gcc-4|llvm|apple|clang} $compiler]
}
-# check if a compiler comes from a port
-proc portconfigure::compiler_is_port {compiler} {
- switch $compiler {
- clang -
- llvm-gcc-4.2 -
- gcc-4.2 -
- gcc-4.0 -
- gcc-3.3 {return no}
- default {return yes}
- }
-}
-
# maps compiler names to the port that provides them
+# TODO: Remove this after 2.2 is released and ports aren't referring to it.
array set portconfigure::compiler_name_map {
apple-gcc-4.0 apple-gcc40
apple-gcc-4.2 apple-gcc42
@@ -408,8 +377,33 @@
macports-clang-3.0 clang-3.0
macports-clang-3.1 clang-3.1
macports-clang-3.2 clang-3.2
+ macports-clang-3.3 clang-3.3
+ macports-dragonegg-3.0 dragonegg-3.0
+ macports-dragonegg-3.1 dragonegg-3.1
+ macports-dragonegg-3.2 dragonegg-3.2
+ macports-dragonegg-3.3 dragonegg-3.3
}
+proc portconfigure::compiler_port_name {compiler} {
+ if {[regexp {apple-gcc-(.*)\.(.*)} ${compiler} -> major minor]} {
+ return "apple-gcc${major}${minor}"
+ } elseif {[regexp {macports-clang-(.*)\.(.*)} ${compiler} -> major minor]} {
+ return "clang-${major}.${minor}"
+ } elseif {[regexp {macports-dragonegg-(.*)\.(.*)} ${compiler} -> major minor]} {
+ return "dragonegg-${major}.${minor}"
+ } elseif {[regexp {macports-gcc-(.*)\.(.*)} ${compiler} -> major minor]} {
+ return "gcc${major}${minor}"
+ } elseif {[regexp {macports-llvm-gcc-(.*)\.(.*)} ${compiler} -> major minor]} {
+ return "llvm-gcc${major}${minor}"
+ }
+
+ return ""
+}
+
+proc portconfigure::compiler_is_port {compiler} {
+ return [expr {[portconfigure::compiler_port_name ${compiler}] != ""}]
+}
+
# internal function to determine the default compiler
proc portconfigure::configure_get_default_compiler {args} {
global compiler.blacklist compiler.whitelist compiler.fallback
@@ -432,27 +426,29 @@
# internal function to choose compiler fallback list based on platform
proc portconfigure::get_compiler_fallback {} {
- global xcodeversion macosx_deployment_target default_compiler
- if {[info exists default_compiler]} {
- return $default_compiler
+ global xcodeversion macosx_deployment_target default_compilers
+ if {[info exists default_compilers]} {
+ return $default_compilers
} elseif {$xcodeversion == "none" || $xcodeversion == ""} {
return {cc}
+ } elseif {[vercmp $xcodeversion 4.6] >= 0} {
+ return {clang macports-llvm-gcc-4.2 apple-gcc-4.2 macports-clang-3.2}
} elseif {[vercmp $xcodeversion 4.2] >= 0} {
- return {clang llvm-gcc-4.2 apple-gcc-4.2}
+ return {clang llvm-gcc-4.2 apple-gcc-4.2 macports-clang-3.2}
} elseif {[vercmp $xcodeversion 4.0] >= 0} {
- return {llvm-gcc-4.2 clang gcc-4.2}
+ return {llvm-gcc-4.2 clang gcc-4.2 macports-clang-3.2 apple-gcc-4.2}
} elseif {[vercmp $xcodeversion 3.2] >= 0} {
if {$macosx_deployment_target == "10.4"} {
# It's not the deployment target that is the issue, it's the
# 10.4u SDK which base chooses if the deployment_target is set
return {gcc-4.0}
} else {
- return {gcc-4.2 clang llvm-gcc-4.2 gcc-4.0}
+ return {gcc-4.2 clang llvm-gcc-4.2 macports-clang-3.2 macports-llvm-gcc-4.2 apple-gcc-4.2 gcc-4.0}
}
} elseif {[vercmp $xcodeversion 3.0] >= 0} {
- return {gcc-4.2 apple-gcc-4.2 macports-clang-3.0 gcc-4.0}
+ return {gcc-4.2 apple-gcc-4.2 gcc-4.0 macports-clang-3.2}
} else {
- return {gcc-4.0 apple-gcc-4.2 macports-clang-3.0 gcc-3.3}
+ return {gcc-4.0 apple-gcc-4.2 gcc-3.3 macports-clang-3.2}
}
}
@@ -479,230 +475,133 @@
return "${developer_dir}/usr/bin/${name}"
}
+
# internal function to find correct compilers
proc portconfigure::configure_get_compiler {type {compiler {}}} {
global configure.compiler prefix
- set ret ""
if {$compiler == {}} {
set compiler ${configure.compiler}
}
-
- # Set defaults
- switch -exact ${type} {
- cc { set ret [find_developer_tool cc] }
- objc { set ret [find_developer_tool cc] }
- cxx { set ret [find_developer_tool c++] }
- cpp { set ret [find_developer_tool cpp] }
- }
-
- switch -exact ${compiler} {
- gcc {
- switch -exact ${type} {
- cc { set ret [find_developer_tool gcc] }
- objc { set ret [find_developer_tool gcc] }
- cxx { set ret [find_developer_tool g++] }
- cpp { set ret [find_developer_tool cpp] }
- }
+ # Tcl 8.4's switch doesn't support -matchvar.
+ if {[regexp {^gcc(-3\.3|-4\.0|-4\.2)?$} $compiler -> suffix]} {
+ switch $type {
+ cc -
+ objc { return [find_developer_tool "gcc${suffix}"] }
+ cxx { return [find_developer_tool "g++${suffix}"] }
+ cpp { return [find_developer_tool "cpp${suffix}"] }
}
- gcc-3.3 {
- switch -exact ${type} {
- cc { set ret [find_developer_tool gcc-3.3] }
- objc { set ret [find_developer_tool gcc-3.3] }
- cxx { set ret [find_developer_tool g++-3.3] }
- cpp { set ret [find_developer_tool cpp-3.3] }
- }
+ } elseif {[regexp {^llvm-gcc-4\.2$} $compiler]} {
+ switch $type {
+ cc -
+ objc { return [find_developer_tool llvm-gcc-4.2] }
+ cxx { return [find_developer_tool llvm-g++-4.2] }
+ cpp { return [find_developer_tool llvm-cpp-4.2] }
}
- gcc-4.0 {
- switch -exact ${type} {
- cc { set ret [find_developer_tool gcc-4.0] }
- objc { set ret [find_developer_tool gcc-4.0] }
- cxx { set ret [find_developer_tool g++-4.0] }
- cpp { set ret [find_developer_tool cpp-4.0] }
+ } elseif {[regexp {^clang$} $compiler]} {
+ switch $type {
+ cc -
+ objc { return [find_developer_tool clang] }
+ cxx {
+ set clangpp [find_developer_tool clang++]
+ if {[file executable $clangpp]} {
+ return $clangpp
+ }
+ return [find_developer_tool llvm-g++-4.2]
}
}
- gcc-4.2 {
- switch -exact ${type} {
- cc { set ret [find_developer_tool gcc-4.2] }
- objc { set ret [find_developer_tool gcc-4.2] }
- cxx { set ret [find_developer_tool g++-4.2] }
- cpp { set ret [find_developer_tool cpp-4.2] }
- }
- }
- llvm-gcc-4.2 {
- switch -exact ${type} {
- cc { set ret [find_developer_tool llvm-gcc-4.2] }
- objc { set ret [find_developer_tool llvm-gcc-4.2] }
- cxx { set ret [find_developer_tool llvm-g++-4.2] }
- cpp { set ret [find_developer_tool llvm-cpp-4.2] }
- }
- }
- clang {
- switch -exact ${type} {
- cc { set ret [find_developer_tool clang] }
- objc { set ret [find_developer_tool clang] }
- cxx {
- set clangpp [find_developer_tool clang++]
- if {[file executable ${clangpp}]} {
- set ret ${clangpp}
- } else {
- set ret [find_developer_tool llvm-g++-4.2]
- }
+ } elseif {[regexp {^apple-gcc(-4\.0|-4\.2)$} $compiler -> suffix]} {
+ switch $type {
+ cc -
+ objc { return ${prefix}/bin/gcc-apple${suffix} }
+ cxx {
+ if {$suffix == "-4.2"} {
+ return ${prefix}/bin/g++-apple${suffix}
}
}
+ cpp { return ${prefix}/bin/cpp-apple${suffix} }
}
- apple-gcc-4.0 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-apple-4.0 }
- objc { set ret ${prefix}/bin/gcc-apple-4.0 }
- cpp { set ret ${prefix}/bin/cpp-apple-4.0 }
- }
+ } elseif {[regexp {^macports-gcc(-\d+\.\d+)?$} $compiler -> suffix]} {
+ if {[string length $suffix]} {
+ set suffix "-mp${suffix}"
}
- apple-gcc-4.2 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-apple-4.2 }
- objc { set ret ${prefix}/bin/gcc-apple-4.2 }
- cpp { set ret ${prefix}/bin/cpp-apple-4.2 }
- cxx { set ret ${prefix}/bin/g++-apple-4.2 }
- }
+ switch $type {
+ cc -
+ objc { return ${prefix}/bin/gcc${suffix} }
+ cxx { return ${prefix}/bin/g++${suffix} }
+ cpp { return ${prefix}/bin/cpp${suffix} }
+ fc -
+ f77 -
+ f90 { return ${prefix}/bin/gfortran${suffix} }
}
- macports-gcc {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc }
- objc { set ret ${prefix}/bin/gcc }
- cxx { set ret ${prefix}/bin/g++ }
- cpp { set ret ${prefix}/bin/cpp }
- fc { set ret ${prefix}/bin/gfortran }
- f77 { set ret ${prefix}/bin/gfortran }
- f90 { set ret ${prefix}/bin/gfortran }
- }
+ } elseif {[regexp {^macports-llvm-gcc-4\.2$} $compiler]} {
+ switch $type {
+ cc -
+ objc { return ${prefix}/bin/llvm-gcc-4.2 }
+ cxx { return ${prefix}/bin/llvm-g++-4.2 }
+ cpp { return ${prefix}/bin/llvm-cpp-4.2 }
}
- macports-gcc-4.2 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.2 }
- objc { set ret ${prefix}/bin/gcc-mp-4.2 }
- cxx { set ret ${prefix}/bin/g++-mp-4.2 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.2 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.2 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.2 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.2 }
- }
+ } elseif {[regexp {^macports-clang(-\d+\.\d+)?$} $compiler -> suffix]} {
+ if {[string length $suffix]} {
+ set suffix "-mp${suffix}"
}
- macports-gcc-4.3 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.3 }
- objc { set ret ${prefix}/bin/gcc-mp-4.3 }
- cxx { set ret ${prefix}/bin/g++-mp-4.3 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.3 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.3 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.3 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.3 }
- }
+ switch $type {
+ cc -
+ objc { return ${prefix}/bin/clang${suffix} }
+ cxx { return ${prefix}/bin/clang++${suffix} }
}
- macports-gcc-4.4 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.4 }
- objc { set ret ${prefix}/bin/gcc-mp-4.4 }
- cxx { set ret ${prefix}/bin/g++-mp-4.4 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.4 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.4 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.4 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.4 }
- }
+ } elseif {[regexp {^macports-dragonegg(-\d+\.\d+)$} $compiler -> infix]} {
+ switch $type {
+ cc -
+ objc { return ${prefix}/bin/dragonegg${infix}-gcc }
+ cxx { return ${prefix}/bin/dragonegg${infix}-g++ }
+ cpp { return ${prefix}/bin/dragonegg${infix}-cpp }
+ fc -
+ f77 -
+ f90 { return ${prefix}/bin/dragonegg${infix}-gfortran }
}
- macports-gcc-4.5 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.5 }
- objc { set ret ${prefix}/bin/gcc-mp-4.5 }
- cxx { set ret ${prefix}/bin/g++-mp-4.5 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.5 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.5 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.5 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.5 }
- }
- }
- macports-gcc-4.6 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.6 }
- objc { set ret ${prefix}/bin/gcc-mp-4.6 }
- cxx { set ret ${prefix}/bin/g++-mp-4.6 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.6 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.6 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.6 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.6 }
- }
- }
- macports-gcc-4.7 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.7 }
- objc { set ret ${prefix}/bin/gcc-mp-4.7 }
- cxx { set ret ${prefix}/bin/g++-mp-4.7 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.7 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.7 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.7 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.7 }
- }
- }
- macports-gcc-4.8 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/gcc-mp-4.8 }
- objc { set ret ${prefix}/bin/gcc-mp-4.8 }
- cxx { set ret ${prefix}/bin/g++-mp-4.8 }
- cpp { set ret ${prefix}/bin/cpp-mp-4.8 }
- fc { set ret ${prefix}/bin/gfortran-mp-4.8 }
- f77 { set ret ${prefix}/bin/gfortran-mp-4.8 }
- f90 { set ret ${prefix}/bin/gfortran-mp-4.8 }
- }
- }
- macports-llvm-gcc-4.2 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/llvm-gcc-4.2 }
- objc { set ret ${prefix}/bin/llvm-gcc-4.2 }
- cxx { set ret ${prefix}/bin/llvm-g++-4.2 }
- cpp { set ret ${prefix}/bin/llvm-cpp-4.2 }
- fc { set ret ${prefix}/bin/llvm-gfortran-4.2 }
- f77 { set ret ${prefix}/bin/llvm-gfortran-4.2 }
- f90 { set ret ${prefix}/bin/llvm-gfortran-4.2 }
- }
- }
- macports-clang {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/clang }
- objc { set ret ${prefix}/bin/clang }
- cxx { set ret ${prefix}/bin/clang++ }
- }
- }
- macports-clang-2.9 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/clang-mp-2.9 }
- objc { set ret ${prefix}/bin/clang-mp-2.9 }
- cxx { set ret ${prefix}/bin/clang++-mp-2.9 }
- }
- }
- macports-clang-3.0 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/clang-mp-3.0 }
- objc { set ret ${prefix}/bin/clang-mp-3.0 }
- cxx { set ret ${prefix}/bin/clang++-mp-3.0 }
- }
- }
- macports-clang-3.1 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/clang-mp-3.1 }
- objc { set ret ${prefix}/bin/clang-mp-3.1 }
- cxx { set ret ${prefix}/bin/clang++-mp-3.1 }
- }
- }
- macports-clang-3.2 {
- switch -exact ${type} {
- cc { set ret ${prefix}/bin/clang-mp-3.2 }
- objc { set ret ${prefix}/bin/clang-mp-3.2 }
- cxx { set ret ${prefix}/bin/clang++-mp-3.2 }
- }
- }
}
- return $ret
+ # Fallbacks
+ switch $type {
+ cc -
+ objc { return [find_developer_tool cc] }
+ cxx { return [find_developer_tool c++] }
+ cpp { return [find_developer_tool cpp] }
+ }
+ return ""
}
+# Automatically called from macports1.0 after evaluating the Portfile
+# Some of the compilers we use are provided by MacPorts itself; ensure we
+# automatically add a dependency when needed
+proc portconfigure::add_automatic_compiler_dependencies {} {
+ global configure.compiler
+
+ # The default value requires substitution before use.
+ set compiler [subst ${configure.compiler}]
+ if {![compiler_is_port $compiler]} {
+ return
+ }
+
+ ui_debug "Chosen compiler ${compiler} is provided by a port, adding dependency"
+
+ set compiler_port [portconfigure::compiler_port_name ${compiler}]
+ set deptype "build"
+ if {[string first "macports-gcc-" $compiler] == 0} {
+ set deptype "lib"
+ }
+ ui_debug "Adding depends_${deptype} port:$compiler_port"
+ depends_${deptype}-delete port:$compiler_port
+ depends_${deptype}-append port:$compiler_port
+
+ if {[arch_flag_supported $compiler]} {
+ ui_debug "Adding depends_skip_archcheck $compiler_port"
+ depends_skip_archcheck-delete $compiler_port
+ depends_skip_archcheck-append $compiler_port
+ }
+}
+# Register the above procedure as a callback after Portfile evaluation
+port::register_callback portconfigure::add_automatic_compiler_dependencies
+
proc portconfigure::configure_main {args} {
global [info globals]
global worksrcpath use_configure use_autoreconf use_autoconf use_automake use_xmkmf
Modified: branches/new-help-system/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portdestroot.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portdestroot.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -48,7 +48,7 @@
# define options
options destroot.target destroot.destdir destroot.clean destroot.keepdirs destroot.umask
-options destroot.violate_mtree destroot.asroot
+options destroot.violate_mtree destroot.asroot destroot.delete_la_files
options startupitem.create startupitem.requires startupitem.init
options startupitem.name startupitem.start startupitem.stop startupitem.restart
options startupitem.type startupitem.executable
@@ -69,6 +69,7 @@
default destroot.clean no
default destroot.keepdirs ""
default destroot.violate_mtree no
+default destroot.delete_la_files no
default startupitem.name {${subport}}
default startupitem.uniquename {org.macports.${startupitem.name}}
@@ -114,8 +115,8 @@
ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
ui_debug "Run destroot without sudo to avoid root privileges."
ui_debug "Going to escalate privileges back to root."
+ seteuid $euid
setegid $egid
- seteuid $euid
ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
}
@@ -149,7 +150,7 @@
proc portdestroot::destroot_finish {args} {
global UI_PREFIX destroot prefix subport startupitem.create destroot.violate_mtree
- global applications_dir frameworks_dir destroot.keepdirs
+ global applications_dir frameworks_dir destroot.keepdirs destroot.delete_la_files
global os.platform os.version
variable oldmask
@@ -166,6 +167,28 @@
}
}
+ # Prevent overlinking due to glibtool .la files: https://trac.macports.org/ticket/38010
+ ui_debug "Fixing glibtool .la files in destroot for ${subport}"
+ fs-traverse -depth fullpath ${destroot} {
+ if {[file extension $fullpath] == ".la" && [file type $fullpath] == "file"} {
+ # Make sure it is from glibtool ... "a libtool library file" will appear in the first line
+ if {![catch {set fp [open $fullpath]}]} {
+ if {[gets $fp line] > 0 && [string first "a libtool library file" $line] != -1} {
+ if {${destroot.delete_la_files}} {
+ ui_debug "Removing [file tail $fullpath]"
+ file delete -force ${fullpath}
+ } else {
+ ui_debug "Clearing dependency_libs in [file tail $fullpath]"
+ reinplace "/dependency_libs/ s/'.*'/''/" ${fullpath}
+ }
+ }
+ } else {
+ ui_debug "Failed to open $fullpath"
+ }
+ catch {close $fp}
+ }
+ }
+
# Prune empty directories in ${destroot}
foreach path ${destroot.keepdirs} {
if {![file isdirectory ${path}]} {
Modified: branches/new-help-system/base/src/port1.0/portextract.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portextract.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portextract.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -2,7 +2,7 @@
# portextract.tcl
# $Id$
#
-# Copyright (c) 2005, 2007-2011 The MacPorts Project
+# Copyright (c) 2005, 2007-2011, 2013 The MacPorts Project
# Copyright (c) 2002 - 2003 Apple Inc.
# Copyright (c) 2007 Markus W. Weissmann <mww at macports.org>
# All rights reserved.
@@ -108,12 +108,12 @@
set dmg_mount [mkdtemp "/tmp/mports.XXXXXXXX"]
option extract.cmd [findBinary hdiutil ${portutil::autoconf::hdiutil_path}]
option extract.pre_args attach
- option extract.post_args "-private -readonly -nobrowse -mountpoint \\\"${dmg_mount}\\\" && [findBinary cp ${portutil::autoconf::cp_path}] -Rp \\\"${dmg_mount}\\\" \\\"${extract.dir}/${distname}\\\" && ${extract.cmd} detach \\\"${dmg_mount}\\\" && [findBinary rmdir ${portutil::autoconf::rmdir_path}] \\\"${dmg_mount}\\\""
+ option extract.post_args "-private -readonly -nobrowse -mountpoint \\\"${dmg_mount}\\\" && cd \\\"${dmg_mount}\\\" && [findBinary find ${portutil::autoconf::find_path}] . -depth -perm -+r -print0 | [findBinary cpio ${portutil::autoconf::cpio_path}] -0 -p -d -m -u \\\"${extract.dir}/${distname}\\\"; status=\$?; cd / && ${extract.cmd} detach \\\"${dmg_mount}\\\" && [findBinary rmdir ${portutil::autoconf::rmdir_path}] \\\"${dmg_mount}\\\"; exit \$status"
}
}
proc portextract::extract_main {args} {
- global UI_PREFIX filespath worksrcpath extract.dir usealtworkpath altprefix
+ global UI_PREFIX filespath worksrcpath extract.dir usealtworkpath altprefix use_dmg
if {![exists distfiles] && ![exists extract.only]} {
# nothing to do
@@ -129,14 +129,25 @@
} else {
option extract.args "'[option distpath]/$distfile'"
}
- if {[catch {command_exec extract} result]} {
+
+ # 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 {[tbool use_dmg]} {
+ elevateToRoot {extract dmg}
+ }
+ set code [catch {command_exec extract} result]
+ if {[tbool use_dmg]} {
+ dropPrivileges
+ }
+ if {$code} {
return -code error "$result"
}
- # start gsoc08-privileges
- chownAsRoot ${extract.dir}
- # end gsoc08-privileges
-
+ # start gsoc08-privileges
+ chownAsRoot ${extract.dir}
+ # end gsoc08-privileges
}
return 0
}
Modified: branches/new-help-system/base/src/port1.0/portlint.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portlint.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portlint.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -208,12 +208,13 @@
if {![info exists portgroup]} {
ui_error "Line $lineno has unrecognized PortGroup"
incr errors
- }
- if {[info exists portgroups($portgroup)]} {
- ui_error "Line $lineno repeats inclusion of PortGroup $portgroup"
- incr errors
} else {
- set portgroups($portgroup) $portgroupversion
+ if {[info exists portgroups($portgroup)]} {
+ ui_error "Line $lineno repeats inclusion of PortGroup $portgroup"
+ incr errors
+ } else {
+ set portgroups($portgroup) $portgroupversion
+ }
}
set seen_portgroup true
set require_blank true
Modified: branches/new-help-system/base/src/port1.0/portload.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portload.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portload.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,5 +1,5 @@
# et:ts=4
-# portsubmit.tcl
+# portload.tcl
# $Id$
#
# Copyright (c) 2007, 2009, 2011 The MacPorts Project
Deleted: branches/new-help-system/base/src/port1.0/portsubmit.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portsubmit.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portsubmit.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,264 +0,0 @@
-# et:ts=4
-# portsubmit.tcl
-# $Id$
-#
-# Copyright (c) 2007 - 2011 The MacPorts Project
-# Copyright (c) 2002 - 2004 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 portsubmit 1.0
-package require portutil 1.0
-package require portportpkg 1.0
-
-set org.macports.submit [target_new org.macports.submit portsubmit::submit_main]
-target_runtype ${org.macports.submit} always
-target_provides ${org.macports.submit} submit
-target_requires ${org.macports.submit} portpkg
-
-namespace eval portsubmit {
-}
-
-set_ui_prefix
-
-
-# escape quotes, and things that make the shell cry
-proc portsubmit::shell_escape {str} {
- regsub -all -- {\\} $str {\\\\} str
- regsub -all -- {"} $str {\"} str
- regsub -all -- {'} $str {\'} str
- return $str
-}
-
-
-proc portsubmit::submit_main {args} {
- global mp_remote_submit_url name version portverbose prefix UI_PREFIX workpath portpath
-
- set submiturl $mp_remote_submit_url
-
- # Preconditions for submit
- if {$submitter_email == ""} {
- return -code error [format [msgcat::mc "Submitter email is required to submit a port"]]
- }
-
- # Make sure we have a work directory
- file mkdir ${workpath}
-
- # Create portpkg.xar in the work directory
- set pkgpath "${workpath}/${name}.portpkg"
-
- # TODO: If a private key was provided, create a signed digest of the submission
-
- # Submit to the submit url
- set args "curl"
- lappend args "--silent"
- lappend args "--url ${submiturl}"
- lappend args "--output ${workpath}/.portsubmit.out"
- lappend args "-F machine=true"
- lappend args "-F portpkg=@${pkgpath}"
- #lappend args "-F signeddigest=${digest}"
- set cmd [join $args]
-
- if {[tbool portverbose]} {
- ui_notice "Submitting portpkg $pkgpath for $name to $submiturl"
- }
-
- # Invoke curl to do the submit
- ui_debug $cmd
- if {[system $cmd] != ""} {
- return -code error [format [msgcat::mc "Failure during submit of port %s"] $name]
- }
-
- # Parse the result
- set fd [open ${workpath}/.portsubmit.out r]
- array set result [list]
- while {[gets $fd line] != -1} {
- if {0 != [regexp -- {^([^:]+):\s*(.*)$} $line unused key value]} {
- set result($key) $value
- }
- }
- close $fd
-
- # Interpret and act on the result
- if {[info exists result(MESSAGE)] && [tbool portverbose]} {
- ui_notice $result(MESSAGE)
- }
- if {[info exists result(STATUS)]} {
- if { $result(STATUS) == 0 } {
- ui_notice "Submitted portpkg for $name"
- if {[info exists result(DOWNLOAD_URL)]} {
- ui_notice " download URL => $result(DOWNLOAD_URL)"
- }
- if {[info exists result(HUMAN_URL)]} {
- ui_notice " human readable URL => $result(HUMAN_URL)"
- }
- } else {
- return -code error [format [msgcat::mc "Status %d reported during submit of port %s"] $result(STATUS) $name]
- }
- } else {
- return -code error [format [msgcat::mc "Status not received during submit of port %s"] $name]
- }
-
- return
-
- # REMNANTS OF KEVIN'S CODE
-
- # start with the Portfile, and add the files directory if it exists.
- # don't pick up any CVS directories, or .DS_Store turds
- set cmd "tar czvf ${workpath}/Portfile.tar.gz "
- append cmd "--exclude CVS --exclude .DS_Store "
- append cmd "Portfile "
- if {[file isdirectory "files"]} {
- append cmd "files "
- }
-
- if {[system $cmd] != ""} {
- return -code error [format [msgcat::mc "Failed to archive port %s"] $name]
- }
-
- set portsource ""
- set base_rev ""
- if {![catch {set fd [open ".mports_source" r]}]} {
- while {[gets $fd line] != -1} {
- regexp -- {^(.*): (.*)$} $line unused key value
- switch -- $key {
- source { set portsource $value }
- revision { set base_rev $value }
- }
- }
- close $fd
- }
- if {$portsource == ""} {
- ui_notice "$UI_PREFIX Submitting $name-$version"
- puts -nonewline "URL: "
- flush stdout
- gets stdin portsource
- }
-
- ui_notice "$UI_PREFIX Submitting $name-$version to $portsource"
-
- puts -nonewline "Username: "
- flush stdout
- gets stdin username
- puts -nonewline "Password: "
- flush stdout
- exec stty -echo
- gets stdin password
- puts ""
- exec stty echo
-
- set vars {name version maintainers categories description \
- long_description master_sites}
- eval "global $vars"
- foreach var $vars {
- if {![info exists $var]} { set $var {} }
- }
-
- set cmd "curl "
- append cmd "--silent "
- append cmd "--url [regsub -- {^mports} $portsource {http}]/cgi-bin/portsubmit.cgi "
- append cmd "--output ${workpath}/.portsubmit.out "
- append cmd "-F name=${name} "
- append cmd "-F version=${version} "
- append cmd "-F base_rev=${base_rev} "
- append cmd "-F md5=[md5 file ${workpath}/Portfile.tar.gz] "
- append cmd "-F attachment=@${workpath}/Portfile.tar.gz "
- append cmd "-F \"submitted_by=[shell_escape $username]\" "
- append cmd "-F \"password=[shell_escape $password]\" "
- append cmd "-F \"maintainers=[shell_escape $maintainers]\" "
- append cmd "-F \"categories=[shell_escape $categories]\" "
- append cmd "-F \"description=[shell_escape $description]\" "
- append cmd "-F \"long_description=[shell_escape $long_description]\" "
- append cmd "-F \"master_sites=[shell_escape $master_sites]\" "
-
- ui_debug $cmd
- if {[system $cmd] != ""} {
- return -code error [format [msgcat::mc "Failed to submit port %s"] $name]
- }
-
- #
- # Parse the result from the remote index
- # if ERROR: print the error message
- # if OK: store the revision info
- # if CONFLICT: attempt to merge the conflict
- #
-
- set fd [open ${workpath}/.portsubmit.out r]
- array set result [list]
- while {[gets $fd line] != -1} {
- regexp -- {^(.*): (.*)$} $line unused key value
- set result($key) $value
- }
- close $fd
-
- if {[info exists result(OK)]} {
- set fd [open ".mports_source" w]
- puts $fd "source: $portsource"
- puts $fd "port: $name"
- puts $fd "version: $version"
- puts $fd "revision: $result(revision)"
- close $fd
-
- ui_notice "$name-$version submitted successfully."
- ui_notice "New revision: $result(revision)"
- } elseif {[info exists result(ERROR)]} {
- return -code error $result(ERROR)
- } elseif {[info exists result(CONFLICT)]} {
- # Fetch the newer revision from the index.
- # XXX: many gross hacks here regarding paths, urls, etc.
- set tmpdir [mktemp "/tmp/mports.XXXXXXXX"]
- file mkdir $tmpdir/new
- file mkdir $tmpdir/old
- set worker [mport_open $portsource/files/$name/$version/$result(revision)/Portfile.tar.gz [list portdir $tmpdir/new subport $name]]
- if {$base_rev != ""} {
- set worker2 [mport_open $portsource/files/$name/$version/$base_rev/Portfile.tar.gz [list portdir $tmpdir/old subport $name]]
- catch {system "diff3 -m -E -- $portpath/Portfile $tmpdir/old/$name-$version/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
- file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
- mport_close $worker2
- } else {
- catch {system "diff3 -m -E -- $portpath/Portfile $portpath/Portfile $tmpdir/new/$name-$version/Portfile > $tmpdir/Portfile"}
- file rename -force "${tmpdir}/Portfile" "${portpath}/Portfile"
- }
- mport_close $worker
- catch {delete "${tmpdir}"}
-
- set fd [open [file join "$portpath" ".mports_source"] w]
- puts $fd "source: $portsource"
- puts $fd "port: $name"
- puts $fd "version: $version"
- puts $fd "revision: $result(revision)"
- close $fd
-
- ui_error "A newer revision of this port has already been submitted."
- ui_error "Portfile: $name-$version"
- ui_error "Base revision: $base_rev"
- ui_error "Current revision: $result(revision)"
- ui_error "Please edit the Portfile to resolve any conflicts and resubmit."
- }
-
- return 0
-}
Modified: branches/new-help-system/base/src/port1.0/portunload.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portunload.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portunload.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -1,5 +1,5 @@
# et:ts=4
-# portsubmit.tcl
+# portunload.tcl
# $Id$
#
# Copyright (c) 2007, 2009, 2011 The MacPorts Project
Modified: branches/new-help-system/base/src/port1.0/portutil.tcl
===================================================================
--- branches/new-help-system/base/src/port1.0/portutil.tcl 2013-03-10 00:58:45 UTC (rev 103912)
+++ branches/new-help-system/base/src/port1.0/portutil.tcl 2013-03-10 01:15:31 UTC (rev 103913)
@@ -5,7 +5,7 @@
# Copyright (c) 2002-2003 Apple Inc.
# Copyright (c) 2004 Robert Shaw <rshaw at opendarwin.org>
# Copyright (c) 2006-2007 Markus W. Weissmann <mww at macports.org>
-# Copyright (c) 2004-2012 The MacPorts Project
+# Copyright (c) 2004-2013 The MacPorts Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -915,7 +915,7 @@
# reinplace
# Provides "sed in place" functionality
proc reinplace {args} {
- global env worksrcpath
+ global env worksrcpath macosx_version
set extended 0
set suppress 0
set oldlocale_exists 0
@@ -1005,6 +1005,9 @@
set env(LC_CTYPE) $oldlocale
} else {
unset env(LC_CTYPE)
+ if {$macosx_version == "10.5"} {
+ unsetenv LC_CTYPE
+ }
}
}
close $tmpfd
@@ -1016,6 +1019,9 @@
set env(LC_CTYPE) $oldlocale
} else {
unset env(LC_CTYPE)
+ if {$macosx_version == "10.5"} {
+ unsetenv LC_CTYPE
+ }
}
}
close $tmpfd
@@ -1311,13 +1317,15 @@
proc target_run {ditem} {
global target_state_fd workpath portpath ports_trace PortInfo ports_dryrun \
- ports_dry_last_skipped worksrcpath prefix subport env portdbpath
+ ports_dry_last_skipped worksrcpath prefix subport env portdbpath \
+ macosx_version
set portname $subport
set result 0
set skipped 0
set procedure [ditem_key $ditem procedure]
set savedhome [file join $portdbpath home]
set env(HOME) "${workpath}/.home"
+ set env(TMPDIR) "${workpath}/.tmp"
if {[ditem_key $ditem state] != "no"} {
set target_state_fd [open_statefile]
@@ -1424,20 +1432,30 @@
}
}
- # Dependencies are in the form verb:[param:]port
- set depsPorts {}
+ # Recursively collect all dependencies from registry for tracing
+ set deplist {}
foreach depspec $depends {
- # grab the portname portion of the depspec
- set dep_portname [lindex [split $depspec :] end]
- lappend depsPorts $dep_portname
+ # Resolve dependencies to actual ports
+ set name [_get_dep_port $depspec]
+
+ # If portname is empty, the dependency is already satisfied by other means,
+ # for example a bin: dependency on a file not installed by MacPorts
+ if {$name != ""} {
+ if {[lsearch -exact $deplist $name] == -1} {
+ lappend deplist $name
+ set deplist [recursive_collect_deps $name $deplist]
+ }
+ }
}
- set portlist $depsPorts
- foreach depName $depsPorts {
- set portlist [recursive_collect_deps $depName $deptypes $portlist]
+ # Add ccache port for access to ${prefix}/bin/ccache binary
+ if [option configure.ccache] {
+ lappend deplist ccache
}
- if {[llength $deptypes] > 0} {tracelib setdeps $portlist}
+ ui_debug "Tracemode will respect recursively collected port dependencies: [lsort $deplist]"
+
+ if {[llength $deptypes] > 0} {tracelib setdeps $deplist}
}
if {$result == 0} {
@@ -1532,45 +1550,34 @@
}
set env(HOME) $savedhome
+ if {[info exists env(TMPDIR)]} {
+ unset env(TMPDIR)
+ if {$macosx_version == "10.5"} {
+ unsetenv TMPDIR
+ }
+ }
return $result
}
# recursive dependency search for portname
-proc recursive_collect_deps {portname deptypes {depsfound {}}} \
+proc recursive_collect_deps {portname {depsfound {}}} \
{
- set res [mport_lookup $portname]
- if {[llength $res] < 2} \
- {
- # Even if this port cannot be found in the index,
- # it is still listed as dependency
- if {[lsearch -exact $depsfound $portname] == -1} {
- lappend depsfound $portname
- }
- return $depsfound
- }
+ # Get the active port from the registry
+ # There can be only one port active at a time, so take the first result only
+ set regentry [lindex [registry_active $portname] 0]
+ # Get port dependencies from the registry
+ set deplist [registry_list_depends [lindex $regentry 0] [lindex $regentry 1] [lindex $regentry 2] [lindex $regentry 3]]
- set depends {}
-
- array set portinfo [lindex $res 1]
- foreach deptype $deptypes \
- {
- if {[info exists portinfo($deptype)] && $portinfo($deptype) != ""} \
- {
- set depends [concat $depends $portinfo($deptype)]
+ foreach item $deplist {
+ set name [lindex $item 0]
+ if {[lsearch -exact $depsfound $name] == -1} {
+ lappend depsfound $name
+ set depsfound [recursive_collect_deps $name $depsfound]
}
}
- set portdeps $depsfound
- foreach depspec $depends \
- {
- set portname [lindex [split $depspec :] end]
- if {[lsearch -exact $portdeps $portname] == -1} {
- lappend portdeps $portname
- set portdeps [recursive_collect_deps $portname $deptypes $portdeps]
- }
- }
- return $portdeps
+ return $depsfound
}
@@ -1594,7 +1601,7 @@
# run the activate target but ignore its (completed) dependencies
set result [target_run [lindex [dlist_search $dlist provides $target] 0]]
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
}
return $result
}
@@ -1617,7 +1624,7 @@
set dlist [dlist_eval $dlist "" target_run]
if {[getuid] == 0 && [geteuid] != 0} {
- setegid 0; seteuid 0
+ seteuid 0; setegid 0
}
if {[llength $dlist] > 0} {
@@ -1665,8 +1672,16 @@
}
if {![tbool ports_dryrun]} {
- if {![file isdirectory $workpath]} {
- file mkdir "${workpath}/.home"
+ set need_chown 0
+ if {![file isdirectory $workpath/.home]} {
+ file mkdir $workpath/.home
+ set need_chown 1
+ }
+ if {![file isdirectory $workpath/.tmp]} {
+ file mkdir $workpath/.tmp
+ set need_chown 1
+ }
+ if {$need_chown} {
chownAsRoot $subbuildpath
}
# Create a symlink to the workpath for port authors
@@ -2105,9 +2120,7 @@
foreach target $args {
set origproc [ditem_key $ditem procedure]
set ident [ditem_key $ditem name]
- if {[info commands $target] != ""} {
- ui_debug "$ident registered provides '$target', a pre-existing procedure. Target override will not be provided"
- } else {
+ if {[info commands $target] == ""} {
proc $target {args} "
variable proc_index
set proc_index \[llength \[ditem_key $ditem proc\]\]
@@ -2390,10 +2403,9 @@
set groupFile [getportresourcepath $porturl "port1.0/group/${group}-${version}.tcl"]
if {[file exists $groupFile]} {
- ui_debug "Using group file $groupFile"
uplevel "source $groupFile"
} else {
- ui_warn "Group file could not be located."
+ ui_warn "PortGroup ${group} ${version} could not be located. ${group}-${version}.tcl does not exist."
}
}
@@ -2661,8 +2673,8 @@
if { [getuid] == 0 } {
if {[geteuid] != 0} {
# if started with sudo but have dropped the privileges
+ seteuid $euid
setegid $egid
- seteuid $euid
ui_debug "euid/egid changed to: [geteuid]/[getegid]"
chown ${path} ${macportsuser}
ui_debug "chowned $path to $macportsuser"
@@ -2686,8 +2698,8 @@
if {[getuid] == 0} {
if {[geteuid] != 0} {
# Started as root, but not root now
+ seteuid $euid
setegid $egid
- seteuid $euid
ui_debug "euid/egid changed to: [geteuid]/[getegid]"
ui_debug "setting attributes on $file"
eval file attributes {$file} $attributes
@@ -2714,8 +2726,8 @@
if { [getuid] == 0 && [geteuid] != 0 } {
# if started with sudo but have dropped the privileges
ui_debug "Can't run $action on this port without elevated privileges. Escalating privileges back to root."
+ seteuid $euid
setegid $egid
- seteuid $euid
ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
} elseif { [getuid] != 0 } {
return -code error "MacPorts requires root privileges for this action"
@@ -2938,11 +2950,16 @@
set ok 3.2
set rec 3.2.6
}
- default {
+ 10.7 {
set min 4.1
set ok 4.1
- set rec 4.1
+ set rec 4.5.2
}
+ default {
+ set min 4.4
+ set ok 4.4
+ set rec 4.5.2
+ }
}
if {$xcodeversion == "none"} {
ui_warn "Xcode does not appear to be installed; most ports will likely fail to build."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130309/35378963/attachment-0001.html>
More information about the macports-changes
mailing list