[60373] branches/images-and-archives/base
blb at macports.org
blb at macports.org
Tue Nov 10 02:24:25 PST 2009
Revision: 60373
http://trac.macports.org/changeset/60373
Author: blb at macports.org
Date: 2009-11-10 02:24:23 -0800 (Tue, 10 Nov 2009)
Log Message:
-----------
Merge from trunk
Modified Paths:
--------------
branches/images-and-archives/base/configure
branches/images-and-archives/base/configure.ac
branches/images-and-archives/base/doc/macports.conf.5
branches/images-and-archives/base/doc/macports.conf.in
branches/images-and-archives/base/doc/port.1
branches/images-and-archives/base/doc/portfile.7
branches/images-and-archives/base/src/macports1.0/macports.tcl
branches/images-and-archives/base/src/package1.0/portdmg.tcl
branches/images-and-archives/base/src/package1.0/portmdmg.tcl
branches/images-and-archives/base/src/port/port-help.tcl
branches/images-and-archives/base/src/port/port.tcl
branches/images-and-archives/base/src/port1.0/port_autoconf.tcl.in
branches/images-and-archives/base/src/port1.0/portchecksum.tcl
branches/images-and-archives/base/src/port1.0/portclean.tcl
branches/images-and-archives/base/src/port1.0/portmain.tcl
branches/images-and-archives/base/src/port1.0/portutil.tcl
Added Paths:
-----------
branches/images-and-archives/base/portmgr/fedora/macports.spec
Removed Paths:
-------------
branches/images-and-archives/base/portmgr/fedora/macports.spec
Property Changed:
----------------
branches/images-and-archives/base/
branches/images-and-archives/base/src/pextlib1.0/sha256cmd.c
branches/images-and-archives/base/src/pextlib1.0/sha256cmd.h
Property changes on: branches/images-and-archives/base
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base:37343-46937
/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:50249-59837
/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/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-60372
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
Modified: branches/images-and-archives/base/configure
===================================================================
--- branches/images-and-archives/base/configure 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/configure 2009-11-10 10:24:23 UTC (rev 60373)
@@ -694,7 +694,6 @@
CVS
FILE
DSCL
-DITTO
DIFF
CPIO
CP
@@ -4302,46 +4301,6 @@
fi
-# Extract the first word of "ditto", so it can be a program name with args.
-set dummy ditto; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DITTO+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $DITTO in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DITTO="$DITTO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_DITTO="$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
-DITTO=$ac_cv_path_DITTO
-if test -n "$DITTO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DITTO" >&5
-$as_echo "$DITTO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
# Extract the first word of "dscl", so it can be a program name with args.
set dummy dscl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Modified: branches/images-and-archives/base/configure.ac
===================================================================
--- branches/images-and-archives/base/configure.ac 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/configure.ac 2009-11-10 10:24:23 UTC (rev 60373)
@@ -91,7 +91,6 @@
AC_PATH_PROG(CP, [cp], [])
AC_PATH_PROG(CPIO, [cpio], [])
AC_PATH_PROG(DIFF, [diff], [])
-AC_PATH_PROG(DITTO, [ditto], [])
AC_PATH_PROG(DSCL, [dscl], [])
AC_PATH_PROG(FILE, [file], [])
AC_PATH_PROG(CVS, [cvs], [])
Modified: branches/images-and-archives/base/doc/macports.conf.5
===================================================================
--- branches/images-and-archives/base/doc/macports.conf.5 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/doc/macports.conf.5 2009-11-10 10:24:23 UTC (rev 60373)
@@ -120,6 +120,11 @@
.br
.Ic Default:
yes
+.It Va keeplogs
+Keep logs for ports
+.br
+.Ic Default:
+yes
.It Va build_arch
The machine architecture to try to build for in normal use
.br
Modified: branches/images-and-archives/base/doc/macports.conf.in
===================================================================
--- branches/images-and-archives/base/doc/macports.conf.in 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/doc/macports.conf.in 2009-11-10 10:24:23 UTC (rev 60373)
@@ -65,6 +65,10 @@
# Set whether to automatically execute "clean" after "install" of ports
#portautoclean yes
+# Uncomment if you dont want logs to be saved (but you will not be able to get
+# help if something goes wrong)
+#keeplogs no
+
# Rsync server to fetch MacPorts sources from. Note that this is only used
# for selfupdate. The source(s) for the ports tree are set in sources.conf.
# Known mirrors at time of writing (see http://trac.macports.org/wiki/Mirrors
Modified: branches/images-and-archives/base/doc/port.1
===================================================================
--- branches/images-and-archives/base/doc/port.1 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/doc/port.1 2009-11-10 10:24:23 UTC (rev 60373)
@@ -209,7 +209,7 @@
.It Fl q
quiet mode (suppress messages)
.It Fl n
-don't follow dependencies in upgrade (only for upgrading)
+don't upgrade dependencies (affects upgrade and install)
.It Fl R
also upgrade dependents (only for upgrading)
.It Fl u
@@ -386,10 +386,25 @@
.Fl -dist .
To remove the work and distribution files, pass
.Fl -all .
+To remove log files for certain port, pass
+.Fl -logs .
For example:
.Pp
.Dl "port clean --dist vim"
-.Dl "port clean --all vim"
+.Dl "port clean --logs vim"
+.Ss log
+Parses and shows log files for
+.Ar portname .
+To filter log files by some criterions use
+.Fl -phase
+to specify phase you want to show and
+.Fl -verbosity
+to specify message category (msg, info, debug)
+For example:
+.Pp
+.Dl "port log --phase configure vim"
+.Dl "port log --phase fetch --verbosity debug vim"
+.Pp
.Ss echo
Writes to stdout the arguments passed to
.Nm .
Modified: branches/images-and-archives/base/doc/portfile.7
===================================================================
--- branches/images-and-archives/base/doc/portfile.7 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/doc/portfile.7 2009-11-10 10:24:23 UTC (rev 60373)
@@ -317,6 +317,14 @@
.br
.Sy Example:
.Dl use_configure no
+.It Ic copy_log_files Ar path/to/logfile1 Ar path/to/logfile2 Ar ...
+Copy specific log files from the workdir to the main macports log dir
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Example:
+.Dl copy_log_files config.log
.It Ic conflicts
Used to list ports which conflict with the one containing the
.Cm conflicts
Deleted: branches/images-and-archives/base/portmgr/fedora/macports.spec
===================================================================
--- branches/images-and-archives/base/portmgr/fedora/macports.spec 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/portmgr/fedora/macports.spec 2009-11-10 10:24:23 UTC (rev 60373)
@@ -1,100 +0,0 @@
-Summary: MacPorts allows installing software on Mac OS X (and other platforms)
-Name: macports
-Version: 1.6.0
-Release: 0%{?dist}
-License: BSD
-Group: System Environment/Base
-URL: http://www.macports.org
-Source: http://svn.macosforge.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
-Prefix: /opt/local
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-
-Requires: curl tcl rsync coreutils make
-BuildRequires: curl-devel tcl-devel tcl-thread sqlite-devel gcc-objc gnustep-base
-BuildRequires: mtree fakeroot /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
-BuildRequires: openssl-devel
-
-%description
-MacPorts is a system for compiling, installing, and managing free and
-open source software. A MacPorts "port" is a set of specifications
-contained in a Portfile that defines an application, its characteristics,
-and any files or special instructions required to install it, so MacPorts
-may automatically fetch, patch, compile, and install ported software.
-
-MacPorts may also be used to pre-compile ported software into binaries
-that may be installed on remote computers. Binaries of ported software
-may be installed very quickly since the steps required to install ports
-from source code have all been performed in advance.
-
-%prep
-%setup -n MacPorts-%{version}
-# avoid the whole upgrade and information procedure
-perl -pe 's/^install::/interactive::/' -i Makefile.in
-
-%define _prefix %{prefix}
-%define _bindir %{prefix}/bin
-%define _sysconfdir %{prefix}/etc
-%define _datadir %{prefix}/share
-%define _mandir %{prefix}/share/man
-%define _infodir %{prefix}/share/info
-%define _localstatedir %{prefix}/var
-
-%build
-source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
-%configure \
- --without-included-tclthread --without-included-sqlite3 \
- --with-objc-runtime=GNU --with-objc-foundation=GNUstep
-make
-
-%install
-source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
-rm -rf $RPM_BUILD_ROOT
-make install \
- DESTDIR="$RPM_BUILD_ROOT" INSTALL="fakeroot install"
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-, root, root)
-%doc LICENSE ChangeLog
-%{_bindir}/port
-%{_bindir}/portf
-%{_bindir}/portindex
-%{_bindir}/portmirror
-%config(noreplace) %{_sysconfdir}/macports
-%doc %{_mandir}/man1/port.1*
-%doc %{_mandir}/man5/macports.conf.5*
-%doc %{_mandir}/man7/portfile.7*
-%doc %{_mandir}/man7/portgroup.7*
-%doc %{_mandir}/man7/porthier.7*
-%doc %{_mandir}/man7/portstyle.7*
-%{_datadir}/macports
-%{_localstatedir}/macports
-/usr/share/tcl8.4/macports1.0
-#### mtree
-%dir %{prefix}
-%dir %{prefix}/bin
-%dir %{prefix}/etc
-%dir %{prefix}/include
-%dir %{prefix}/lib
-%dir %{prefix}/libexec
- %{prefix}/man
-%dir %{prefix}/sbin
-%dir %{prefix}/share
-%dir %{prefix}/share/info
-%dir %{prefix}/share/man
-%dir %{prefix}/share/man/cat?
-%dir %{prefix}/share/man/man?
-%dir %{prefix}/share/nls
-%dir %{prefix}/share/nls/*
-#dir %{prefix}/skel
-#dir %{prefix}/src
-%dir %{prefix}/var
-
-%changelog
-* Sun Aug 12 2007 Anders F Bjorklund <afb at macports.org> - 1.5.0
-- Updated to version 1.5.0
-
-* Sun Aug 12 2007 Anders F Bjorklund <afb at macports.org> - 1.4.0
-- Initial Fedora packaging
Copied: branches/images-and-archives/base/portmgr/fedora/macports.spec (from rev 60372, trunk/base/portmgr/fedora/macports.spec)
===================================================================
--- branches/images-and-archives/base/portmgr/fedora/macports.spec (rev 0)
+++ branches/images-and-archives/base/portmgr/fedora/macports.spec 2009-11-10 10:24:23 UTC (rev 60373)
@@ -0,0 +1,100 @@
+Summary: MacPorts allows installing software on Mac OS X (and other platforms)
+Name: macports
+Version: 1.6.0
+Release: 0%{?dist}
+License: BSD
+Group: System Environment/Base
+URL: http://www.macports.org
+Source: http://svn.macosforge.org/repository/macports/distfiles/MacPorts/MacPorts-%{version}.tar.bz2
+Prefix: /opt/local
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+Requires: curl tcl rsync coreutils make
+BuildRequires: curl-devel tcl-devel tcl-thread sqlite-devel gcc-objc gnustep-base
+BuildRequires: mtree fakeroot /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
+BuildRequires: openssl-devel
+
+%description
+MacPorts is a system for compiling, installing, and managing free and
+open source software. A MacPorts "port" is a set of specifications
+contained in a Portfile that defines an application, its characteristics,
+and any files or special instructions required to install it, so MacPorts
+may automatically fetch, patch, compile, and install ported software.
+
+MacPorts may also be used to pre-compile ported software into binaries
+that may be installed on remote computers. Binaries of ported software
+may be installed very quickly since the steps required to install ports
+from source code have all been performed in advance.
+
+%prep
+%setup -n MacPorts-%{version}
+# avoid the whole upgrade and information procedure
+perl -pe 's/^install::/interactive::/' -i Makefile.in
+
+%define _prefix %{prefix}
+%define _bindir %{prefix}/bin
+%define _sysconfdir %{prefix}/etc
+%define _datadir %{prefix}/share
+%define _mandir %{prefix}/share/man
+%define _infodir %{prefix}/share/info
+%define _localstatedir %{prefix}/var
+
+%build
+source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
+%configure \
+ --without-included-tclthread --without-included-sqlite3 \
+ --with-objc-runtime=GNU --with-objc-foundation=GNUstep
+make
+
+%install
+source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
+rm -rf $RPM_BUILD_ROOT
+make install \
+ DESTDIR="$RPM_BUILD_ROOT" INSTALL="fakeroot install"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, root)
+%doc LICENSE ChangeLog
+%{_bindir}/port
+%{_bindir}/portf
+%{_bindir}/portindex
+%{_bindir}/portmirror
+%config(noreplace) %{_sysconfdir}/macports
+%doc %{_mandir}/man1/port.1*
+%doc %{_mandir}/man5/macports.conf.5*
+%doc %{_mandir}/man7/portfile.7*
+%doc %{_mandir}/man7/portgroup.7*
+%doc %{_mandir}/man7/porthier.7*
+%doc %{_mandir}/man7/portstyle.7*
+%{_datadir}/macports
+%{_localstatedir}/macports
+/usr/share/tcl8.4/macports1.0
+#### mtree
+%dir %{prefix}
+%dir %{prefix}/bin
+%dir %{prefix}/etc
+%dir %{prefix}/include
+%dir %{prefix}/lib
+%dir %{prefix}/libexec
+ %{prefix}/man
+%dir %{prefix}/sbin
+%dir %{prefix}/share
+%dir %{prefix}/share/info
+%dir %{prefix}/share/man
+%dir %{prefix}/share/man/cat?
+%dir %{prefix}/share/man/man?
+%dir %{prefix}/share/nls
+%dir %{prefix}/share/nls/*
+#dir %{prefix}/skel
+#dir %{prefix}/src
+%dir %{prefix}/var
+
+%changelog
+* Sun Aug 12 2007 Anders F Bjorklund <afb at macports.org> - 1.5.0
+- Updated to version 1.5.0
+
+* Sun Aug 12 2007 Anders F Bjorklund <afb at macports.org> - 1.4.0
+- Initial Fedora packaging
Modified: branches/images-and-archives/base/src/macports1.0/macports.tcl
===================================================================
--- branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/macports1.0/macports.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -38,11 +38,11 @@
package require macports_util 1.0
namespace eval macports {
- namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
+ namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities port_stages
variable bootstrap_options "\
portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
- portautoclean porttrace \
- portverbose destroot_umask variants_conf rsync_server rsync_options \
+ portautoclean \
+ porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir frameworks_dir developer_dir universal_archs build_arch \
@@ -51,10 +51,10 @@
variable portinterp_options "\
portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
registry.path registry.format portimagefilepath portautoclean \
- porttrace portverbose destroot_umask rsync_server \
+ porttrace keeplogs portverbose destroot_umask rsync_server \
rsync_options rsync_dir startupitem_type place_worksymlink \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
- applications_dir frameworks_dir developer_dir universal_archs build_arch $user_options \
+ applications_dir current_stage frameworks_dir developer_dir universal_archs build_arch $user_options \
os_arch os_endian os_major os_platform os_version"
# deferred options are only computed when needed.
@@ -64,7 +64,9 @@
variable open_mports {}
- variable ui_priorities "debug info msg error warn"
+ variable ui_priorities "debug info msg error warn any"
+ variable port_stages "any fetch checksum"
+ variable current_stage "main"
}
# Provided UI instantiations
@@ -107,55 +109,108 @@
return 0
}
+proc macports::init_logging {portname} {
+ global ::debuglog ::debuglogname macports::channels macports::portdbpath
-proc macports::ui_init {priority args} {
- # Get the list of channels.
- if {[llength [info commands ui_channels]] > 0} {
- set channels [ui_channels $priority]
- } else {
- set channels [ui_channels_default $priority]
+ set logname [file join $macports::portdbpath "logs/$portname"]
+ file mkdir $logname
+ set logname [file join $logname "main.log"]
+ ui_msg $logname
+ set ::debuglogname $logname
+
+ # Recreate the file if already exists
+ if {[file exists $::debuglogname]} {
+ file delete -force $::debuglogname
}
+ set ::debuglog [open $::debuglogname w]
+ puts $::debuglog "version:1"
+ # Add our log-channel to all already initialized channels
+ foreach key [array names channels] {
+ set macports::channels($key) [concat $macports::channels($key) "debuglog"]
+ }
+}
+proc macports::ch_logging {portname} {
+ global ::debuglog ::debuglogname macports::channels macports::portdbpath
- # Simplify ui_$priority.
- set nbchans [llength $channels]
- if {$nbchans == 0} {
- proc ::ui_$priority {args} {}
- } else {
- if {[llength [info commands ui_prefix]] > 0} {
- set prefix [ui_prefix $priority]
- } else {
- set prefix [ui_prefix_default $priority]
- }
+ set logname [file join $macports::portdbpath "logs/$portname"]
+ file mkdir $logname
+ set logname [file join $logname "main.log"]
- if {[llength [info commands ::ui_init]] > 0} {
- eval ::ui_init $priority $prefix $channels $args
+ set ::debuglogname $logname
+
+ # Recreate the file if already exists
+ if {[file exists $::debuglogname]} {
+ file delete -force $::debuglogname
+ }
+ set ::debuglog [open $::debuglogname w]
+ puts $::debuglog "version:1"
+}
+
+proc ui_phase {phase} {
+ global macports::current_stage
+ set macports::current_stage $phase
+ if {$phase != "main"} {
+ set cur_time [clock format [clock seconds] -format {%+}]
+ ui_any "---> Stage $phase started at $cur_time"
+ }
+}
+proc ui_message {priority prefix stage args} {
+ global macports::channels ::debuglog macports::current_stage
+ foreach chan $macports::channels($priority) {
+ if {[info exists ::debuglog] && ($chan == "debuglog")} {
+ set chan $::debuglog
+ if {[info exists macports::current_stage]} {
+ set stage $macports::current_stage
+ }
+ set strprefix ":$priority:$stage "
+ if {[lindex $args 0] == "-nonewline"} {
+ puts -nonewline $chan "$strprefix[lindex $args 1]"
+ } else {
+ puts $chan "$strprefix[lindex $args 0]"
+ }
+
} else {
- if {$nbchans == 1} {
- set chan [lindex $channels 0]
- proc ::ui_$priority {args} [subst {
- if {\[lindex \$args 0\] == "-nonewline"} {
- puts -nonewline $chan "$prefix\[lindex \$args 1\]"
- } else {
- puts $chan "$prefix\[lindex \$args 0\]"
- }
- }]
+ if {[lindex $args 0] == "-nonewline"} {
+ puts -nonewline $chan "$prefix[lindex $args 1]"
} else {
- proc ::ui_$priority {args} [subst {
- foreach chan \$channels {
- if {\[lindex \$args 0\] == "-nonewline"} {
- puts -nonewline $chan "$prefix\[lindex \$args 1\]"
- } else {
- puts $chan "$prefix\[lindex \$args 0\]"
- }
- }
- }]
+ puts $chan "$prefix[lindex $args 0]"
}
}
-
- # Call ui_$priority
- eval ::ui_$priority $args
}
}
+proc macports::ui_init {priority args} {
+ global macports::channels ::debuglog
+ set default_channel [macports::ui_channels_default $priority]
+ # Get the list of channels.
+ if {[llength [info commands ui_channels]] > 0} {
+ set channels($priority) [ui_channels $priority]
+ } else {
+ set channels($priority) $default_channel
+ }
+
+ # if some priority initialized after log file is being created
+ if [info exist ::debuglog] {
+ set channels($priority) [concat $channels($priority) "debuglog"]
+ }
+ # Simplify ui_$priority.
+ try {
+ set prefix [ui_prefix $priority]
+ } catch * {
+ set prefix [ui_prefix_default $priority]
+ }
+ set stages {fetch checksum}
+ try {
+ eval ::ui_init $priority $prefix $channels($priority) $args
+ } catch * {
+ interp alias {} ui_$priority {} ui_message $priority $prefix ""
+ foreach stage $stages {
+ interp alias {} ui_${priority}_${stage} {} ui_message $priority $prefix $stage
+ }
+ }
+ # Call ui_$priority
+ eval ::ui_$priority $args
+
+}
# Default implementation of ui_prefix
proc macports::ui_prefix_default {priority} {
@@ -520,6 +575,12 @@
set macports::portautoclean "yes"
global macports::portautoclean
}
+ # keeplogs option
+ if {![info exists keeplogs]} {
+ set macports::keeplogs "yes"
+ global macports::keeplogs
+ }
+
# Check command line override for autoclean
if {[info exists macports::global_options(ports_autoclean)]} {
if {![string equal $macports::global_options(ports_autoclean) $portautoclean]} {
@@ -798,11 +859,17 @@
$workername alias mport_open mportopen
$workername alias mport_close mportclose
$workername alias mport_lookup mportlookup
+ $workername alias ui_phase ui_phase
# instantiate the UI call-backs
foreach priority ${macports::ui_priorities} {
$workername alias ui_$priority ui_$priority
+ foreach stage ${macports::port_stages} {
+ $workername alias ui_${priority}_${stage} ui_${priority}_${stage}
+ }
+
}
+
$workername alias ui_prefix ui_prefix
$workername alias ui_channels ui_channels
@@ -1363,6 +1430,11 @@
### _mportexec is private; may change without notice
proc _mportexec {target mport} {
+ global ::debuglog
+ set previouslog $::debuglog
+ set portname [_mportkey $mport name]
+ ui_debug "Starting logging for $portname"
+ macports::ch_logging $portname
# xxx: set the work path?
set workername [ditem_key $mport workername]
if {![catch {$workername eval check_variants variations $target} result] && $result == 0 &&
@@ -1378,9 +1450,11 @@
catch {cd $portpath}
$workername eval eval_targets clean
}
+ set ::debuglog $previouslog
return 0
} else {
# An error occurred.
+ set ::debuglog $previouslog
return 1
}
}
@@ -1394,6 +1468,8 @@
if {[$workername eval check_variants variations $target] != 0} {
return 1
}
+ set portname [_mportkey $mport name]
+ macports::init_logging $portname
# Before we build the port, we must build its dependencies.
# XXX: need a more general way of comparing against targets
Modified: branches/images-and-archives/base/src/package1.0/portdmg.tcl
===================================================================
--- branches/images-and-archives/base/src/package1.0/portdmg.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/package1.0/portdmg.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -1,4 +1,4 @@
-# et:ts=4
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# portdmg.tcl
# $Id$
#
@@ -58,7 +58,7 @@
if {[expr (${portrevision} > 0)]} {
set imagename "${portname}-${portversion}-${portrevision}"
} else {
- set imagename "${portname}-${portversion}"
+ set imagename "${portname}-${portversion}"
}
set tmp_image ${package.destpath}/${imagename}.tmp.dmg
@@ -67,41 +67,22 @@
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}]"
- return 0
+ return 0
}
-
- # size for .dmg
- set size [dirSize ${pkgpath}]
- if {[expr ($size < 4194304)]} {
- # there is a minimum of 8292 512 blocks in a dmg
- set blocks 8292
- } else {
- # this should later be replaced with hdiutil create -srcfolder
- set blocks [expr ($size/512) + ((($size/512)*3)/100)]
- }
-
+
# partition for .dmg
if {${os.major} >= 9 && ${os.arch} == "i386"} {
- # GUID_partition_scheme
+ # GUID_partition_scheme
set subdev 1
} else {
- # Apple_partition_scheme (Apple_partition_map is at s1)
+ # Apple_partition_scheme (Apple_partition_map is at s1)
set subdev 2
}
set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
- if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
+ if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${pkgpath} ${tmp_image}"] != ""} {
return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
}
- if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
- return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
- }
- set attach_output [split $attach_output "\t"]
- set devicename [string trim [lindex $attach_output 0]]
- set mount_point [string trim [lindex $attach_output 2]]
- regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
- system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
- system "$hdiutil detach ${devicename} -quiet"
if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
}
Modified: branches/images-and-archives/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/images-and-archives/base/src/package1.0/portmdmg.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/package1.0/portmdmg.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -1,4 +1,4 @@
-# et:ts=4
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# portmdmg.tcl
# $Id$
#
@@ -58,7 +58,7 @@
if {[expr (${portrevision} > 0)]} {
set imagename "${portname}-${portversion}-${portrevision}"
} else {
- set imagename "${portname}-${portversion}"
+ set imagename "${portname}-${portversion}"
}
set tmp_image ${package.destpath}/${imagename}.tmp.dmg
@@ -67,47 +67,22 @@
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}]"
- return 0
+ return 0
}
-
- # size for .dmg
- set size [dirSize ${mpkgpath}]
- if {[expr ($size < 4194304)]} {
- # there is a minimum of 8292 512 blocks in a dmg
- set blocks 8292
- } else {
- # this is now replaced with hdiutil create -srcfolder
- set blocks [expr ($size/512) + ((($size/512)*3)/100)]
- }
-
+
# partition for .dmg
if {${os.major} >= 9 && ${os.arch} == "i386"} {
- # GUID_partition_scheme
+ # GUID_partition_scheme
set subdev 1
} else {
- # Apple_partition_scheme (Apple_partition_map is at s1)
+ # Apple_partition_scheme (Apple_partition_map is at s1)
set subdev 2
}
- set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
- if {false} {
- if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
- return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
- }
- if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
- return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
- }
- set attach_output [split $attach_output "\t"]
- set devicename [string trim [lindex $attach_output 0]]
- set mount_point [string trim [lindex $attach_output 2]]
- regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
- system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
- system "$hdiutil detach ${devicename} -quiet"
- } else {
+ set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
}
- }
if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
}
Property changes on: branches/images-and-archives/base/src/pextlib1.0/sha256cmd.c
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.c:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.c:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.c:44044-44692
+ /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.c:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.c:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.c:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.c:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.c:44044-44692
Property changes on: branches/images-and-archives/base/src/pextlib1.0/sha256cmd.h
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.h:37343-46937
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.h:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.h:44044-44692
+ /branches/gsoc08-privileges/base/src/pextlib1.0/rmd160cmd.h:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/sha256cmd.h:51231-60371
/branches/universal-sanity/base/src/pextlib1.0/rmd160cmd.h:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/rmd160cmd.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes/src/pextlib1.0/rmd160cmd.h:45682-46060
/users/perry/base-select/src/pextlib1.0/rmd160cmd.h:44044-44692
Modified: branches/images-and-archives/base/src/port/port-help.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port-help.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port/port-help.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -35,8 +35,16 @@
--dist Removes downloaded distfiles
--work Removes work directory (default)
--all Removes everything from above
+--logs Removes log files for port
}
+set porthelp(log) {
+Shows main log for given ports
+
+--phase <phase> Filteres log file by phase (configure, fetch, etc..)
+--verbosity <ver> Filteres log file by verbosity level (msg, debug, info)
+}
+
set porthelp(configure) {
Configure the given ports
}
Modified: branches/images-and-archives/base/src/port/port.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port/port.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -155,7 +155,6 @@
}
}
-
# Form a composite version as is sometimes used for registry functions
proc composite_version {version variations {emptyVersionOkay 0}} {
# Form a composite version out of the version and variations
@@ -435,11 +434,11 @@
if {[isatty stdout]} {
set size [term_get_size stdout]
- if {![info exists env(LINES)]} {
+ if {![info exists env(LINES)] && [lindex $size 0] > 0} {
set env(LINES) [lindex $size 0]
}
- if {![info exists env(COLUMNS)]} {
+ if {![info exists env(COLUMNS)] && [lindex $size 1] > 0} {
set env(COLUMNS) [lindex $size 1]
}
}
@@ -1395,6 +1394,94 @@
}
+proc action_log { action portlist opts } {
+ global global_options
+ set logfile "$macports::prefix/var/macports/logs/"
+ #puts "$opts"
+ if {[llength $portlist] == 0} {
+ print_help
+ return 0
+ }
+ foreachport $portlist {
+ # If we have a url, use that, since it's most specific
+ # otherwise try to map the portname to a url
+ if {$porturl eq ""} {
+ # Verify the portname, getting portinfo to map to a porturl
+ if {[catch {mportlookup $portname} result]} {
+ ui_debug "$::errorInfo"
+ break_softcontinue "lookup of portname $portname failed: $result" 1 status
+ }
+ if {[llength $result] < 2} {
+ break_softcontinue "Port $portname not found" 1 status
+ }
+ array unset portinfo
+ array set portinfo [lindex $result 1]
+ set porturl $portinfo(porturl)
+ set portdir $portinfo(portdir)
+ } elseif {$porturl ne "file://."} {
+ # Extract the portdir from porturl and use it to search PortIndex.
+ # Only the last two elements of the path (porturl) make up the
+ # portdir.
+ set portdir [file split [macports::getportdir $porturl]]
+ set lsize [llength $portdir]
+ set portdir \
+ [file join [lindex $portdir [expr $lsize - 2]] \
+ [lindex $portdir [expr $lsize - 1]]]
+ if {[catch {mportsearch $portdir no exact portdir} result]} {
+ ui_debug "$::errorInfo"
+ break_softcontinue "Portdir $portdir not found" 1 status
+ }
+ if {[llength $result] < 2} {
+ break_softcontinue "Portdir $portdir not found" 1 status
+ }
+ array unset portinfo
+ array set portinfo [lindex $result 1]
+ }
+ if {[catch {set mport [mportopen $porturl [array get options] [array get merged_variations]]} result]} {
+ ui_debug "$::errorInfo"
+ break_softcontinue "Unable to open port: $result" 1 status
+ }
+ array unset portinfo
+ array set portinfo [mportinfo $mport]
+
+ append logfile $portinfo(name)
+ append logfile "/main.log"
+ mportclose $mport
+ if {[file exists $logfile]} {
+ set fp [open $logfile r]
+ set data [read $fp]
+ set data [split $data "\n"]
+
+ if {[info exists global_options(ports_log_phase)]} {
+ set stage $global_options(ports_log_phase);
+ } else {
+ set stage "\[a-z\]*"
+ }
+
+ if {[info exists global_options(ports_log_verbosity)]} {
+ set prefix $global_options(ports_log_verbosity);
+ } else {
+ set prefix "\[a-z\]*"
+ }
+ set match ""
+ foreach line $data {
+ set exp "^:($prefix|any):($stage|any) .*$"
+ regexp $exp $line match
+ if {$match == $line} {
+ regsub "^:\[a-z\]*:\[a-z\]* " $line "" line
+ puts $line
+ }
+ }
+
+ close $fp
+ } else {
+ ui_msg "Log file not found"
+ }
+ }
+ return 0
+}
+
+
proc action_info { action portlist opts } {
global global_variations
set status 0
@@ -2977,6 +3064,7 @@
notes [list action_notes [action_args_const ports]] \
provides [list action_provides [action_args_const strings]] \
installimage [list action_installimage [action_args_const strings]] \
+ log [list action_log [action_args_const ports]] \
\
activate [list action_activate [action_args_const ports]] \
deactivate [list action_deactivate [action_args_const ports]] \
@@ -3099,10 +3187,11 @@
selfupdate {nosync}
uninstall {follow-dependents}
variants {index}
- clean {all dist work}
+ clean {all dist work logs}
mirror {new}
lint {nitpick}
select {list set show}
+ log {{phase 1} {verbosity 1}}
upgrade {force enforce-variants no-replace}
}
@@ -3637,6 +3726,7 @@
set global_options_base [array get global_options]
# First process any remaining args as action(s)
+global exit_status
set exit_status 0
if { [llength $remaining_args] > 0 } {
Modified: branches/images-and-archives/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- branches/images-and-archives/base/src/port1.0/port_autoconf.tcl.in 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port1.0/port_autoconf.tcl.in 2009-11-10 10:24:23 UTC (rev 60373)
@@ -35,7 +35,6 @@
variable cp_path "@CP@"
variable cpio_path "@CPIO@"
variable diff_path "@DIFF@"
- variable ditto_path "@DITTO@"
variable dscl_path "@DSCL@"
variable file_path "@FILE@"
variable cvs_path "@CVS@"
Modified: branches/images-and-archives/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portchecksum.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port1.0/portchecksum.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -236,7 +236,7 @@
ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
} else {
ui_error "[format [msgcat::mc "Checksum (%s) mismatch for %s"] $type $distfile]"
- ui_info "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
+ ui_info_fetch "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
ui_info "[format [msgcat::mc "Distfile checksum: %s %s %s"] $distfile $type $calculated_sum]"
# Raise the failure flag
Modified: branches/images-and-archives/base/src/port1.0/portclean.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portclean.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port1.0/portclean.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -57,8 +57,9 @@
proc portclean::clean_main {args} {
global UI_PREFIX
- global ports_clean_dist ports_clean_work
+ global ports_clean_dist ports_clean_work ports_clean_logs
global ports_clean_all usealtworkpath
+ global keeplogs
if {[info exists ports_clean_all] && $ports_clean_all == "yes" || \
[info exists ports_clean_dist] && $ports_clean_dist == "yes"} {
@@ -67,6 +68,9 @@
}
ui_info "$UI_PREFIX [format [msgcat::mc "Removing build directory for %s"] [option name]]"
clean_work
+ if {([info exists ports_clean_logs] && $ports_clean_logs == "yes") || ($keeplogs == "no")} {
+ clean_logs
+ }
# start gsoc-08 privileges
if {[info exists usealtworkpath] && $usealtworkpath == "yes"} {
@@ -188,4 +192,18 @@
return 0
}
+proc portclean::clean_logs {args} {
+ global portbuildpath worksymlink name portverbose keeplogs prefix
+ set logpath "${prefix}/var/macports/logs/${name}"
+ if {[file isdirectory $logpath]} {
+ ui_debug "Removing directory: ${logpath}"
+ if {[catch {delete $logpath} result]} {
+ ui_debug "$::errorInfo"
+ ui_error "$result"
+ }
+ } else {
+ ui_debug "No log directory found to remove at ${logpath}"
+ }
+ return 0
+}
Modified: branches/images-and-archives/base/src/port1.0/portmain.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portmain.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port1.0/portmain.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -48,6 +48,7 @@
options long_description description homepage license provides conflicts replaced_by
options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
options universal_variant os.universal_supported
+options copy_log_files
options compiler.cpath compiler.library_path
# Export options via PortInfo
Modified: branches/images-and-archives/base/src/port1.0/portutil.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portutil.tcl 2009-11-10 09:51:08 UTC (rev 60372)
+++ branches/images-and-archives/base/src/port1.0/portutil.tcl 2009-11-10 10:24:23 UTC (rev 60373)
@@ -358,6 +358,8 @@
if {[option macosx_deployment_target] ne ""} {
set ${command}.env_array(MACOSX_DEPLOYMENT_TARGET) [option macosx_deployment_target]
}
+ set ${command}.env_array(CC_PRINT_OPTIONS) "YES"
+ set ${command}.env_array(CC_PRINT_OPTIONS_FILE) [file join [option workpath] ".CC_PRINT_OPTIONS"]
if {[option compiler.cpath] ne ""} {
set ${command}.env_array(CPATH) [join [option compiler.cpath] :]
}
@@ -1197,7 +1199,7 @@
set ports_dry_last_skipped ""
proc target_run {ditem} {
- global target_state_fd workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped
+ global target_state_fd workpath ports_trace PortInfo ports_dryrun ports_dry_last_skipped current_stage worksrcpath prefix
set portname [option name]
set result 0
set skipped 0
@@ -1248,7 +1250,7 @@
if {[ditem_contains $ditem prerun]} {
set result [catch {[ditem_key $ditem prerun] $targetname} errstr]
}
-
+ ui_phase $target
#start tracelib
if {($result ==0
&& [info exists ports_trace]
@@ -1358,6 +1360,18 @@
}
}
}
+ if {[exists copy_log_files]} {
+ set log_files [option copy_log_files]
+ set log_dir "$prefix/var/macports/logs/$portname"
+ file mkdir $log_dir
+
+ foreach log_file $log_files {
+ set from "$worksrcpath/$log_file"
+ if {[file exists $from]} {
+ file copy -force $from $log_dir
+ }
+ }
+ }
if {$result == 0} {
# Only write to state file if:
# - we indeed performed this step.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091110/cc5e444b/attachment-0001.html>
More information about the macports-changes
mailing list