<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[120453] branches/gsoc14-cleanup</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/120453">120453</a></dd>
<dt>Author</dt> <dd>ksammons@macports.org</dd>
<dt>Date</dt> <dd>2014-05-28 11:31:32 -0700 (Wed, 28 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge branch 'svn'</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesgsoc14cleanupconfiglog">branches/gsoc14-cleanup/config.log</a></li>
<li><a href="#branchesgsoc14cleanupsrcmacports10pkgIndextcl">branches/gsoc14-cleanup/src/macports1.0/pkgIndex.tcl</a></li>
<li><a href="#branchesgsoc14cleanupsrcportport">branches/gsoc14-cleanup/src/port/port</a></li>
<li><a href="#branchesgsoc14cleanupsrcportporttcl">branches/gsoc14-cleanup/src/port/port.tcl</a></li>
<li><a href="#branchesgsoc14cleanupsrcport10portcleantcl">branches/gsoc14-cleanup/src/port1.0/portclean.tcl</a></li>
<li><a href="#branchesgsoc14cleanupvendortcl8515unixconfiglog">branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/config.log</a></li>
<li><a href="#branchesgsoc14cleanupvendortcl8515unixlibtcl85dylib">branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/libtcl8.5.dylib</a></li>
<li><a href="#branchesgsoc14cleanupvendortcllib115configlog">branches/gsoc14-cleanup/vendor/tcllib-1.15/config.log</a></li>
<li><a href="#branchesgsoc14cleanupvendortclx84configlog">branches/gsoc14-cleanup/vendor/tclx8.4/config.log</a></li>
<li><a href="#branchesgsoc14cleanupvendorthread270configlog">branches/gsoc14-cleanup/vendor/thread2.7.0/config.log</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchesgsoc14cleanupsrcmacports10reclaimtcl">branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesgsoc14cleanupconfiglog"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/config.log (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/config.log        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/config.log        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> ## Platform. ##
</span><span class="cx"> ## --------- ##
</span><span class="cx">
</span><del>-hostname = 128-223-223-224-wireless.uoregon.edu
</del><ins>+hostname = 128-223-223-240-wireless.uoregon.edu
</ins><span class="cx"> uname -m = x86_64
</span><span class="cx"> uname -r = 13.1.0
</span><span class="cx"> uname -s = Darwin
</span><span class="lines">@@ -30,8 +30,8 @@
</span><span class="cx"> Processor type: i486 (Intel 80486)
</span><span class="cx"> Processors active: 0 1 2 3 4 5 6 7
</span><span class="cx"> Primary memory available: 8.00 gigabytes
</span><del>-Default processor set: 172 tasks, 849 threads, 8 processors
-Load average: 0.59, Mach factor: 7.40
</del><ins>+Default processor set: 176 tasks, 822 threads, 8 processors
+Load average: 1.36, Mach factor: 6.63
</ins><span class="cx"> /bin/machine = unknown
</span><span class="cx"> /usr/bin/oslevel = unknown
</span><span class="cx"> /bin/universe = unknown
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx"> 5 warnings generated.
</span><span class="cx"> Undefined symbols for architecture x86_64:
</span><span class="cx"> "_objc_lookup_class", referenced from:
</span><del>- _main in conftest-5aed55.o
</del><ins>+ _main in conftest-f2a391.o
</ins><span class="cx"> ld: symbol(s) not found for architecture x86_64
</span><span class="cx"> clang: error: linker command failed with exit code 1 (use -v to see invocation)
</span><span class="cx"> configure:7425: $? = 1
</span><span class="lines">@@ -1036,7 +1036,7 @@
</span><span class="cx"> configure:8777: clang -o conftest -g -O2 conftest.c >&5
</span><span class="cx"> Undefined symbols for architecture x86_64:
</span><span class="cx"> "_clearenv", referenced from:
</span><del>- _main in conftest-492e61.o
</del><ins>+ _main in conftest-a7d7dd.o
</ins><span class="cx"> ld: symbol(s) not found for architecture x86_64
</span><span class="cx"> clang: error: linker command failed with exit code 1 (use -v to see invocation)
</span><span class="cx"> configure:8777: $? = 1
</span><span class="lines">@@ -1396,7 +1396,6 @@
</span><span class="cx"> configure:9633: result: /usr/bin/gzip
</span><span class="cx"> configure:9643: checking for bzip2
</span><span class="cx"> configure:9673: result: /usr/bin/bzip2
</span><del>-configure:9689: === extracting vendor/tcl8.5.15-src.tar.gz
</del><span class="cx"> configure:9753: === configuring in vendor/tcl8.5.15/unix (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tcl8.5.15/unix)
</span><span class="cx"> configure:9994: running /bin/sh ./configure '--cache-file=/dev/null' '--disable-option-checking' '--prefix=/opt/local/libexec/macports' '--enable-threads' '--enable-readline' '--srcdir=.' in vendor/tcl8.5.15/unix
</span><span class="cx"> configure:10000: === finished configuring in vendor/tcl8.5.15/unix (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tcl8.5.15/unix)
</span><span class="lines">@@ -1404,7 +1403,6 @@
</span><span class="cx"> configure:10050: result: /usr/bin/gzip
</span><span class="cx"> configure:10060: checking for bzip2
</span><span class="cx"> configure:10090: result: /usr/bin/bzip2
</span><del>-configure:10106: === extracting vendor/thread2.7.0.tar.gz
</del><span class="cx"> configure:10170: === configuring in vendor/thread2.7.0 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/thread2.7.0)
</span><span class="cx"> configure:10411: running /bin/sh ./configure '--cache-file=/dev/null' '--disable-option-checking' '--prefix=/opt/local/libexec/macports' '--enable-readline' '--srcdir=.' in vendor/thread2.7.0
</span><span class="cx"> configure:10417: === finished configuring in vendor/thread2.7.0 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/thread2.7.0)
</span><span class="lines">@@ -1412,7 +1410,6 @@
</span><span class="cx"> configure:10462: result: /usr/bin/gzip
</span><span class="cx"> configure:10472: checking for bzip2
</span><span class="cx"> configure:10502: result: /usr/bin/bzip2
</span><del>-configure:10518: === extracting vendor/tclx8.4.1.tar.bz2
</del><span class="cx"> configure:10582: === configuring in vendor/tclx8.4 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tclx8.4)
</span><span class="cx"> configure:10823: running /bin/sh ./configure '--cache-file=/dev/null' '--disable-option-checking' '--prefix=/opt/local/libexec/macports' '--enable-readline' '--srcdir=.' in vendor/tclx8.4
</span><span class="cx"> configure:10829: === finished configuring in vendor/tclx8.4 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tclx8.4)
</span><span class="lines">@@ -1420,7 +1417,6 @@
</span><span class="cx"> configure:10876: result: /usr/bin/gzip
</span><span class="cx"> configure:10886: checking for bzip2
</span><span class="cx"> configure:10916: result: /usr/bin/bzip2
</span><del>-configure:10932: === extracting vendor/tcllib-1.15.tar.gz
</del><span class="cx"> configure:10996: === configuring in vendor/tcllib-1.15 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tcllib-1.15)
</span><span class="cx"> configure:11237: running /bin/sh ./configure '--cache-file=/dev/null' '--disable-option-checking' '--prefix=/opt/local/libexec/macports' '--enable-readline' '--srcdir=.' in vendor/tcllib-1.15
</span><span class="cx"> configure:11243: === finished configuring in vendor/tcllib-1.15 (/Users/mrappleseed/GSoC/mports/trunk/base/vendor/tcllib-1.15)
</span><span class="lines">@@ -1447,7 +1443,7 @@
</span><span class="cx"> CONFIG_COMMANDS =
</span><span class="cx"> $ ./config.status
</span><span class="cx">
</span><del>-on 128-223-223-224-wireless.uoregon.edu
</del><ins>+on 128-223-223-240-wireless.uoregon.edu
</ins><span class="cx">
</span><span class="cx"> config.status:1047: creating src/programs/daemondo/Makefile
</span><span class="cx"> config.status:1047: creating Doxyfile
</span><span class="lines">@@ -1487,6 +1483,7 @@
</span><span class="cx"> config.status:1047: creating src/pkg_mkindex.sh
</span><span class="cx"> config.status:1047: creating src/upgrade_sources_conf_default.tcl
</span><span class="cx"> config.status:1047: creating src/config.h
</span><ins>+config.status:1222: src/config.h is unchanged
</ins><span class="cx">
</span><span class="cx"> ## ---------------- ##
</span><span class="cx"> ## Cache variables. ##
</span></span></pre></div>
<a id="branchesgsoc14cleanupsrcmacports10pkgIndextcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/macports1.0/pkgIndex.tcl (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/macports1.0/pkgIndex.tcl        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/src/macports1.0/pkgIndex.tcl        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -11,3 +11,4 @@
</span><span class="cx"> package ifneeded macports 1.0 [list load [file join $dir MacPorts.dylib]]\n[list source [file join $dir macports.tcl]]\n[list source [file join $dir macports_autoconf.tcl]]
</span><span class="cx"> package ifneeded macports_dlist 1.0 [list source [file join $dir macports_dlist.tcl]]
</span><span class="cx"> package ifneeded macports_util 1.0 [list source [file join $dir macports_util.tcl]]
</span><ins>+package ifneeded reclaim 1.0 [list source [file join $dir reclaim.tcl]]
</ins></span></pre></div>
<a id="branchesgsoc14cleanupsrcmacports10reclaimtcl"></a>
<div class="addfile"><h4>Added: branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl (0 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl         (rev 0)
+++ branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+# -*- 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
+
+# TODO:
+# Add distfile version checking.
+# Remove the useless/structure comments and add actual docstrings.
+# Pretty sure we should be using ui_msg, instead of puts and what not. Should probably add that.
+# Add test cases
+# Add copyright notice
+
+# Finished:
+# Register the "port cleanup" command with port.tcl and all that involves.
+# Implement a hash-map, or multidimensional array for ease of app info keeping. Write it yourself if you have to.
+# Figure out what the hell is going on with "port clean all" vs "port clean installed" the 'clean' target is provided by this package
+
+package provide reclaim 1.0
+package require macports
+
+namespace eval reclaim {
+}
+
+proc reclaim::main {args} {
+
+ # The main function. Calls each individual function that needs to be run.
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ uninstall_inactive
+ check_distfiles
+}
+
+proc walk_files {dir delete} {
+
+ # Recursively walk through each item in the given directory and if requested, delete each file that isn't a directory.
+ # Args:
+ # dir - A string path of the given directory to walk through
+ # delete - Whether to delete each file found that isn't a directory or not. Set to 'yes' or 'no'.
+ # Returns:
+ # None
+
+ foreach item [readdir $dir] {
+
+ set currentPath [file join $dir $item]
+
+ if {[file isdirectory $currentPath]} {
+ walk_files $currentPath $delete
+
+ } else {
+ puts "Found distfile: $item"
+
+ if {$delete eq "yes"} {
+ set path [file join $dir $item]
+ puts "Removing distfile: $item"
+
+ #Because we're only deleting files (not directories) that we know exist, if there was an error, it's because of lack of root privledges.
+ if {[catch {file delete $path} result]} {
+ elevateToRoot "reclaim"
+ file delete $path
+ }
+ }
+ }
+ }
+}
+
+proc check_distfiles {} {
+
+ # Check for distfiles in both the root, and home directories. If found, delete them.
+ # Args:
+ # None
+ #
+ # Returns:
+ # 0 on successful execution
+
+ global macports::portdbpath
+ global macports::user_home
+
+ # The root and home distfile folder locations, respectively.
+ set root [file join ${macports::portdbpath} distfiles]
+ set home ${macports::user_home}/.macports$root
+
+ # Walk through each directory, and delete any files found.
+ walk_files $root yes
+ walk_files $home yes
+
+ # Returning 0 is in style this year.
+ return 0
+}
+
+proc is_inactive {app} {
+
+ # Determine's whether an application is inactive or not.
+ # Args:
+ # app - An array where the fourth item in it is the activity of the application.
+ # Returns:
+ # 1 if inactive, 0 if active.
+
+ if {[lindex $app 4] == 0} {
+ return 1
+ }
+ return 0
+}
+
+proc get_info {} {
+
+ # Get's the information of all installed appliations (those returned by registry::instaled), and returns it in a
+ # multidimensional list.
+ #
+ # Args:
+ # None
+ #Returns:
+ # A multidimensional list where each app is a sublist, i.e., {{First Application Info} {Second Application Info} {...}}
+ # Indexes of each sublist are: 0 = name, 1 = version, 2 = revision, 3 = variets, 4 = activity, and 5 = epoch.
+
+ set installed_apps [registry::installed]
+ set app_info [list]
+
+ foreach app $installed_apps {
+
+ set name [lindex $app 0]
+ set version [lindex $app 1]
+ set revision [lindex $app 2]
+ set varients [lindex $app 3]
+ set active [lindex $app 4]
+ set epoch [lindex $app 5]
+
+ lappend app_info [list $name $version $revision $varients $active $epoch]
+ }
+
+ return $app_info
+}
+
+proc uninstall_inactive {} {
+
+ # Attempts to uninstall all inactive applications. (Performance is now O(N)!)
+ #
+ # Args:
+ # None
+ # Returns:
+ # 0 if execution was successful.
+
+ set apps [get_info]
+ set inactive_count 0
+
+ foreach app $apps {
+
+ if { [is_inactive $app] } {
+ set name [lindex $app 0]
+ puts "Uninstalling: $name"
+ incr inactive_count
+
+ # Note: 'uninstall' takes a name, version, and an options list.
+ registry_uninstall [lindex $app 0] [lindex $app 1] {}
+ }
+ }
+ if { $inactive_count == 0 } {
+ puts "Found no inactive ports."
+ }
+
+ return 0
+}
+
+
</ins></span></pre></div>
<a id="branchesgsoc14cleanupsrcportport"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/port/port (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/port/port        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/src/port/port        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> # -*- 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
</span><span class="cx"> # $Id: port.tcl 119177 2014-04-18 22:35:29Z cal@macports.org $
</span><span class="cx"> #
</span><del>-# Copyright (c) 2004-2013 The MacPorts Project
</del><ins>+# Copyright (c) 2004-2014 The MacPorts Project
</ins><span class="cx"> # Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
</span><span class="cx"> # Copyright (c) 2002-2003 Apple Inc.
</span><span class="cx"> # All rights reserved.
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> package require macports
</span><ins>+package require reclaim 1.0
</ins><span class="cx"> package require Pextlib 1.0
</span><span class="cx">
</span><span class="cx"> # Standard procedures
</span><span class="lines">@@ -2731,6 +2732,11 @@
</span><span class="cx"> return $status
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+proc action_reclaim { action portlist opts } {
+ reclaim::main
+ return 0
+}
+
</ins><span class="cx"> proc action_revupgrade { action portlist opts } {
</span><span class="cx"> set status [macports::revupgrade $opts]
</span><span class="cx"> if {$status != 0} {
</span><span class="lines">@@ -4176,6 +4182,7 @@
</span><span class="cx"> \
</span><span class="cx"> upgrade [list action_upgrade [ACTION_ARGS_PORTS]] \
</span><span class="cx"> rev-upgrade [list action_revupgrade [ACTION_ARGS_NONE]] \
</span><ins>+ reclaim [list action_reclaim [ACTION_ARGS_NONE]] \
</ins><span class="cx"> \
</span><span class="cx"> version [list action_version [ACTION_ARGS_NONE]] \
</span><span class="cx"> platform [list action_platform [ACTION_ARGS_NONE]] \
</span><span class="lines">@@ -4331,7 +4338,7 @@
</span><span class="cx"> install {no-rev-upgrade unrequested}
</span><span class="cx"> uninstall {follow-dependents follow-dependencies no-exec}
</span><span class="cx"> variants {index}
</span><del>- clean {all archive dist work logs}
</del><ins>+ clean {all archive dist work logs gsoc14}
</ins><span class="cx"> mirror {new}
</span><span class="cx"> lint {nitpick}
</span><span class="cx"> select {list set show summary}
</span></span></pre></div>
<a id="branchesgsoc14cleanupsrcportporttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/port/port.tcl (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/port/port.tcl        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/src/port/port.tcl        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> # -*- 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
</span><span class="cx"> # $Id: port.tcl 119177 2014-04-18 22:35:29Z cal@macports.org $
</span><span class="cx"> #
</span><del>-# Copyright (c) 2004-2013 The MacPorts Project
</del><ins>+# Copyright (c) 2004-2014 The MacPorts Project
</ins><span class="cx"> # Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
</span><span class="cx"> # Copyright (c) 2002-2003 Apple Inc.
</span><span class="cx"> # All rights reserved.
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> package require macports
</span><ins>+package require reclaim 1.0
</ins><span class="cx"> package require Pextlib 1.0
</span><span class="cx">
</span><span class="cx"> # Standard procedures
</span><span class="lines">@@ -2731,6 +2732,11 @@
</span><span class="cx"> return $status
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+proc action_reclaim { action portlist opts } {
+ reclaim::main
+ return 0
+}
+
</ins><span class="cx"> proc action_revupgrade { action portlist opts } {
</span><span class="cx"> set status [macports::revupgrade $opts]
</span><span class="cx"> if {$status != 0} {
</span><span class="lines">@@ -4176,6 +4182,7 @@
</span><span class="cx"> \
</span><span class="cx"> upgrade [list action_upgrade [ACTION_ARGS_PORTS]] \
</span><span class="cx"> rev-upgrade [list action_revupgrade [ACTION_ARGS_NONE]] \
</span><ins>+ reclaim [list action_reclaim [ACTION_ARGS_NONE]] \
</ins><span class="cx"> \
</span><span class="cx"> version [list action_version [ACTION_ARGS_NONE]] \
</span><span class="cx"> platform [list action_platform [ACTION_ARGS_NONE]] \
</span><span class="lines">@@ -4331,7 +4338,7 @@
</span><span class="cx"> install {no-rev-upgrade unrequested}
</span><span class="cx"> uninstall {follow-dependents follow-dependencies no-exec}
</span><span class="cx"> variants {index}
</span><del>- clean {all archive dist work logs}
</del><ins>+ clean {all archive dist work logs gsoc14}
</ins><span class="cx"> mirror {new}
</span><span class="cx"> lint {nitpick}
</span><span class="cx"> select {list set show summary}
</span></span></pre></div>
<a id="branchesgsoc14cleanupsrcport10portcleantcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/port1.0/portclean.tcl (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/port1.0/portclean.tcl        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/src/port1.0/portclean.tcl        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -34,17 +34,7 @@
</span><span class="cx"> # the 'clean' target is provided by this package
</span><span class="cx">
</span><span class="cx">
</span><del>-# TODO:
-# Register the "port clean inactive" command with port.tcl and all that involves.
-# Add distfile version checking.
-# Add multiple version checking. Test with multiple versions of Python? Or Perl? Or some other common multi-versioned software (Gimp?).
-# Add docstrings for the rest of the functions in here at the end. Lack of documentation is sad.
-# Remove the useless/structure comments and add actual docstrings.
</del><span class="cx">
</span><del>-# Finished:
-# Implement a hash-map, or multidimensional array for ease of app info keeping. Write it yourself if you have to.
-# Figure out what the hell is going on with "port clean all" vs "port clean installed" the 'clean' target is provided by this package
-
</del><span class="cx"> package provide portclean 1.0
</span><span class="cx">
</span><span class="cx"> package require portutil 1.0
</span><span class="lines">@@ -62,95 +52,6 @@
</span><span class="cx">
</span><span class="cx"> set_ui_prefix
</span><span class="cx">
</span><del>-proc is_inactive {app} {
-
- # Determine's whether an application is inactive or not.
- # Args:
- # app - An array where the fourth item in it is the activity of the application.
- # Returns:
- # 1 if inactive, 0 if active.
-
- if {[lindex $app 4] == 1} {
- return 1
- }
- return 0
-}
-
-proc portclean::get_info {} {
-
- # Get's the information of all installed appliations (those returned by registry::instaled), and returns it in a
- # multidimensional list.
- #
- # Args:
- # None
- #Returns:
- # A multidimensional list where each app is a sublist, i.e., {{First Application Info} {Second Application Info} {...}}
- # Indexes of each sublist are: 0 = name, 1 = version, 2 = revision, 3 = variets, 4 = activity, and 5 = epoch.
-
- set installed_apps [registry::installed]
- set app_info [list]
-
- foreach app $installed_apps {
-
- set name [lindex $app 0]
- set version [lindex $app 1]
- set revision [lindex $app 2]
- set varients [lindex $app 3]
- set active [lindex $app 4]
- set epoch [lindex $app 5]
-
- lappend app_info [list $name $version $revision $varients $active $epoch]
- }
-
- return $app_info
-}
-
-proc delete_file {file} {
-
- # Attempts to delete a given file, and catches the errors if there are any.
- #
- # Args:
- # args - The file path
- # Returns:
- # None
-
- ui_debug "Removing file: $file"
- if {[catch {delete $file} result]} {
- ui_debug "$::errorInfo"
- ui_error "$result"
- }
-}
-
-proc portclean::clean_inactive {} {
-
- # Attempts to uninstall all inactive applications. (Performance is now O(N)!)
- #
- # Args:
- # None
- # Returns:
- # 0 if execution was successful.
-
- set apps [get_info]
- set inactive_count 0
-
- foreach app $apps {
-
- if { [is_inactive $app] } {
- set name [lindex $app 0]
- puts "Uninstalling: $name"
- incr inactive_count
-
- # Note: 'uninstall' takes a name, version, and an options list.
- registry_uninstall [lindex $app 0] [lindex $app 1] {}
- }
- }
- if { $inactive_count == 0 } {
- puts "Found no inactive ports."
- }
-
- return 0
-}
-
</del><span class="cx"> proc portclean::clean_start {args} {
</span><span class="cx"> global UI_PREFIX prefix
</span><span class="cx">
</span><span class="lines">@@ -162,7 +63,21 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> proc portclean::clean_main {args} {
</span><del>- global UI_PREFIX ports_clean_dist ports_clean_work ports_clean_logs \
</del><ins>+
+ # The main function. Picks which action to do based on which globals (ew) are set or not.
+ #
+ # Args (i.e. globals):
+ # ports_clean_dist - Determines whether to do 'port clean dist' or not. Set to 'yes' or 'no'.
+ # ports_clean_work - Determines whether to do 'port clean work' or not. Set to 'yes' or 'no'.
+ # ports_clean_logs - Determines whether to do 'port clean logs' or not. Set to 'yes' or 'no'.
+ # ports_clean_archive - Determines whether to do 'port clean archive' or not. Set to 'yes' or 'no'.
+ # ports_clean_all - Determines whether to do all 'port clean' operations. Set to 'yes' or 'no'.
+ # keeplogs - Determines whether to do 'port clean logs' or not. Set to 'yes' or 'no'.
+ #
+ # Returns:
+ # None
+
+ global UI_PREFIX ports_clean_dist ports_clean_work ports_clean_logs ports_clean_gsoc14 \
</ins><span class="cx"> ports_clean_archive ports_clean_all keeplogs usealtworkpath
</span><span class="cx">
</span><span class="cx"> if {$usealtworkpath} {
</span><span class="lines">@@ -192,10 +107,25 @@
</span><span class="cx"> && !$usealtworkpath} {
</span><span class="cx"> clean_logs
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> return 0
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+proc delete_file {args} {
+
+ # Attempts to delete a given file, and catches the errors if there are any.
+ #
+ # Args:
+ # args - The file path
+ # Returns:
+ # None
+
+ ui_debug "Removing file: $args"
+ if {[catch {delete $args} result]} {
+ ui_debug "$::errorInfo"
+ ui_error "$result"
+ }
+}
+
</ins><span class="cx"> #
</span><span class="cx"> # Remove the directory where the distfiles reside.
</span><span class="cx"> # This is crude, but works.
</span><span class="lines">@@ -203,11 +133,6 @@
</span><span class="cx"> proc portclean::clean_dist {} {
</span><span class="cx"> global name ports_force distpath dist_subdir distfiles patchfiles usealtworkpath portdbpath altprefix
</span><span class="cx">
</span><del>- puts "Name: $name"
- puts "Dispath: $distpath"
- puts "Disfiles: $distfiles"
- puts "Patchfiles: $patchfiles "
-
</del><span class="cx"> # remove known distfiles for sure (if they exist)
</span><span class="cx"> set count 0
</span><span class="cx"> foreach file $distfiles {
</span></span></pre></div>
<a id="branchesgsoc14cleanupvendortcl8515unixconfiglog"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/config.log (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/config.log        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/config.log        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> ## Platform. ##
</span><span class="cx"> ## --------- ##
</span><span class="cx">
</span><del>-hostname = 128-223-223-224-wireless.uoregon.edu
</del><ins>+hostname = 128-223-223-240-wireless.uoregon.edu
</ins><span class="cx"> uname -m = x86_64
</span><span class="cx"> uname -r = 13.1.0
</span><span class="cx"> uname -s = Darwin
</span><span class="lines">@@ -30,8 +30,8 @@
</span><span class="cx"> Processor type: i486 (Intel 80486)
</span><span class="cx"> Processors active: 0 1 2 3 4 5 6 7
</span><span class="cx"> Primary memory available: 8.00 gigabytes
</span><del>-Default processor set: 170 tasks, 851 threads, 8 processors
-Load average: 2.10, Mach factor: 5.89
</del><ins>+Default processor set: 178 tasks, 820 threads, 8 processors
+Load average: 2.37, Mach factor: 5.62
</ins><span class="cx"> /bin/machine = unknown
</span><span class="cx"> /usr/bin/oslevel = unknown
</span><span class="cx"> /bin/universe = unknown
</span><span class="lines">@@ -502,8 +502,8 @@
</span><span class="cx"> configure:4958: gcc -o conftest -pipe conftest.c -lpthread >&5
</span><span class="cx"> Undefined symbols for architecture x86_64:
</span><span class="cx"> "_pthread_attr_get_np", referenced from:
</span><del>- _main in conftest-d29c75.o
- _f in conftest-d29c75.o
</del><ins>+ _main in conftest-b7d110.o
+ _f in conftest-b7d110.o
</ins><span class="cx"> ld: symbol(s) not found for architecture x86_64
</span><span class="cx"> clang: error: linker command failed with exit code 1 (use -v to see invocation)
</span><span class="cx"> configure:4964: $? = 1
</span><span class="lines">@@ -583,8 +583,8 @@
</span><span class="cx"> configure:5094: gcc -o conftest -pipe conftest.c -lpthread >&5
</span><span class="cx"> Undefined symbols for architecture x86_64:
</span><span class="cx"> "_pthread_getattr_np", referenced from:
</span><del>- _main in conftest-0c4a52.o
- _f in conftest-0c4a52.o
</del><ins>+ _main in conftest-011784.o
+ _f in conftest-011784.o
</ins><span class="cx"> ld: symbol(s) not found for architecture x86_64
</span><span class="cx"> clang: error: linker command failed with exit code 1 (use -v to see invocation)
</span><span class="cx"> configure:5100: $? = 1
</span><span class="lines">@@ -2822,7 +2822,7 @@
</span><span class="cx"> CONFIG_COMMANDS =
</span><span class="cx"> $ ./config.status
</span><span class="cx">
</span><del>-on 128-223-223-224-wireless.uoregon.edu
</del><ins>+on 128-223-223-240-wireless.uoregon.edu
</ins><span class="cx">
</span><span class="cx"> config.status:725: creating Tcl-Info.plist
</span><span class="cx"> config.status:725: creating Tclsh-Info.plist
</span></span></pre></div>
<a id="branchesgsoc14cleanupvendortcl8515unixlibtcl85dylib"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/libtcl8.5.dylib (120452 => 120453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/libtcl8.5.dylib        2014-05-28 18:20:57 UTC (rev 120452)
+++ branches/gsoc14-cleanup/vendor/tcl8.5.15/unix/libtcl8.5.dylib        2014-05-28 18:31:32 UTC (rev 120453)
</span><span class="lines">@@ -1,41 +1,40 @@
</span><span class="cx"> \xCF\xFA\xED\xFE \xC0 \x85 \xC8 __TEXT
</span><del>- \x90 \x90 __text __TEXT \xF0