[124236] branches/gsoc14-interactive/base
shasha at macports.org
shasha at macports.org
Thu Aug 21 10:47:07 PDT 2014
Revision: 124236
https://trac.macports.org/changeset/124236
Author: shasha at macports.org
Date: 2014-08-21 10:47:06 -0700 (Thu, 21 Aug 2014)
Log Message:
-----------
Merge from trunk
Modified Paths:
--------------
branches/gsoc14-interactive/base/ChangeLog
branches/gsoc14-interactive/base/doc/Makefile.in
branches/gsoc14-interactive/base/doc/asciidoc.conf
branches/gsoc14-interactive/base/doc/port-activate.1
branches/gsoc14-interactive/base/doc/port-activate.1.txt
branches/gsoc14-interactive/base/doc/port-archivefetch.1
branches/gsoc14-interactive/base/doc/port-archivefetch.1.txt
branches/gsoc14-interactive/base/doc/port-cd.1
branches/gsoc14-interactive/base/doc/port-cd.1.txt
branches/gsoc14-interactive/base/doc/port-contents.1
branches/gsoc14-interactive/base/doc/port-contents.1.txt
branches/gsoc14-interactive/base/doc/port-dependents.1
branches/gsoc14-interactive/base/doc/port-dependents.1.txt
branches/gsoc14-interactive/base/doc/port-edit.1
branches/gsoc14-interactive/base/doc/port-edit.1.txt
branches/gsoc14-interactive/base/doc/port-rev-upgrade.1
branches/gsoc14-interactive/base/doc/port-rev-upgrade.1.txt
branches/gsoc14-interactive/base/doc/port-selfupdate.1
branches/gsoc14-interactive/base/doc/port-selfupdate.1.txt
branches/gsoc14-interactive/base/doc/port-uninstall.1
branches/gsoc14-interactive/base/doc/port-uninstall.1.txt
branches/gsoc14-interactive/base/src/darwintracelib1.0/darwintrace.c
branches/gsoc14-interactive/base/src/darwintracelib1.0/proc.c
branches/gsoc14-interactive/base/src/macports1.0/Makefile.in
branches/gsoc14-interactive/base/src/macports1.0/macports.tcl
branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in
branches/gsoc14-interactive/base/src/pextlib1.0/tracelib.c
branches/gsoc14-interactive/base/src/port/port.tcl
branches/gsoc14-interactive/base/src/port1.0/portfetch.tcl
branches/gsoc14-interactive/base/src/port1.0/porttrace.tcl
Added Paths:
-----------
branches/gsoc14-interactive/base/doc/port-dir.1
branches/gsoc14-interactive/base/doc/port-dir.1.txt
branches/gsoc14-interactive/base/doc/port-distcheck.1
branches/gsoc14-interactive/base/doc/port-distcheck.1.txt
branches/gsoc14-interactive/base/doc/port-distfiles.1
branches/gsoc14-interactive/base/doc/port-distfiles.1.txt
branches/gsoc14-interactive/base/doc/port-dmg.1
branches/gsoc14-interactive/base/doc/port-dmg.1.txt
branches/gsoc14-interactive/base/doc/port-doctor.1
branches/gsoc14-interactive/base/doc/port-doctor.1.txt
branches/gsoc14-interactive/base/doc/port-echo.1
branches/gsoc14-interactive/base/doc/port-echo.1.txt
branches/gsoc14-interactive/base/doc/port-exit.1
branches/gsoc14-interactive/base/doc/port-exit.1.txt
branches/gsoc14-interactive/base/doc/port-file.1
branches/gsoc14-interactive/base/doc/port-file.1.soelim
branches/gsoc14-interactive/base/doc/port-gohome.1
branches/gsoc14-interactive/base/doc/port-gohome.1.txt
branches/gsoc14-interactive/base/doc/port-info.1
branches/gsoc14-interactive/base/doc/port-info.1.txt
branches/gsoc14-interactive/base/doc/port-installed.1
branches/gsoc14-interactive/base/doc/port-installed.1.txt
branches/gsoc14-interactive/base/doc/port-lint.1
branches/gsoc14-interactive/base/doc/port-lint.1.txt
branches/gsoc14-interactive/base/doc/port-list.1
branches/gsoc14-interactive/base/doc/port-list.1.txt
branches/gsoc14-interactive/base/doc/port-livecheck.1
branches/gsoc14-interactive/base/doc/port-livecheck.1.txt
branches/gsoc14-interactive/base/doc/port-location.1
branches/gsoc14-interactive/base/doc/port-location.1.soelim
branches/gsoc14-interactive/base/doc/port-mdmg.1
branches/gsoc14-interactive/base/doc/port-mdmg.1.soelim
branches/gsoc14-interactive/base/doc/port-mpkg.1
branches/gsoc14-interactive/base/doc/port-mpkg.1.soelim
branches/gsoc14-interactive/base/doc/port-pkg.1
branches/gsoc14-interactive/base/doc/port-pkg.1.soelim
branches/gsoc14-interactive/base/doc/port-quit.1
branches/gsoc14-interactive/base/doc/port-quit.1.soelim
branches/gsoc14-interactive/base/doc/port-rdependents.1
branches/gsoc14-interactive/base/doc/port-rdependents.1.soelim
branches/gsoc14-interactive/base/doc/port-reclaim.1
branches/gsoc14-interactive/base/doc/port-reclaim.1.txt
branches/gsoc14-interactive/base/doc/port-url.1
branches/gsoc14-interactive/base/doc/port-url.1.soelim
branches/gsoc14-interactive/base/doc/port-work.1
branches/gsoc14-interactive/base/doc/port-work.1.soelim
branches/gsoc14-interactive/base/src/darwintracelib1.0/sandbox_actions.h
branches/gsoc14-interactive/base/src/macports1.0/doctor.tcl
branches/gsoc14-interactive/base/src/macports1.0/reclaim.tcl
branches/gsoc14-interactive/base/src/macports1.0/tests/reclaim.test
Property Changed:
----------------
branches/gsoc14-interactive/base/
branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in
Property changes on: branches/gsoc14-interactive/base
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/gsoc11-rev-upgrade/base:78828-88375
/branches/gsoc11-statistics/base:79520,79666
/branches/gsoc13-tests:106692-111324
/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:119514-123795
/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/gsoc11-statistics/base:79520,79666
/branches/gsoc13-tests:106692-111324
/branches/gsoc14-cleanup:123738-124046
/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:119514-124235
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
Modified: branches/gsoc14-interactive/base/ChangeLog
===================================================================
--- branches/gsoc14-interactive/base/ChangeLog 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/ChangeLog 2014-08-21 17:47:06 UTC (rev 124236)
@@ -4,6 +4,10 @@
###
Release 2.4 (unreleased)
+ - Fix bugs in trace mode that caused it to (1) not ignore /usr/local as
+ it should and (2) fail with certain lengths of $prefix.
+ (cal in r124145, r124146)
+
- Display notes for installed or updated ports at the end of the
installation to prevent them from getting lost in the scrolling output.
(#24507, cal in r118304, patch by snc)
Modified: branches/gsoc14-interactive/base/doc/Makefile.in
===================================================================
--- branches/gsoc14-interactive/base/doc/Makefile.in 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/Makefile.in 2014-08-21 17:47:06 UTC (rev 124236)
@@ -8,8 +8,9 @@
ASCIIDOC=
XSLTPROC=
else
-ASCIIDOC= $(wildcard ${prefix}/bin/asciidoc)
-XSLTPROC= $(wildcard ${prefix}/bin/xsltproc)
+ASCIIDOC= $(wildcard ${prefix}/bin/asciidoc)
+XSLTPROC= $(wildcard ${prefix}/bin/xsltproc)
+DOCBOOK_XSL= $(wildcard ${prefix}/share/xsl/docbook-xsl/manpages/docbook.xsl)
endif
ASCIIDOCFLAGS= -f asciidoc.conf -a manversion=${MACPORTS_VERSION}
@@ -30,16 +31,39 @@
port-dependents.1 \
port-deps.1 \
port-destroot.1 \
+ port-dir.1 \
+ port-distcheck.1 \
+ port-distfiles.1 \
+ port-dmg.1 \
+ port-doctor.1 \
+ port-echo.1 \
port-edit.1 \
+ port-exit.1 \
port-extract.1 \
port-fetch.1 \
+ port-file.1 \
+ port-gohome.1 \
port-help.1 \
+ port-info.1 \
port-install.1 \
+ port-installed.1 \
+ port-lint.1 \
+ port-list.1 \
+ port-livecheck.1 \
+ port-location.1 \
+ port-mdmg.1 \
+ port-mpkg.1 \
port-patch.1 \
+ port-pkg.1 \
+ port-quit.1 \
+ port-rdependents.1 \
port-rdeps.1 \
+ port-reclaim.1 \
port-rev-upgrade.1 \
port-selfupdate.1 \
port-uninstall.1 \
+ port-url.1 \
+ port-work.1 \
port.1 \
MAN5= macports.conf.5
@@ -105,7 +129,7 @@
ln -sf $(shell basename $$(awk '{print $$2}' < $<)).html $@
# Define these rules only if both asciidoc and xsltproc are available
-ifneq ($(and $(ASCIIDOC),$(XSLTPROC)),)
+ifneq ($(and $(ASCIIDOC),$(XSLTPROC),$(DOCBOOK_XSL)),)
%: %.xml manpage.xsl
$(XSLTPROC) $(XSLTFLAGS) manpage.xsl $<
@@ -117,13 +141,13 @@
else
man: ${MAN} ${MAN:%=%.gz}
@echo "* Warning: Using pre-generated man pages only."
- @echo "* asciidoc and xsltproc are required to generate man pages from source."
+ @echo "* asciidoc, xsltproc (port libxslt) and docbook-xsl are required to generate man pages from source."
%.xml %.html: | %.txt
@echo "* In order to modify and generate output from these source files,"
- @echo "* please install asciidoc and xsltproc or use"
- @echo "* $(MAKE) ASCIIDOC=.../bin/asciidoc XSLTPROC=../bin/xsltproc"
- @echo "* with appropriate paths."
+ @echo "* please install asciidoc and xsltproc (port libxslt) and docbook-xsl or use"
+ @echo "* $(MAKE) ASCIIDOC=.../bin/asciidoc XSLTPROC=../bin/xsltproc DOCBOOK_XSL=nonempty"
+ @echo "* with appropriate paths for asciidoc and xsltproc."
@exit 1
endif
Modified: branches/gsoc14-interactive/base/doc/asciidoc.conf
===================================================================
--- branches/gsoc14-interactive/base/doc/asciidoc.conf 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/asciidoc.conf 2014-08-21 17:47:06 UTC (rev 124236)
@@ -4,6 +4,7 @@
manmanual=MacPorts Manual
guideurl=http://guide.macports.org/
wikiurl=https://trac.macports.org/wiki/
+sourceurl=https://trac.macports.org/browser/
## man: macro
#
@@ -18,6 +19,7 @@
(?su)[\\]?(?P<name>man):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
(?su)[\\]?(?P<name>guide):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
(?su)[\\]?(?P<name>wiki):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+(?su)[\\]?(?P<name>source):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
# man: and guide: for docbook
ifdef::backend-docbook[]
@@ -26,9 +28,11 @@
<refentrytitle>{target}</refentrytitle>{0?<manvolnum>{0}</manvolnum>}
</citerefentry>
[guide-inlinemacro]
-<ulink url="{guideurl}#{target}">{0={guideurl}{target}}</ulink>
+<ulink url="{guideurl}#{target}">{0={guideurl}#{target}}</ulink>
[wiki-inlinemacro]
<ulink url="{wikiurl}{target}">{0={target}}</ulink>
+[source-inlinemacro]
+<ulink url="{sourceurl}{target}">{0={target}}</ulink>
endif::backend-docbook[]
# man: and guide: for xhtml11
@@ -36,9 +40,11 @@
[man-inlinemacro]
<a href="{target}{0?.{0}}.html">{target}{0?({0})}</a>
[guide-inlinemacro]
-<a href="{guideurl}#{target}">{0={guideurl}{target}}</a>
+<a href="{guideurl}#{target}">{0={guideurl}#{target}}</a>
[wiki-inlinemacro]
<a href="{wikiurl}{target}">{0={target}}</a>
+[source-inlinemacro]
+<a href="{sourceurl}{target}">{0={target}}</a>
endif::backend-xhtml11[]
[paradef-default]
Modified: branches/gsoc14-interactive/base/doc/port-activate.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-activate.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-activate.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-ACTIVATE" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-ACTIVATE" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -51,7 +51,7 @@
To check the current status of a specific port, use \fB\fBport-installed\fR(1)\fR\&.
.SH "OPTIONS"
.PP
-\-\-no\-exec
+\fB\-\-no\-exec\fR
.RS 4
Do not execute any stored pre\- or post\-uninstall procedures\&.
.RE
Modified: branches/gsoc14-interactive/base/doc/port-activate.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-activate.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-activate.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,6 +1,6 @@
// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
port-activate(1)
-===============
+================
$Id$
NAME
@@ -38,7 +38,7 @@
OPTIONS
-------
---no-exec::
+*--no-exec*::
Do not execute any stored pre- or post-uninstall procedures.
Modified: branches/gsoc14-interactive/base/doc/port-archivefetch.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-archivefetch.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-archivefetch.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-ARCHIVEFETCH" "1" "2014\-08\-04" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-ARCHIVEFETCH" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -46,7 +46,7 @@
.sp
Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
.PP
-\-p
+\fB\-p\fR
.RS 4
Proceed even if a port fails to fetch\&. This is useful if you are trying to download all available binary images for a number of ports, e\&.g\&., if you want to install them later without a network connection\&.
.RE
Modified: branches/gsoc14-interactive/base/doc/port-archivefetch.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-archivefetch.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-archivefetch.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -32,7 +32,7 @@
include::global-flags.txt[]
--p::
+*-p*::
Proceed even if a port fails to fetch. This is useful if you are trying to
download all available binary images for a number of ports, e.g., if you
want to install them later without a network connection.
Modified: branches/gsoc14-interactive/base/doc/port-cd.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-cd.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-cd.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-CD" "1" "2014\-08\-06" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-CD" "1" "2014\-08\-15" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -25,12 +25,16 @@
.sp
To be used only in interactive mode:
.sp
-\fBcd\fR [\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]
+.nf
+\fBcd\fR
+ [\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]
+.fi
.SH "DESCRIPTION"
.sp
\fBcd\fR can be used in interactive mode of \fBport\fR (see \fBport-interactive\fR(7)) to change the current working directory to the directory that contains a given port\&. The second parameter is not optional, as it usually is with \fBcd\fR in your shell\&.
+.SH "BUGS"
.sp
-Note that \fBport cd\fR can be used from the command line, but is a no\-op\&.
+\fBport cd\fR can be used from the command line, but is a no\-op\&.
.SH "SEE ALSO"
.sp
\fBport\fR(1), \fBport-interactive\fR(7)
Modified: branches/gsoc14-interactive/base/doc/port-cd.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-cd.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-cd.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -11,6 +11,7 @@
--------
To be used only in interactive mode:
+[cmdsynopsis]
*cd*
['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']
@@ -21,7 +22,9 @@
port. The second parameter is not optional, as it usually is with *cd* in your
shell.
-Note that *port cd* can be used from the command line, but is a no-op.
+BUGS
+----
+*port cd* can be used from the command line, but is a no-op.
SEE ALSO
--------
Modified: branches/gsoc14-interactive/base/doc/port-contents.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-contents.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-contents.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-CONTENTS" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-CONTENTS" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -45,14 +45,14 @@
.\}
.SH "OPTIONS"
.PP
-\-\-size
+\fB\-\-size\fR
.RS 4
Enable printing a human\-readable representation of the files\*(Aq sizes\&. The size output can be adjusted using the
\fB\-\-units \fR\fB\fIunit\fR\fR
flag\&.
.RE
.PP
-\-\-units \fIunit\fR
+\fB\-\-units \fR\fB\fIunit\fR\fR
.RS 4
Used in conjunction with
\fB\-\-size\fR
@@ -60,37 +60,37 @@
\fIunit\fR
are
.PP
-B
+\fBB\fR
.RS 4
List sizes in bytes\&.
.RE
.PP
-K, Ki, or KiB
+\fBK\fR, \fBKi\fR, \fBKiB\fR
.RS 4
List sizes in KiB, i\&.e\&., 1024 bytes\&.
.RE
.PP
-Mi, or MiB
+\fBMi\fR, \fBMiB\fR
.RS 4
List sizes in MiB, i\&.e\&., 1024 * 1024 bytes\&.
.RE
.PP
-Gi, or GiB
+\fBGi\fR, \fBGiB\fR
.RS 4
List sizes in GiB, i\&.e\&., 1024 * 1024 * 1024 bytes\&.
.RE
.PP
-k, or kB
+\fBk\fR, \fBkB\fR
.RS 4
List sizes in kB, i\&.e\&., 1000 bytes\&.
.RE
.PP
-M, or MB
+\fBM\fR, \fBMB\fR
.RS 4
List sizes in MB, i\&.e\&., 1000 * 1000 bytes\&.
.RE
.PP
-G, or GB
+\fBG\fR, \fBGB\fR
.RS 4
List sizes in GB, i\&.e\&., 1000 * 1000 * 1000 bytes\&.
.RE
@@ -99,7 +99,7 @@
.sp
Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
.PP
-\-q
+\fB\-q\fR
.RS 4
Do not print the header line\&.
.RE
Modified: branches/gsoc14-interactive/base/doc/port-contents.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-contents.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-contents.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -29,39 +29,39 @@
OPTIONS
-------
---size::
+*--size*::
Enable printing a human-readable representation of the files' sizes. The
size output can be adjusted using the *--units 'unit'* flag.
---units 'unit'::
+*--units 'unit'*::
Used in conjunction with *--size* to choose the unit in which the size is
given. Valid values for 'unit' are
- B:::
+ *B*:::
List sizes in bytes.
- K, Ki, or KiB:::
+ *K*, *Ki*, *KiB*:::
List sizes in KiB, i.e., 1024 bytes.
- Mi, or MiB:::
+ *Mi*, *MiB*:::
List sizes in MiB, i.e., 1024 * 1024 bytes.
- Gi, or GiB:::
+ *Gi*, *GiB*:::
List sizes in GiB, i.e., 1024 * 1024 * 1024 bytes.
- k, or kB:::
+ *k*, *kB*:::
List sizes in kB, i.e., 1000 bytes.
- M, or MB:::
+ *M*, *MB*:::
List sizes in MB, i.e., 1000 * 1000 bytes.
- G, or GB:::
+ *G*, *GB*:::
List sizes in GB, i.e., 1000 * 1000 * 1000 bytes.
include::global-flags.txt[]
--q::
+*-q*::
Do not print the header line.
Modified: branches/gsoc14-interactive/base/doc/port-dependents.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dependents.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-dependents.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-DEPENDENTS" "1" "2014\-08\-12" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-DEPENDENTS" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -20,13 +20,18 @@
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-port-dependents \- List ports that depend on a given (installed) port
+port-dependents, port-rdependents \- List ports that depend on a given (installed) port
.SH "SYNOPSIS"
.sp
.nf
\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBdependents\fR
[[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
.fi
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBrdependents\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
.SH "DESCRIPTION"
.sp
\fBport dependents\fR reports which ports depend upon a given (installed) port, if any\&. Note that \fBdependents\fR does not work for ports that are not installed on your system\&. It uses the database of installed ports that MacPorts keeps internally, which records the dependency relations at installation time\&. \fBport dependents\fR prints this information\&.
@@ -45,7 +50,9 @@
.sp
This command will, however, not cover dependencies that are only present in non\-default variants\&. For more information about pseudo\-portname selectors, see \fBport\fR(1)\&.
.sp
-The dependency relations printed by \fBport dependents\fR are the same that are used to determine if a port can be safely uninstalled\&. Ports that still have dependents installed cannot be uninstalled without either the \fB\-\-follow\-dependents\fR or the \fB\-f\fR flag\&. See \fBport-uninstall\fR(1) for more details\&.
+\fBport rdependents\fR will print a tree of installed ports that depend on the given port\&.
+.sp
+The dependency relations printed by \fBport dependents\fR and \fBport rdependents\fR are the same that are used to determine if a port can be safely uninstalled\&. Ports that still have dependents installed cannot be uninstalled without either the \fB\-\-follow\-dependents\fR or the \fB\-f\fR flag\&. See \fBport-uninstall\fR(1) for more details\&.
.SH "DEPENDENCY RELATIONS"
.sp
Do not confuse \fIdependents\fR and \fIdependencies\fR (or, shortened, \fIdeps\fR)\&. Refer to the following example to understand the difference:
Modified: branches/gsoc14-interactive/base/doc/port-dependents.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dependents.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-dependents.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -5,7 +5,8 @@
NAME
----
-port-dependents - List ports that depend on a given (installed) port
+port-dependents, port-rdependents - List ports that depend on a given
+(installed) port
SYNOPSIS
--------
@@ -13,6 +14,10 @@
*port* [*-D* 'portdir'] *dependents*
[['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *rdependents*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
DESCRIPTION
-----------
*port dependents* reports which ports depend upon a given (installed) port, if
@@ -33,9 +38,12 @@
non-default variants. For more information about pseudo-portname selectors, see
man:port[1].
-The dependency relations printed by *port dependents* are the same that are used
-to determine if a port can be safely uninstalled. Ports that still have
-dependents installed cannot be uninstalled without either the
+*port rdependents* will print a tree of installed ports that depend on the given
+port.
+
+The dependency relations printed by *port dependents* and *port rdependents* are
+the same that are used to determine if a port can be safely uninstalled. Ports
+that still have dependents installed cannot be uninstalled without either the
*--follow-dependents* or the *-f* flag. See man:port-uninstall[1] for more
details.
Copied: branches/gsoc14-interactive/base/doc/port-dir.1 (from rev 124235, trunk/base/doc/port-dir.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dir.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-dir.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,90 @@
+'\" t
+.TH "PORT\-DIR" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-dir, port-url, port-file, port-location, port-work \- Print paths for certain properties of a port
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBdir\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBurl\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBfile\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-q\fR] [\fB\-D\fR \fIportdir\fR] \fBlocation\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBwork\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+These commands print a path for each given port\&. The meaning of the path differs by the command given:
+.sp
+\fBport dir\fR prints the directory that contains the \fIPortfile\fR for the given port expression\&. This can be quite handy in your shell, if you want to locate a \fIPortfile\fR:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+cd $(port dir <portname>)
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+\fBport url\fR prints a unique URL for the given port expression\&. This command mostly exists for historical reasons and isn\(cqt of much use nowadays\&.
+.sp
+\fBport file\fR prints the path of the \fIPortfile\fR for the given port expression\&. This can be useful to locate a port\(cqs definition\&. Note that you can always get this by using \fBport dir\fR and appending \fIPortfile\fR\&. You could use \fBport file\fR in a shell to edit a Portfile, but note that you can also use \fBport-edit\fR(1) to achieve the same\&.
+.sp
+\fBport location\fR only works for installed ports and prints the location of the archive MacPorts internally uses to be able to deactivate and activate a port\&. See \fBport-activate\fR(1) for more details on that\&. This command might be useful for you if you want to setup a local binary mirror of MacPorts packages that are not available from our official infrastructure due to licensing reasons\&.
+.sp
+\fBport work\fR prints the path to the so\-called \fIwork\fR directory, i\&.e\&., the directory used by MacPorts to build a port\&. No output is generated if no build directory exists, e\&.g\&., because there is no unfinished build in progress for the given port\&. Work directories are deleted after successful installation or using \fBport-clean\fR(1)\&.
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-edit\fR(1), \fBport-activate\fR(1), \fBport-clean\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-dir.1.txt (from rev 124235, trunk/base/doc/port-dir.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dir.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-dir.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,76 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-dir(1)
+===========
+$Id$
+
+NAME
+----
+port-dir, port-url, port-file, port-location, port-work - Print paths for
+certain properties of a port
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *dir*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *url*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *file*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-q*] [*-D* 'portdir'] *location*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *work*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+These commands print a path for each given port. The meaning of the path
+differs by the command given:
+
+*port dir* prints the directory that contains the 'Portfile' for the given port
+expression. This can be quite handy in your shell, if you want to locate
+a 'Portfile':
+
+----
+cd $(port dir <portname>)
+----
+
+*port url* prints a unique URL for the given port expression. This command
+mostly exists for historical reasons and isn't of much use nowadays.
+
+*port file* prints the path of the 'Portfile' for the given port expression.
+This can be useful to locate a port's definition. Note that you can always get
+this by using *port dir* and appending 'Portfile'. You could use *port file* in
+a shell to edit a Portfile, but note that you can also use man:port-edit[1] to
+achieve the same.
+
+*port location* only works for installed ports and prints the location of the
+archive MacPorts internally uses to be able to deactivate and activate a port.
+See man:port-activate[1] for more details on that. This command might be useful
+for you if you want to setup a local binary mirror of MacPorts packages that are
+not available from our official infrastructure due to licensing reasons.
+
+*port work* prints the path to the so-called 'work' directory, i.e., the
+directory used by MacPorts to build a port. No output is generated if no build
+directory exists, e.g., because there is no unfinished build in progress for the
+given port. Work directories are deleted after successful installation or using
+man:port-clean[1].
+
+include::global-flags.txt[]
+
+SEE ALSO
+--------
+man:port[1], man:port-edit[1], man:port-activate[1], man:port-clean[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-distcheck.1 (from rev 124235, trunk/base/doc/port-distcheck.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-distcheck.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-distcheck.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,63 @@
+'\" t
+.TH "PORT\-DEPS" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-distcheck \- Check if a port can be fetched from all of its mirrors
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-qvdy\fR] [\fB\-D\fR \fIportdir\fR] \fBdistcheck\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport distcheck\fR downloads all source files for a given port from all available mirrors (including MacPorts\*(Aq mirror infrastructure) and checks that the modification date of the file on the mirror is not more recent than the modification date of the \fIPortfile\fR\&.
+.sp
+Distcheck can be switched to verify the file size of the downloaded files instead by setting the \fIdistcheck\&.type\fR option to \fIfilesize\fR in the \fIPortfile\fR for the tested port\&.
+.SH "BUGS"
+.sp
+\fBport distcheck\fR should not rely on timestamps or file sizes but use the checksums available in the \fIPortfile\fR to verify the integrity of the files on the mirrors instead\&. See \fBport-checksum\fR(1)\&.
+.sp
+Meanwhile, you can use \m[blue]\fBport\-checkmirrors\fR\m[]\&\s-2\u[1]\d\s+2 from contrib to do that\&.
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-checksum\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
+.SH "EXTERNAL REFERENCES"
+.IP " 1." 4
+port-checkmirrors
+.RS 4
+\%https://trac.macports.org/browser/contrib/port-checkmirrors
+.RE
Copied: branches/gsoc14-interactive/base/doc/port-distcheck.1.txt (from rev 124235, trunk/base/doc/port-distcheck.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-distcheck.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-distcheck.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,45 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-deps(1)
+============
+$Id$
+
+NAME
+----
+port-distcheck - Check if a port can be fetched from all of its mirrors
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-qvdy*] [*-D* 'portdir'] *distcheck*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port distcheck* downloads all source files for a given port from all available
+mirrors (including MacPorts' mirror infrastructure) and checks that the
+modification date of the file on the mirror is not more recent than the
+modification date of the 'Portfile'.
+
+Distcheck can be switched to verify the file size of the downloaded files
+instead by setting the 'distcheck.type' option to 'filesize' in the 'Portfile'
+for the tested port.
+
+BUGS
+----
+*port distcheck* should not rely on timestamps or file sizes but use the
+checksums available in the 'Portfile' to verify the integrity of the files on
+the mirrors instead. See man:port-checksum[1].
+
+Meanwhile, you can use source:contrib/port-checkmirrors[port-checkmirrors] from
+contrib to do that.
+
+include::global-flags.txt[]
+
+SEE ALSO
+--------
+man:port[1], man:port-checksum[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-distfiles.1 (from rev 124235, trunk/base/doc/port-distfiles.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-distfiles.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-distfiles.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,49 @@
+'\" t
+.TH "PORT\-DISTFILES" "1" "2014\-08\-15" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-distfiles \- Print a list of distribution files for a port
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-qvd\fR] [\fB\-D\fR \fIportdir\fR] \fBdistfiles\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+Print a list of source archives required to build the given port along with the checksums for the file and a list of mirrors\&. If you want to verify that all mirrors actually serve the same file see \fBport-distcheck\fR(1)\&.
+.sp
+To delete the distfiles once they have been downloaded, use \fBport clean \-\-dist\fR\&. See \fBport-clean\fR(1) for more information regarding the \fBclean\fR command\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-distcheck\fR(1), \fBport-clean\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-distfiles.1.txt (from rev 124235, trunk/base/doc/port-distfiles.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-distfiles.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-distfiles.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,32 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-distfiles(1)
+=================
+$Id$
+
+NAME
+----
+port-distfiles - Print a list of distribution files for a port
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-qvd*] [*-D* 'portdir'] *distfiles*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+Print a list of source archives required to build the given port along with the
+checksums for the file and a list of mirrors. If you want to verify that all
+mirrors actually serve the same file see man:port-distcheck[1].
+
+To delete the distfiles once they have been downloaded, use *port clean --dist*.
+See man:port-clean[1] for more information regarding the *clean* command.
+
+SEE ALSO
+--------
+man:port[1], man:port-distcheck[1], man:port-clean[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-dmg.1 (from rev 124235, trunk/base/doc/port-dmg.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dmg.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-dmg.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,95 @@
+'\" t
+.TH "PORT\-DMG" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-dmg, port-mdmg, port-pkg, port-mpkg \- Create binary archives of a port, and optionally its dependencies\&.
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-vdqysbckpotf\fR] [\fB\-D\fR \fIportdir\fR] \fBdmg\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-vdqysbckpotf\fR] [\fB\-D\fR \fIportdir\fR] \fBmdmg\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-vdqysbckpotf\fR] [\fB\-D\fR \fIportdir\fR] \fBpkg\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.sp
+.nf
+\fBport\fR [\fB\-vdqysbckpotf\fR] [\fB\-D\fR \fIportdir\fR] \fBmpkg\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+These commands create OS X\-native binary archives of a given port\&. Depending on the command, one of a \&.dmg disk image file, a \&.pkg, or \&.mpkg installer package is created\&.
+.sp
+\fBport pkg\fR creates an OS X installer package that installs all files that belong to a given port\&. \fBport dmg\fR wraps this installer package in a disk image\&. In most cases you probably want to package a port and all its library and runtime dependencies in a single package suitable for binary distribution\&. \fBport pkg\fR and \fBport dmg\fR don\(cqt do that, so those are only useful if you are going to take care of the dependencies separately\&. \fBport mpkg\fR creates an \&.mpkg installer image that contains installer packages for each of the dependencies and is suitable for standalone redistribution\&. \fBport mdmg\fR wraps this \&.mpkg package in a disk image\&.
+.sp
+On OS X 10\&.6 and later, the generated installer packages are in \(lqflat\(rq format, such that wrapping them in a disk image is no longer necessary for online redistribution\&. Prior to OS X 10\&.6, generated installer packages could not be used for online distribution without a wrapping disk image\&.
+.sp
+All packages are placed in a port\(cqs work directory, which can be located using \fBport-work\fR(1)\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBWarning\fR
+.ps -1
+.br
+.sp
+If you want to create installer packages using MacPorts for redistribution, make sure you do not use a standard installation of MacPorts in \fI/opt/local\fR\&. If you do that, your installer package will conflict on systems that \fBdo\fR have MacPorts installed\&.
+.sp
+Instead, follow \m[blue]\fBSection 2\&.2\&.4 of the MacPorts Guide\fR\m[]\&\s-2\u[1]\d\s+2 and choose a prefix specific to the software you are trying to package, e\&.g\&., \fI/opt/logrotate\fR for \fIlogrotate\fR\&. Then use this custom MacPorts installation to build your package\&.
+.sp .5v
+.RE
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-work\fR(1), \m[blue]\fBSection 2\&.2\&.4 of the MacPorts Guide\fR\m[]\&\s-2\u[1]\d\s+2
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
+.SH "EXTERNAL REFERENCES"
+.IP " 1." 4
+Section 2.2.4 of the MacPorts Guide
+.RS 4
+\%http://guide.macports.org/#installing.macports.source.multiple
+.RE
Copied: branches/gsoc14-interactive/base/doc/port-dmg.1.txt (from rev 124235, trunk/base/doc/port-dmg.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-dmg.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-dmg.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,76 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-dmg(1)
+===========
+$Id$
+
+NAME
+----
+port-dmg, port-mdmg, port-pkg, port-mpkg - Create binary archives of a port, and
+optionally its dependencies.
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-vdqysbckpotf*] [*-D* 'portdir'] *dmg*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-vdqysbckpotf*] [*-D* 'portdir'] *mdmg*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-vdqysbckpotf*] [*-D* 'portdir'] *pkg*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+[cmdsynopsis]
+*port* [*-vdqysbckpotf*] [*-D* 'portdir'] *mpkg*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+These commands create OS X-native binary archives of a given port. Depending on
+the command, one of a .dmg disk image file, a .pkg, or .mpkg installer package
+is created.
+
+*port pkg* creates an OS X installer package that installs all files that belong
+to a given port. *port dmg* wraps this installer package in a disk image. In
+most cases you probably want to package a port and all its library and runtime
+dependencies in a single package suitable for binary distribution. *port pkg*
+and *port dmg* don't do that, so those are only useful if you are going to take
+care of the dependencies separately. *port mpkg* creates an .mpkg installer
+image that contains installer packages for each of the dependencies and is
+suitable for standalone redistribution. *port mdmg* wraps this .mpkg package in
+a disk image.
+
+On OS X 10.6 and later, the generated installer packages are in ``flat'' format,
+such that wrapping them in a disk image is no longer necessary for online
+redistribution. Prior to OS X 10.6, generated installer packages could not be
+used for online distribution without a wrapping disk image.
+
+All packages are placed in a port's work directory, which can be located using
+man:port-work[1].
+
+[WARNING]
+====
+If you want to create installer packages using MacPorts for redistribution, make
+sure you do not use a standard installation of MacPorts in '/opt/local'. If you
+do that, your installer package will conflict on systems that *do* have MacPorts
+installed.
+
+Instead, follow guide:installing.macports.source.multiple[Section 2.2.4 of the
+MacPorts Guide] and choose a prefix specific to the software you are trying to
+package, e.g., '/opt/logrotate' for 'logrotate'. Then use this custom MacPorts
+installation to build your package.
+====
+
+include::global-flags.txt[]
+
+SEE ALSO
+--------
+man:port[1], man:port-work[1], guide:installing.macports.source.multiple[Section
+2.2.4 of the MacPorts Guide]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-doctor.1 (from rev 124235, trunk/base/doc/port-doctor.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-doctor.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-doctor.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,53 @@
+'\" t
+.TH "PORT\-DOCTOR" "1" "08/20/2014" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-doctor \- Detects common issues
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport doctor\fR
+ [\-\-quiet]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport doctor\fR will check a list of common issues that could affect the user or MacPorts in one way or another\&. If any issues are found, a warning will be shown to the user included with a possible fix for said problem\&.
+.SH "OPTIONS"
+.PP
+\fB\-\-quiet\fR
+.RS 4
+Only display warnings or errors\&.
+.RE
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Kyle Sammons <ksammons at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-doctor.1.txt (from rev 124235, trunk/base/doc/port-doctor.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-doctor.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-doctor.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,34 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-doctor(1)
+==============
+$Id$
+
+NAME
+----
+port-doctor - Detects common issues
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port doctor*
+ [--quiet]
+
+DESCRIPTION
+-----------
+*port doctor* will check a list of common issues that could affect the user or
+MacPorts in one way or another. If any issues are found, a warning will be
+shown to the user included with a possible fix for said problem.
+
+OPTIONS
+-------
+*--quiet*::
+Only display warnings or errors.
+
+SEE ALSO
+--------
+man:port[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Kyle Sammons <ksammons at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-echo.1 (from rev 124235, trunk/base/doc/port-echo.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-echo.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-echo.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,80 @@
+'\" t
+.TH "PORT\-ECHO" "1" "2014\-08\-15" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-echo \- Print the list of ports the argument expands to
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR \fBecho\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport echo\fR expands its argument list according to MacPorts\*(Aq rules and prints a list of ports that match the expression given as argument\&. It can be useful to see what a pseudo\-portname or a pseudo\-portname selector (see \fBport\fR(1)) expands to\&.
+.sp
+If \fBport echo\fR doesn\(cqt recognize an argument as port, it will still print it as\-is\&. You cannot use \fBport echo\fR to check whether a port exists:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+$ port echo nonexistentport
+nonexistentport
+.fi
+.if n \{\
+.RE
+.\}
+.SH "EXAMPLES"
+.sp
+Common use cases are:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+port echo depends:zlib
+port echo inactive
+port echo obsolete
+port echo requested
+port echo leaves
+port echo category:^mail$
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Note that \fBecho\fR is usually \fInot\fR used to list outdated ports, since a separate action \fBport-outdated\fR(1) exists for that\&. \fBport outdated\fR has the advantage compared to \fBport echo outdated\fR that it gives the reason why MacPorts considers the port outdated\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-outdated\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-echo.1.txt (from rev 124235, trunk/base/doc/port-echo.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-echo.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-echo.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,56 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-echo(1)
+============
+$Id$
+
+NAME
+----
+port-echo - Print the list of ports the argument expands to
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* *echo*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port echo* expands its argument list according to MacPorts' rules and prints
+a list of ports that match the expression given as argument. It can be useful to
+see what a pseudo-portname or a pseudo-portname selector (see man:port[1])
+expands to.
+
+If *port echo* doesn't recognize an argument as port, it will still print it
+as-is. You cannot use *port echo* to check whether a port exists:
+
+----
+$ port echo nonexistentport
+nonexistentport
+----
+
+EXAMPLES
+--------
+Common use cases are:
+
+----
+port echo depends:zlib
+port echo inactive
+port echo obsolete
+port echo requested
+port echo leaves
+port echo category:^mail$
+----
+
+Note that *echo* is usually 'not' used to list outdated ports, since a separate
+action man:port-outdated[1] exists for that. *port outdated* has the advantage
+compared to *port echo outdated* that it gives the reason why MacPorts considers
+the port outdated.
+
+SEE ALSO
+--------
+man:port[1], man:port-outdated[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Modified: branches/gsoc14-interactive/base/doc/port-edit.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-edit.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-edit.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-EDIT" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-EDIT" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -30,7 +30,7 @@
.fi
.SH "DESCRIPTION"
.sp
-\fBport edit\fR will open the associated Portfile in an editor\&. It will try to determine your favorite editor by respecting the environment variables \fB$VISUAL\fR or \fB$EDITOR\fR in this order\&. If none has been set it will fallback to \fI/usr/bin/vi\fR\&. Your shell will be blocked until the editor returns\&. The path to the Portfile is passed as one single argument to the editor\&.
+\fBport edit\fR will open the associated \fIPortfile\fR in an editor\&. It will try to determine your favorite editor by respecting the environment variables \fB$VISUAL\fR or \fB$EDITOR\fR in this order\&. If none has been set it will fallback to \fI/usr/bin/vi\fR\&. Your shell will be blocked until the editor returns\&. The path to the \fIPortfile\fR is passed as one single argument to the editor\&.
.sp
If you specify multiple ports, the editor is executed multiple times for each of them one after another\&.
.if n \{\
Modified: branches/gsoc14-interactive/base/doc/port-edit.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-edit.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-edit.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -16,11 +16,11 @@
DESCRIPTION
-----------
-*port edit* will open the associated Portfile in an editor. It will try to
+*port edit* will open the associated 'Portfile' in an editor. It will try to
determine your favorite editor by respecting the environment variables *$VISUAL*
or *$EDITOR* in this order. If none has been set it will fallback to
'/usr/bin/vi'. Your shell will be blocked until the editor returns. The path to
-the Portfile is passed as one single argument to the editor.
+the 'Portfile' is passed as one single argument to the editor.
If you specify multiple ports, the editor is executed multiple times for
each of them one after another.
Copied: branches/gsoc14-interactive/base/doc/port-exit.1 (from rev 124235, trunk/base/doc/port-exit.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-exit.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-exit.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,55 @@
+'\" t
+.TH "PORT\-EXIT" "1" "2014\-08\-15" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-exit \- Exit interactive mode
+.SH "SYNOPSIS"
+.sp
+To be used only in interactive mode:
+.sp
+.nf
+\fBexit\fR
+.fi
+.sp
+.nf
+\fBquit\fR
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBexit\fR or \fBquit\fR can only be used in interactive mode of \fBport\fR (see \fBport-interactive\fR(7))\&. It causes the interactive interpreter to exit\&.
+.SH "BUGS"
+.sp
+\fBport exit\fR and \fBport quit\fR can be used from the command line, but are no\-ops\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-interactive\fR(7)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-exit.1.txt (from rev 124235, trunk/base/doc/port-exit.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-exit.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-exit.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,36 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-exit(1)
+============
+$Id$
+
+NAME
+----
+port-exit - Exit interactive mode
+
+SYNOPSIS
+--------
+To be used only in interactive mode:
+
+[cmdsynopsis]
+*exit*
+
+[cmdsynopsis]
+*quit*
+
+DESCRIPTION
+-----------
+*exit* or *quit* can only be used in interactive mode of *port* (see
+man:port-interactive[7]). It causes the interactive interpreter to exit.
+
+BUGS
+----
+*port exit* and *port quit* can be used from the command line, but are no-ops.
+
+SEE ALSO
+--------
+man:port[1], man:port-interactive[7]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-file.1 (from rev 124235, trunk/base/doc/port-file.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-file.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-file.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-file.1.soelim (from rev 124235, trunk/base/doc/port-file.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-file.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-file.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-gohome.1 (from rev 124235, trunk/base/doc/port-gohome.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-gohome.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-gohome.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,47 @@
+'\" t
+.TH "PORT\-GOHOME" "1" "2014\-08\-15" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-gohome \- Open the homepage of the given port(s)
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-D\fR \fIportdir\fR] \fBgohome\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport gohome\fR opens the homepage of the given port(s) in your default browser\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-gohome.1.txt (from rev 124235, trunk/base/doc/port-gohome.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-gohome.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-gohome.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,27 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-gohome(1)
+==============
+$Id$
+
+NAME
+----
+port-gohome - Open the homepage of the given port(s)
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-D* 'portdir'] *gohome*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port gohome* opens the homepage of the given port(s) in your default browser.
+
+SEE ALSO
+--------
+man:port[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-info.1 (from rev 124235, trunk/base/doc/port-info.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-info.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-info.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,168 @@
+'\" t
+.TH "PORT\-INFO" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-info \- Return information about the given ports\&.
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-q\fR] [\fB\-D\fR \fIportdir\fR] \fBinfo\fR
+ [\-\-categories|\-\-category] [\-\-depends] [\-\-depends_fetch] [\-\-depends_extract]
+ [\-\-depends_build] [\-\-depends_lib] [\-\-depends_run] [\-\-description] [\-\-epoch]
+ [\-\-fullname] [\-\-heading] [\-\-homepage] [\-\-index] [\-\-license] [\-\-line]
+ [\-\-long_description] [\-\-maintainer|\-\-maintainers] [\-\-name]
+ [\-\-platform|\-\-platforms] [\-\-portdir] [\-\-pretty] [\-\-replaced_by]
+ [\-\-revision] [\-\-subports] [\-\-variant|\-\-variants] [\-\-version]
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport info\fR prints information about the given ports\&. Specifying at least one of the options limits the output to the corresponding field\&. If no fields are specified, a useful default set consisting of name, epoch, version, revision, categories, replaced_by, variants, description, homepage, dependencies, platforms, license, and maintainers is shown\&.
+.SH "OPTIONS"
+.sp
+The following options do not select fields for the output but change how the information is obtained or formatted:
+.PP
+\fB\-\-index\fR
+.RS 4
+Do not read the
+\fIPortfile\fR, but rely solely on the port index information\&. Note that this option will prevent the information reported from reflecting the effects of any variants specified\&.
+.RE
+.PP
+\fB\-\-line\fR
+.RS 4
+Print a single line for each port\&. Fields are separated by spaces\&.
+.RE
+.PP
+\fB\-\-pretty\fR
+.RS 4
+Format the output in a convenient, human\-readable fashion\&. This is the default when no options are specified\&.
+.RE
+.sp
+The rest of the options affect which fields will be given in the output:
+.PP
+\fB\-\-category\fR, \fB\-\-categories\fR
+.RS 4
+List the categories of a port\&.
+.RE
+.PP
+\fB\-\-depends\fR, \fB\-\-depends_fetch\fR, \fB\-\-depends_extract\fR, \fB\-\-depends_build\fR, \fB\-\-depends_lib\fR, \fB\-\-depends_run\fR
+.RS 4
+List the specified dependencies of a port\&.
+\fB\-\-depends\fR
+is a shorthand option for all other
+\fB\-\-depends_\fR* options\&.
+.RE
+.PP
+\fB\-\-description\fR, \fB\-\-long_description\fR
+.RS 4
+Print the short or long description of a port, respectively\&.
+.RE
+.PP
+\fB\-\-epoch\fR, \fB\-\-version\fR, \fB\-\-revision\fR
+.RS 4
+List the components of a MacPorts version tuple, epoch, version and revision, respectively\&.
+.RE
+.PP
+\fB\-\-fullname\fR
+.RS 4
+Print name and the full MacPorts version tuple, e\&.g\&., \(lqyubico\-pam @2\&.16\(rq\&.
+.RE
+.PP
+\fB\-\-heading\fR
+.RS 4
+Like
+\fB\-\-fullname\fR
+but including the categories\&.
+.RE
+.PP
+\fB\-\-homepage\fR
+.RS 4
+List the homepage of a port\&.
+.RE
+.PP
+\fB\-\-license\fR
+.RS 4
+Print the license that applies to the source code of a port\&.
+.RE
+.PP
+\fB\-\-maintainer\fR, \fB\-\-maintainers\fR
+.RS 4
+List the email address(es) of a port\(cqs maintainer(s)\&.
+.RE
+.PP
+\fB\-\-name\fR
+.RS 4
+Print the name of a port\&.
+.RE
+.PP
+\fB\-\-platform\fR, \fB\-\-platforms\fR
+.RS 4
+List the platforms supported by a port\&. This field exists for historical reasons only\&. In modern MacPorts, this is always
+\fIdarwin\fR, i\&.e\&., OS X\&.
+.RE
+.PP
+\fB\-\-portdir\fR
+.RS 4
+Print the path to a port\(cqs directory relative to the port tree root\&.
+.RE
+.PP
+\fB\-\-replaced_by\fR
+.RS 4
+List the name of the port that replaces a port, if any\&.
+.RE
+.PP
+\fB\-\-subports\fR
+.RS 4
+Print a list of subports defined by this port\(cqs
+\fIPortfile\fR, i\&.e\&., ports that are defined in the same
+\fIPortfile\fR
+because they share common parts\&.
+.RE
+.PP
+\fB\-\-variant\fR, \fB\-\-variants\fR
+.RS 4
+List the variants defined by a port by name\&.
+.RE
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.PP
+\fB\-q\fR
+.RS 4
+Do not print the field description when using
+\fB\-\-pretty\fR
+output\&.
+.RE
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-info.1.txt (from rev 124235, trunk/base/doc/port-info.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-info.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-info.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,110 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-info(1)
+============
+$Id$
+
+NAME
+----
+port-info - Return information about the given ports.
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-q*] [*-D* 'portdir'] *info*
+ [--categories|--category] [--depends] [--depends_fetch] [--depends_extract]
+ [--depends_build] [--depends_lib] [--depends_run] [--description] [--epoch]
+ [--fullname] [--heading] [--homepage] [--index] [--license] [--line]
+ [--long_description] [--maintainer|--maintainers] [--name]
+ [--platform|--platforms] [--portdir] [--pretty] [--replaced_by]
+ [--revision] [--subports] [--variant|--variants] [--version]
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port info* prints information about the given ports. Specifying at least one of
+the options limits the output to the corresponding field. If no fields are
+specified, a useful default set consisting of name, epoch, version, revision,
+categories, replaced_by, variants, description, homepage, dependencies,
+platforms, license, and maintainers is shown.
+
+OPTIONS
+-------
+The following options do not select fields for the output but change how the
+information is obtained or formatted:
+
+*--index*::
+ Do not read the 'Portfile', but rely solely on the port index information.
+ Note that this option will prevent the information reported from reflecting
+ the effects of any variants specified.
+
+*--line*::
+ Print a single line for each port. Fields are separated by spaces.
+
+*--pretty*::
+ Format the output in a convenient, human-readable fashion. This is the
+ default when no options are specified.
+
+The rest of the options affect which fields will be given in the output:
+
+*--category*, *--categories*::
+ List the categories of a port.
+
+*--depends*, *--depends_fetch*, *--depends_extract*, *--depends_build*, *--depends_lib*, *--depends_run*::
+ List the specified dependencies of a port. *--depends* is a shorthand option
+ for all other *--depends_** options.
+
+*--description*, *--long_description*::
+ Print the short or long description of a port, respectively.
+
+*--epoch*, *--version*, *--revision*::
+ List the components of a MacPorts version tuple, epoch, version and
+ revision, respectively.
+
+*--fullname*::
+ Print name and the full MacPorts version tuple, e.g., ``yubico-pam @2.16''.
+
+*--heading*::
+ Like *--fullname* but including the categories.
+
+*--homepage*::
+ List the homepage of a port.
+
+*--license*::
+ Print the license that applies to the source code of a port.
+
+*--maintainer*, *--maintainers*::
+ List the email address(es) of a port's maintainer(s).
+
+*--name*::
+ Print the name of a port.
+
+*--platform*, *--platforms*::
+ List the platforms supported by a port. This field exists for historical
+ reasons only. In modern MacPorts, this is always 'darwin', i.e., OS X.
+
+*--portdir*::
+ Print the path to a port's directory relative to the port tree root.
+
+*--replaced_by*::
+ List the name of the port that replaces a port, if any.
+
+*--subports*::
+ Print a list of subports defined by this port's 'Portfile', i.e., ports that
+ are defined in the same 'Portfile' because they share common parts.
+
+*--variant*, *--variants*::
+ List the variants defined by a port by name.
+
+include::global-flags.txt[]
+
+*-q*::
+ Do not print the field description when using *--pretty* output.
+
+SEE ALSO
+--------
+man:port[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-installed.1 (from rev 124235, trunk/base/doc/port-installed.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-installed.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-installed.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,77 @@
+'\" t
+.TH "PORT\-INSTALLED" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-installed \- List installed versions of a given port, or all installed ports
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-vq\fR] \fBinstalled\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport installed\fR can be used in two separate ways: Either without arguments, in which case it will print a list of all installed ports (both active and inactive), or with arguments, which will return a list of installed ports that match the argument expression\&.
+.sp
+The output of \fBport installed\fR contains the name, version and variants of the installed ports and whether the port is active or inactive\&. See the PORT IMAGES section for an explanation of the active/inactive state\&.
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.PP
+\fB\-v\fR
+.RS 4
+Print the platform at install time (i\&.e\&., your OS X version) and the architecture(s) of the installed port\&.
+.RE
+.PP
+\fB\-q\fR
+.RS 4
+Do not print the header line\&. This is useful when parsing the output of
+\fBport installed\fR
+in scripts for further processing\&.
+.RE
+.SH "PORT IMAGES"
+.sp
+MacPorts has the ability to install multiple versions or different variant selections of the same port\&. The files will be stored in an intermediate location as \fIarchives\fR, which allows to switch between the versions\&. Only one version can be active at a time\&. On activation, files will be copied to their intended place in \fIprefix\fR\&.
+.sp
+More information on this topic can be found in the \m[blue]\fBThe MacPorts Guide\fR\m[]\&\s-2\u[1]\d\s+2\&.
+.sp
+To check the current status of a specific port, use \fB\fBport-installed\fR(1)\fR\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-activate\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
+.SH "EXTERNAL REFERENCES"
+.IP " 1." 4
+The MacPorts Guide
+.RS 4
+\%http://guide.macports.org/#internals.images
+.RE
Copied: branches/gsoc14-interactive/base/doc/port-installed.1.txt (from rev 124235, trunk/base/doc/port-installed.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-installed.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-installed.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,46 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-installed(1)
+=================
+$Id$
+
+NAME
+----
+port-installed - List installed versions of a given port, or all installed ports
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-vq*] *installed*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port installed* can be used in two separate ways: Either without arguments, in
+which case it will print a list of all installed ports (both active and
+inactive), or with arguments, which will return a list of installed ports that
+match the argument expression.
+
+The output of *port installed* contains the name, version and variants of the
+installed ports and whether the port is active or inactive. See the PORT IMAGES
+section for an explanation of the active/inactive state.
+
+include::global-flags.txt[]
+
+*-v*::
+ Print the platform at install time (i.e., your OS X version) and the
+ architecture(s) of the installed port.
+
+*-q*::
+ Do not print the header line. This is useful when parsing the output of
+ *port installed* in scripts for further processing.
+
+include::archives.txt[]
+
+SEE ALSO
+--------
+man:port[1], man:port-activate[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-lint.1 (from rev 124235, trunk/base/doc/port-lint.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-lint.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-lint.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,122 @@
+'\" t
+.TH "PORT\-LINT" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-lint \- Check a port for common problems
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-vdq\fR] [\fB\-D\fR \fIportdir\fR] \fBlint\fR
+ [\-\-nitpick]
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport lint\fR checks the \fIPortfile\fR of a given port for potential errors\&. It is a useful tool for port maintainers to check for possible typos, mistakes and missing definitions\&.
+.sp
+For example, it verifies that
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Portfiles are valid UTF\-8
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+all mandatory properties are present
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+all dependencies actually exist, and
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+no deprecated features are used\&.
+.RE
+.sp
+If problems are found, \fBport lint\fR emits warnings and error messages explaining the problem\&. Please fix all errors and consider fixing any warnings before submitting your \fIPortfile\fR or your changes to MacPorts\&.
+.SH "OPTIONS"
+.PP
+\fB\-\-nitpick\fR
+.RS 4
+Enables additional checks that are mostly whitespace\-related and best practices\&.
+.RE
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.PP
+\fB\-v\fR
+.RS 4
+Print messages for successful tests\&.
+.RE
+.PP
+\fB\-d\fR
+.RS 4
+Print the
+\fIPortfile\fR, and debugging information parsed from the
+\fIPortfile\fR\&.
+.RE
+.PP
+\fB\-q\fR
+.RS 4
+Supress the header line, warning and error count; only print warnings and errors, if any\&.
+.RE
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBportfile\fR(7), \fBport-dev-style\fR(7)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-lint.1.txt (from rev 124235, trunk/base/doc/port-lint.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-lint.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-lint.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,60 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-lint(1)
+============
+$Id$
+
+NAME
+----
+port-lint - Check a port for common problems
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-vdq*] [*-D* 'portdir'] *lint*
+ [--nitpick]
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port lint* checks the 'Portfile' of a given port for potential errors. It is
+a useful tool for port maintainers to check for possible typos, mistakes and
+missing definitions.
+
+For example, it verifies that
+
+ * Portfiles are valid UTF-8
+ * all mandatory properties are present
+ * all dependencies actually exist, and
+ * no deprecated features are used.
+
+If problems are found, *port lint* emits warnings and error messages explaining
+the problem. Please fix all errors and consider fixing any warnings before
+submitting your 'Portfile' or your changes to MacPorts.
+
+OPTIONS
+-------
+*--nitpick*::
+ Enables additional checks that are mostly whitespace-related and best
+ practices.
+
+include::global-flags.txt[]
+
+*-v*::
+ Print messages for successful tests.
+
+*-d*::
+ Print the 'Portfile', and debugging information parsed from the 'Portfile'.
+
+*-q*::
+ Supress the header line, warning and error count; only print warnings and
+ errors, if any.
+
+
+SEE ALSO
+--------
+man:port[1], man:portfile[7], man:port-dev-style[7]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-list.1 (from rev 124235, trunk/base/doc/port-list.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-list.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-list.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,67 @@
+'\" t
+.TH "PORT\-ECHO" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-list \- List the latest available version for the given ports
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR \fBlist\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport list\fR prints the latest version of the given port(s) that is available through MacPorts\&. It prints name, version number and the relative path of the port in the port tree, i\&.e\&. the name of the primary category followed by the port name\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.sp
+\fBport list\fR will always print the latest \fBavailable\fR version, which is not necessarily the version you have installed\&.
+.sp
+This leads to the common mistake that \fBport list installed\fR lists the same port multiple times in the same version\&. This happens because \fBinstalled\fR expands to a list of installed ports and their versions, but \fBport list\fR ignores the version and prints the latest available version for each occurrence of a port in \fBinstalled\fR\&. In these cases, you should use \fBport-installed\fR(1) or \fBport-echo\fR(1) instead\&. \fBport installed\fR and \fBport echo\fR also have the advantage of being much faster\&.
+.sp .5v
+.RE
+.sp
+Pretty much the only use case for \fBport list\fR is checking which version of a specific port is current in MacPorts, or if a port exists at all\&. Do \fBnot\fR use \fBport list\fR to print \fBoutdated\fR, \fBinactive\fR, \fBinstalled\fR, \fBrequested\fR, \fBleaves\fR, or other pseudo\-ports\&. Use \fBport-outdated\fR(1), \fBport-installed\fR(1), or \fBport-echo\fR(1) instead\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-installed\fR(1), \fBport-echo\fR(1), \fBport-outdated\fR(1)
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-list.1.txt (from rev 124235, trunk/base/doc/port-list.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-list.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-list.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,50 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-echo(1)
+============
+$Id$
+
+NAME
+----
+port-list - List the latest available version for the given ports
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* *list*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port list* prints the latest version of the given port(s) that is available
+through MacPorts. It prints name, version number and the relative path of the
+port in the port tree, i.e. the name of the primary category followed by the
+port name.
+
+[NOTE]
+====
+*port list* will always print the latest *available* version, which is not
+necessarily the version you have installed.
+
+This leads to the common mistake that *port list installed* lists the same port
+multiple times in the same version. This happens because *installed* expands to
+a list of installed ports and their versions, but *port list* ignores the
+version and prints the latest available version for each occurrence of a port in
+*installed*. In these cases, you should use man:port-installed[1] or
+man:port-echo[1] instead. *port installed* and *port echo* also have the
+advantage of being much faster.
+====
+
+Pretty much the only use case for *port list* is checking which version of
+a specific port is current in MacPorts, or if a port exists at all. Do *not* use
+*port list* to print *outdated*, *inactive*, *installed*, *requested*, *leaves*,
+or other pseudo-ports. Use man:port-outdated[1], man:port-installed[1], or
+man:port-echo[1] instead.
+
+SEE ALSO
+--------
+man:port[1], man:port-installed[1], man:port-echo[1], man:port-outdated[1]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-livecheck.1 (from rev 124235, trunk/base/doc/port-livecheck.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-livecheck.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-livecheck.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,68 @@
+'\" t
+.TH "PORT\-LIVECHECK" "1" "2014\-08\-17" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-livecheck \- Check if a new version of the software is available
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-vd\fR] [\fB\-D\fR \fIportdir\fR] \fBlivecheck\fR
+ [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport livecheck\fR checks whether a newer version of a given port is available upstream\&. It (usually) does that by automatically downloading a web page and applying a regular expression that extracts a version number\&. If the version number is different from the one the port packages, a message is printed\&.
+.sp
+\fBport livecheck\fR is useful for maintainers that want to check whether new versions of their ports are available so they can be updated\&. It can also be used by users that encounter a problem, because updating to the latest upstream version is generally one of the first steps in case of an error of when encountering a bug\&.
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.PP
+\fB\-v\fR
+.RS 4
+Print a message if the port is up to date\&.
+.RE
+.PP
+\fB\-d\fR
+.RS 4
+Print debugging information such as the regular expression and all matches\&.
+.RE
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBportfile\fR(7), \fBport-upgrade\fR(7), \m[blue]\fBLivecheck/Distcheck in the MacPorts Guide\fR\m[]\&\s-2\u[1]\d\s+2
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Clemens Lang <cal at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
+.SH "EXTERNAL REFERENCES"
+.IP " 1." 4
+Livecheck/Distcheck in the MacPorts Guide
+.RS 4
+\%http://guide.macports.org/#reference.livecheck
+.RE
Copied: branches/gsoc14-interactive/base/doc/port-livecheck.1.txt (from rev 124235, trunk/base/doc/port-livecheck.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-livecheck.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-livecheck.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,45 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-livecheck(1)
+=================
+$Id$
+
+NAME
+----
+port-livecheck - Check if a new version of the software is available
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-vd*] [*-D* 'portdir'] *livecheck*
+ [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
+
+DESCRIPTION
+-----------
+*port livecheck* checks whether a newer version of a given port is available
+upstream. It (usually) does that by automatically downloading a web page and
+applying a regular expression that extracts a version number. If the version
+number is different from the one the port packages, a message is printed.
+
+*port livecheck* is useful for maintainers that want to check whether new
+versions of their ports are available so they can be updated. It can also be
+used by users that encounter a problem, because updating to the latest upstream
+version is generally one of the first steps in case of an error of when
+encountering a bug.
+
+include::global-flags.txt[]
+
+*-v*::
+ Print a message if the port is up to date.
+
+*-d*::
+ Print debugging information such as the regular expression and all matches.
+
+SEE ALSO
+--------
+man:port[1], man:portfile[7], man:port-upgrade[7],
+guide:reference.livecheck[Livecheck/Distcheck in the MacPorts Guide]
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Clemens Lang <cal at macports.org>
Copied: branches/gsoc14-interactive/base/doc/port-location.1 (from rev 124235, trunk/base/doc/port-location.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-location.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-location.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-location.1.soelim (from rev 124235, trunk/base/doc/port-location.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-location.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-location.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-mdmg.1 (from rev 124235, trunk/base/doc/port-mdmg.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-mdmg.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-mdmg.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-mdmg.1.soelim (from rev 124235, trunk/base/doc/port-mdmg.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-mdmg.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-mdmg.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-mpkg.1 (from rev 124235, trunk/base/doc/port-mpkg.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-mpkg.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-mpkg.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-mpkg.1.soelim (from rev 124235, trunk/base/doc/port-mpkg.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-mpkg.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-mpkg.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-pkg.1 (from rev 124235, trunk/base/doc/port-pkg.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-pkg.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-pkg.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-pkg.1.soelim (from rev 124235, trunk/base/doc/port-pkg.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-pkg.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-pkg.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dmg.1
Copied: branches/gsoc14-interactive/base/doc/port-quit.1 (from rev 124235, trunk/base/doc/port-quit.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-quit.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-quit.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-exit.1
Copied: branches/gsoc14-interactive/base/doc/port-quit.1.soelim (from rev 124235, trunk/base/doc/port-quit.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-quit.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-quit.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-exit.1
Copied: branches/gsoc14-interactive/base/doc/port-rdependents.1 (from rev 124235, trunk/base/doc/port-rdependents.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-rdependents.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-rdependents.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dependents.1
Copied: branches/gsoc14-interactive/base/doc/port-rdependents.1.soelim (from rev 124235, trunk/base/doc/port-rdependents.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-rdependents.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-rdependents.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dependents.1
Copied: branches/gsoc14-interactive/base/doc/port-reclaim.1 (from rev 124235, trunk/base/doc/port-reclaim.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-reclaim.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-reclaim.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,49 @@
+'\" t
+.TH "PORT\-RECLAIM" "1" "08/20/2014" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+port-reclaim \- Reclaims disk space\&.
+.SH "SYNOPSIS"
+.sp
+.nf
+\fBport\fR [\fB\-vd\fR] \fBreclaim\fR
+.fi
+.SH "DESCRIPTION"
+.sp
+\fBport reclaim\fR will reclaim disk space by uninstalling inactive ports on your system, and removing unneeded or unused installation files\&.
+.SH "GLOBAL OPTIONS"
+.sp
+Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
+.SH "SEE ALSO"
+.sp
+\fBport\fR(1), \fBport-uninstall\fR(1), \fBport-clean\fR(1),
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+(C) 2014 The MacPorts Project
+Kyle Sammons <ksammons at macports\&.org>
+.fi
+.if n \{\
+.RE
+.\}
Copied: branches/gsoc14-interactive/base/doc/port-reclaim.1.txt (from rev 124235, trunk/base/doc/port-reclaim.1.txt)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-reclaim.1.txt (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-reclaim.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,29 @@
+// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
+port-reclaim(1)
+===============
+$Id$
+
+NAME
+----
+port-reclaim - Reclaims disk space.
+
+SYNOPSIS
+--------
+[cmdsynopsis]
+*port* [*-vd*] *reclaim*
+
+DESCRIPTION
+-----------
+*port reclaim* will reclaim disk space by uninstalling inactive ports on your
+system, and removing unneeded or unused installation files.
+
+include::global-flags.txt[]
+
+SEE ALSO
+--------
+man:port[1], man:port-uninstall[1], man:port-clean[1],
+
+AUTHORS
+-------
+ (C) 2014 The MacPorts Project
+ Kyle Sammons <ksammons at macports.org>
Modified: branches/gsoc14-interactive/base/doc/port-rev-upgrade.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-rev-upgrade.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-rev-upgrade.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-REV\-UPGRADE" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-REV\-UPGRADE" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -34,7 +34,7 @@
By default, \fBrev\-upgrade\fR is run automatically after each installation or upgrade, unless you pass the \fB\-\-no\-rev\-upgrade\fR option or disable this beahvior in \fBmacports.conf\fR(5) using the \fBrevupgrade_autorun\fR switch\&.
.SH "OPTIONS"
.PP
-\-\-id\-loadcmd\-check
+\fB\-\-id\-loadcmd\-check\fR
.RS 4
Check the ID load command in each library installed by MacPorts\&. This load command contains a path that should always reference the library itself, because the path will be copied into all binaries and libraries that link against this library\&. This option verifies that this is the case and will detect incorrect or non\-absolute paths\&. Since this check is only helpful for port maintainers, it is disabled by default\&.
.RE
Modified: branches/gsoc14-interactive/base/doc/port-rev-upgrade.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-rev-upgrade.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-rev-upgrade.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -29,7 +29,7 @@
OPTIONS
-------
---id-loadcmd-check::
+*--id-loadcmd-check*::
Check the ID load command in each library installed by MacPorts. This load
command contains a path that should always reference the library itself,
because the path will be copied into all binaries and libraries that link
Modified: branches/gsoc14-interactive/base/doc/port-selfupdate.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-selfupdate.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-selfupdate.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-SELFUPDATE" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-SELFUPDATE" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -33,7 +33,7 @@
You should regularly run \fBselfupdate\fR to update your local port definitions\&. Running \fBselfupdate\fR is required to get updated software with bug fixes and new features\&.
.SH "OPTIONS"
.PP
-\-\-nosync
+\fB\-\-nosync\fR
.RS 4
Only check for updates \- and install if available \- for MacPorts itself\&. Do not update the ports tree\&.
.RE
@@ -41,12 +41,12 @@
.sp
Please see the section \fBGLOBAL OPTIONS\fR in the \fBport\fR(1) man page for a description of global port options\&.
.PP
-\-q
+\fB\-q\fR
.RS 4
Supress status output, be as silent as possible\&.
.RE
.PP
-\-f
+\fB\-f\fR
.RS 4
Do not check whether the downloaded MacPorts version is newer than the currently installed one, but always rebuild and reinstall MacPorts\&.
Modified: branches/gsoc14-interactive/base/doc/port-selfupdate.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-selfupdate.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-selfupdate.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -26,16 +26,16 @@
OPTIONS
-------
---nosync::
+*--nosync*::
Only check for updates - and install if available - for MacPorts itself. Do
not update the ports tree.
include::global-flags.txt[]
--q::
+*-q*::
Supress status output, be as silent as possible.
--f::
+*-f*::
Do not check whether the downloaded MacPorts version is newer than the
currently installed one, but always rebuild and reinstall MacPorts.
+
Modified: branches/gsoc14-interactive/base/doc/port-uninstall.1
===================================================================
--- branches/gsoc14-interactive/base/doc/port-uninstall.1 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-uninstall.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -1,5 +1,5 @@
'\" t
-.TH "PORT\-INSTALL" "1" "2014\-08\-03" "MacPorts 2\&.3\&.99" "MacPorts Manual"
+.TH "PORT\-INSTALL" "1" "2014\-08\-16" "MacPorts 2\&.3\&.99" "MacPorts Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -36,17 +36,17 @@
If multiple versions of the same port are installed, you need to specify a version using the \fB at version\fR syntax\&. Use \fBport installed\fR to find out which versions are currently installed on your system\&. If multiple versions are installed and you did not specify a version, \fBport\fR will output a list\&.
.SH "OPTIONS"
.PP
-\-\-follow\-dependents
+\fB\-\-follow\-dependents\fR
.RS 4
Also uninstall all ports recursively depending directly or indirectly on one of the specified ports before uninstalling the port itself\&.
.RE
.PP
-\-\-follow\-dependencies
+\fB\-\-follow\-dependencies\fR
.RS 4
Also recursively uninstall all ports that the specified port depends on\&. This will not uninstall dependencies that are marked as requested or that have other dependents\&.
.RE
.PP
-\-\-no\-exec
+\fB\-\-no\-exec\fR
.RS 4
Do not execute any stored pre\- or post\-uninstall procedures\&.
.RE
Modified: branches/gsoc14-interactive/base/doc/port-uninstall.1.txt
===================================================================
--- branches/gsoc14-interactive/base/doc/port-uninstall.1.txt 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/doc/port-uninstall.1.txt 2014-08-21 17:47:06 UTC (rev 124236)
@@ -28,16 +28,16 @@
OPTIONS
-------
---follow-dependents::
+*--follow-dependents*::
Also uninstall all ports recursively depending directly or indirectly on one
of the specified ports before uninstalling the port itself.
---follow-dependencies::
+*--follow-dependencies*::
Also recursively uninstall all ports that the specified port depends on.
This will not uninstall dependencies that are marked as requested or that
have other dependents.
---no-exec::
+*--no-exec*::
Do not execute any stored pre- or post-uninstall procedures.
Copied: branches/gsoc14-interactive/base/doc/port-url.1 (from rev 124235, trunk/base/doc/port-url.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-url.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-url.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-url.1.soelim (from rev 124235, trunk/base/doc/port-url.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-url.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-url.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-work.1 (from rev 124235, trunk/base/doc/port-work.1)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-work.1 (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-work.1 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Copied: branches/gsoc14-interactive/base/doc/port-work.1.soelim (from rev 124235, trunk/base/doc/port-work.1.soelim)
===================================================================
--- branches/gsoc14-interactive/base/doc/port-work.1.soelim (rev 0)
+++ branches/gsoc14-interactive/base/doc/port-work.1.soelim 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1 @@
+.so man1/port-dir.1
Modified: branches/gsoc14-interactive/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- branches/gsoc14-interactive/base/src/darwintracelib1.0/darwintrace.c 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/darwintracelib1.0/darwintrace.c 2014-08-21 17:47:06 UTC (rev 124236)
@@ -37,6 +37,7 @@
#define DARWINTRACE_USE_PRIVATE_API 1
#include "darwintrace.h"
+#include "sandbox_actions.h"
#ifdef HAVE_LIBKERN_OSATOMIC_H
#include <libkern/OSAtomic.h>
@@ -127,15 +128,10 @@
* 0: allow
* 1: map the path to the one given in additional_data (currently unsupported)
* 2: check for a dependency using the socket
+ * 3: deny access to the path and stop processing
*/
static char *filemap;
-enum {
- FILEMAP_ALLOW = 0,
- // FILEMAP_REDIR = 1,
- FILEMAP_ASK = 2
-};
-
/**
* Setup method called as constructor to set up thread-local storage for the
* thread id and the darwintrace socket.
@@ -661,7 +657,7 @@
// access anyway, but report a sandbox violation.
// TODO find a better solution
if ((flags & DT_REPORT) > 0) {
- __darwintrace_log_op("sandbox_violation", path);
+ __darwintrace_log_op("sandbox_unknown", path);
}
return true;
case 0:
@@ -671,6 +667,11 @@
}
return false;
}
+ case FILEMAP_DENY:
+ if ((flags & DT_REPORT) > 0) {
+ __darwintrace_log_op("sandbox_violation", path);
+ }
+ return false;
default:
fprintf(stderr, "darwintrace: error: unexpected byte in file map: `%x'\n", *t);
abort();
Modified: branches/gsoc14-interactive/base/src/darwintracelib1.0/proc.c
===================================================================
--- branches/gsoc14-interactive/base/src/darwintracelib1.0/proc.c 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/darwintracelib1.0/proc.c 2014-08-21 17:47:06 UTC (rev 124236)
@@ -91,7 +91,7 @@
if (NULL != (val = getenv(#name))) {\
size_t lenName = strlen(#name);\
size_t lenVal = strlen(val);\
- if (NULL == (variable = malloc(lenName + lenVal + 0 + 1))) {\
+ if (NULL == (variable = malloc(lenName + 1 + lenVal + 1))) {\
perror("darwintrace: malloc");\
abort();\
}\
Copied: branches/gsoc14-interactive/base/src/darwintracelib1.0/sandbox_actions.h (from rev 124235, trunk/base/src/darwintracelib1.0/sandbox_actions.h)
===================================================================
--- branches/gsoc14-interactive/base/src/darwintracelib1.0/sandbox_actions.h (rev 0)
+++ branches/gsoc14-interactive/base/src/darwintracelib1.0/sandbox_actions.h 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014 The MacPorts Project
+ * All rights reserved.
+ *
+ * $Id$
+ *
+ * @APPLE_BSD_LICENSE_HEADER_START@
+ *
+ * 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. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+ *
+ * @APPLE_BSD_LICENSE_HEADER_END@
+ */
+
+enum {
+ FILEMAP_ALLOW = 0,
+ // FILEMAP_REDIR = 1,
+ FILEMAP_ASK = 2,
+ FILEMAP_DENY = 3
+};
Modified: branches/gsoc14-interactive/base/src/macports1.0/Makefile.in
===================================================================
--- branches/gsoc14-interactive/base/src/macports1.0/Makefile.in 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/macports1.0/Makefile.in 2014-08-21 17:47:06 UTC (rev 124236)
@@ -4,7 +4,7 @@
include ../../Mk/macports.autoconf.mk
SRCS= macports.tcl macports_dlist.tcl macports_util.tcl \
- macports_autoconf.tcl
+ macports_autoconf.tcl doctor.tcl reclaim.tcl
OBJS= macports.o get_systemconfiguration_proxies.o sysctl.o
SHLIB_NAME= MacPorts${SHLIB_SUFFIX}
Copied: branches/gsoc14-interactive/base/src/macports1.0/doctor.tcl (from rev 124235, trunk/base/src/macports1.0/doctor.tcl)
===================================================================
--- branches/gsoc14-interactive/base/src/macports1.0/doctor.tcl (rev 0)
+++ branches/gsoc14-interactive/base/src/macports1.0/doctor.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,742 @@
+# -*- 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
+# doctor.tcl
+# $Id: doctor.tcl 119177 2014-04-18 22:35:29Z cal at macports.org $
+#
+# Copyright (c) 2002 - 2003 Apple Inc.
+# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot at kallisys.net>.
+# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb at opendarwin.org>.
+# Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2004 - 2014 The MacPorts Project
+# 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.
+
+# Todo:
+
+# Done:
+# Add -q for quiet mode, where we don't print anything
+# Check for command line tools
+# Check for any DYLD_* environmental variables
+# Check for '.la' in dylib and '.prl'
+# Check if installed files are readable
+# Check for sqlite
+# Check for openssl
+# Crowd-source more ideas from the mailing-list
+# Check if $PATH is first
+# Check for issues with compilation. Compile small, simple file, check for "couldn't create cache file"
+# check_for_stray_developer_directory
+# Check for *.h, *.hpp, *.hxx in /usr/local/include
+# Check for *.dylib in /usr/local/lib
+# Check for other package managers. Fink = /sw, homebrew = /usr/local/Cellar
+# Check for all files installed by ports exists
+# Check for archives from all ports exists
+# Check for things in /usr/local
+# Check for x11.app if the OS is 10.6 and suggest installing xorg-server or the site on macosforge
+# Add error catching for line's without an equals sign.
+# Support comments for the parser
+# Check for amount of drive space
+# Move port_doctor.ini to the port tree, below _resources
+# Check for curl
+# Check for rsync
+# Check if macports is in /opt/local
+
+
+package provide doctor 1.0
+
+package require macports
+package require reclaim 1.0
+
+namespace eval doctor {
+
+ # Command line argument that determines whether or not to output things fancily.
+ variable quiet 0
+
+ proc main {opts} {
+
+ # The main function. Handles all the calls to the correct functions, and sets the config_options array,
+ # as well as the parser_options array.
+ #
+ # Args:
+ # opts - The options passed in. Currently the only option availible is 'quiet'.
+ # Returns:
+ # None
+
+ # Setting the 'quiet' variable based on what was passed in.
+ if {$opts ne ""} {
+ set doctor::quiet 1
+ } else {
+ set doctor::quiet 0
+ }
+
+ array set config_options [list]
+ set parser_options {"macports_location" "profile_path" "shell_location" "xcode_version_10.10" "xcode_version_10.9" "xcode_version_10.8" \
+ "xcode_version_10.7" "xcode_version_10.6" "xcode_version_10.7" "xcode_version_10.6" "xcode_version_10.5" \
+ "xcode_version_10.4" "xcode_build"}
+
+ set user_config_path ${macports::portdbpath}/port_doctor.ini
+ set xcode_config_path [macports::getdefaultportresourcepath "macports1.0/xcode_versions.ini"]
+
+ # Make sure at least a default copy of the xcode and user config exist
+ make_xcode_config $xcode_config_path
+ make_user_config $user_config_path
+
+ # Read the config files
+ get_config config_options $parser_options $user_config_path
+ get_config config_options $parser_options $xcode_config_path
+
+ # Start the checks
+ check_path $config_options(macports_location) $config_options(profile_path) $config_options(shell_location)
+ check_xcode config_options
+ check_for_app curl
+ check_for_app rsync
+ check_for_app openssl
+ check_for_app sqlite3
+ check_macports_location
+ check_free_space
+ check_for_x11
+ check_for_files_in_usr_local
+ check_tarballs
+ check_port_files
+ check_for_package_managers
+ check_for_stray_developer_directory
+ check_compilation_error_cache
+ check_for_dyld
+ check_for_clt
+ }
+
+ proc check_for_clt {} {
+
+ # Checks to see if the Xcode Command Line Tools are installed by checking if the file
+ # /Library/Developer/CommandLineTools exists if the system is running 10.9, or if they're
+ # running an older version, if the command xcode-select -p outputs something.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "command line tools"
+
+ set version ${macports::macosx_version}
+
+ if {$version == 10.9} {
+
+ if {![file exists "/Library/Developer/CommandLineTools/"]} {
+
+ ui_warn "Xcode Command Line Tools are not installed! To install them, please enter the command:
+ xcode-select --install"
+ success_fail 0
+ return
+ }
+ success_fail 1
+ return
+
+ } else {
+
+ set xcode_select [exec xcode-select -p]
+
+ if {$xcode_select eq ""} {
+
+ ui_warn "Xcode Command Line Tools are not installed! To install them, please enter the command:
+ xcode-selct --install"
+ success_fail 0
+ return
+ }
+ success_fail 1
+ }
+ }
+
+ proc check_for_dyld {} {
+
+ # Checks to see if the current MacPorts session is running with a DYLD_* environmental
+ # variable set.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "DYLD_* environmental variables"
+
+ set printenv [exec printenv]
+ set split [split $printenv]
+
+ if {[regexp {DYLD_.} $split]} {
+ ui_warn "found a DYLD_* environmental variable. These are known to cause issues with MacPorts. Please\
+ unset the variable for the duration MacPorts is running."
+
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+ }
+
+ proc output {string} {
+
+ # Outputs the given string formatted correctly.
+ #
+ # Args:
+ # string - The string to be output
+ # Returns:
+ # None
+
+ if {${doctor::quiet} == 0} {
+ ui_msg -nonewline "Checking for $string... "
+ }
+ }
+
+ proc success_fail {result} {
+
+ # Either outputs a [SUCCESS] or [FAILED], depending on the result.
+ #
+ # Args:
+ # result - An integer value. 1 = [SUCCESS], anything else = [FAILED]
+ # Returns:
+ # None
+
+ if {${doctor::quiet} eq 0} {
+
+ if {$result == 1} {
+
+ ui_msg "\[SUCCESS\]"
+ return
+ }
+
+ ui_msg "\[FAILED\]"
+ }
+ }
+
+ proc check_compilation_error_cache {} {
+
+ # Checks to see if the compiler can compile properly, or it throws the error, "couldn't create cache file".
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "compilation errors"
+
+ set filename "test.c"
+ set fd [open $filename w]
+
+ puts $fd "int main() { return 0; }"
+ close $fd
+
+ set output [exec clang $filename -o main_test]
+
+ file delete $filename
+ file delete "main_test"
+
+ if {"couldn't create cache file" in $output} {
+ ui_warn "found errors when attempting to compile file. To fix this issue, delete your tmp folder using:
+ rm -rf \$TMPDIR"
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+
+ }
+
+ proc check_for_stray_developer_directory {} {
+
+ # Checks to see if the script to remove leftover files from Xcode has been run or not. Implementation heavily influenced
+ # by Homebrew implementation.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "stray developer directory"
+
+ set uninstaller "/Developer/Library/uninstall-developer-folder"
+
+ if {${macports::xcodeversion} >= 4.3 && [file exists $uninstaller]} {
+ ui_warn "you have leftover files from an older version of Xcode. You should delete them by using, $uninstaller"
+
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+ }
+
+ proc check_for_package_managers {} {
+
+ # Checks to see if either Fink or Homebrew are installed on the system. If they are, it warns them and suggest they uninstall
+ # or move them to a different location.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "HomeBrew"
+
+ if {[file exists "/usr/local/Cellar"]} {
+ ui_warn "it seems you have Homebrew installed on this system -- Because Homebrew uses /usr/local, this can potentially cause issues \
+ with MacPorts. We'd recommend you either uninstall it, or move it from /usr/local for now."
+
+ success_fail 0
+
+ } else {
+
+ success_fail 1
+ }
+
+ output "Fink"
+ if {[file exists "/sw"]} {
+ ui_warn "it seems you have Fink installed on your system -- This could potentially cause issues with MacPorts. We'd recommend you'd \
+ either uninstall it, or move it from /sw for now."
+
+ success_fail 0
+
+ } else {
+
+ success_fail 1
+ }
+ }
+
+ proc check_port_files {} {
+
+ # Checks to see if each file installed by all active and installed ports actually exists on the filesystem. If not, it warns
+ # the user and suggests the user deactivate and reactivate the port.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+
+ set apps [reclaim::get_info]
+
+ array set activeApps {}
+ set totalFiles 0
+
+ foreach app $apps {
+
+ set name [lindex $app 0]
+ set active [lindex $app 4]
+ set files [registry::port_registered $name]
+
+ if {$active} {
+ set activeApps($name) $files
+ incr totalFiles [llength $files]
+ }
+ }
+
+ set fancyOutput [expr {![macports::ui_isset ports_debug] && ![macports::ui_isset ports_verbose] && [info exists macports::ui_options(progress_generic)] \
+ && ${doctor::quiet} == 0}]
+
+ if {$fancyOutput} {
+ set progress $macports::ui_options(progress_generic)
+ }
+
+ if {$totalFiles > 0} {
+ if {$fancyOutput} {
+ output "files installed by ports on disk"
+ if {${doctor::quiet} == 0} {
+ # we need a newline here or the progress bar will overwrite the line
+ ui_msg ""
+ }
+ $progress start
+ }
+
+ set currentFile 1
+ foreach name [lsort [array names activeApps]] {
+ foreach file $activeApps($name) {
+ if {$fancyOutput} {
+ $progress update $currentFile $totalFiles
+ } else {
+ output "file '$file' on disk"
+ }
+
+ if {![file exists $file]} {
+ if {$fancyOutput} {
+ $progress intermission
+ } else {
+ success_fail 0
+ }
+
+ if {[catch {file lstat $file _}]} {
+ ui_warn "couldn't find file '$file' for port '$name'. Please deactivate and reactivate the port to fix this issue."
+ }
+ } elseif {![file readable $file]} {
+ if {$fancyOutput} {
+ $progress intermission
+ } else {
+ success_fail 0
+ }
+
+ ui_warn "'$file' installed by port '$name' is currently not readable. Please try again. If this problem persists, please contact the mailing list."
+ } elseif {!$fancyOutput} {
+ success_fail 1
+ }
+
+ incr currentFile
+ }
+ }
+
+ if {$fancyOutput} {
+ $progress finish
+ }
+ }
+ }
+
+ proc check_tarballs {} {
+
+ # Checks if the archives for each installed port in /opt/local/var/macports/software/$name is actually in there. If not, it warns
+ # the user and suggest a reinstallation of the port.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ set apps [reclaim::get_info]
+
+ foreach app $apps {
+
+
+ set name [lindex $app 0]
+ set version [lindex $app 1]
+ set revision [lindex $app 2]
+ set variants [lindex $app 3]
+ set epoch [lindex $app 5]
+
+ output "'${name} @${version}_${revision}${variants}'s tarball on disk"
+
+ set ref [registry::open_entry $name $version $revision $variants $epoch]
+ set image_dir [registry::property_retrieve $ref location]
+
+ if {![file exists $image_dir]} {
+ ui_warn "couldn't find the archive for '$name'. Please uninstall and reinstall this application."
+ success_fail 0
+ } else {
+ success_fail 1
+ }
+ }
+ }
+
+ proc check_for_files_in_usr_local {} {
+
+ # Checks for dylibs in /usr/local/lib and header files in /usr/local/include, and warns the user about said files if they
+ # are found.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "dylibs in /usr/local/lib"
+
+ if {[glob -nocomplain -directory "/usr/local/lib" *.dylib *.la *.prl] ne ""} {
+ ui_warn "found dylib's in your /usr/local/lib directory. These are known to cause problems. We'd recommend \
+ you remove them."
+
+ success_fail 0
+
+ } else {
+
+ success_fail 1
+ }
+
+ output "header files in /usr/local/include"
+
+ if {[glob -nocomplain -directory "/usr/local/include" *.h *.hpp *.hxx] ne ""} {
+ ui_warn "found header files in your /usr/local/include directory. These are known to cause problems. We'd recommend \
+ you remove them."
+
+ success_fail 0
+
+ } else {
+
+ success_fail 1
+ }
+ }
+
+ proc check_for_x11 {} {
+
+ # Checks to see if the user is using the X11.app, and if they're on 10.6. If they are, it alerts them about it.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "X11.app on OS X 10.6 systems"
+
+ set mac_version ${macports::macosx_version}
+
+ if {$mac_version == 10.6} {
+
+ if {[file exists /Applications/X11.app]} {
+ ui_error "it seems you have Mac OSX 10.6 installed, and are using X11 from \"X11.app\". This has been known to cause issues. \
+ To fix this, please install xorg-server, by using the command 'sudo port install xorg-server', or installing it from \
+ their website, http://xquartz.macosforge.org/trac/wiki/Releases."
+
+ success_fail 0
+ return
+ }
+ }
+
+ success_fail 1
+ }
+
+ proc check_free_space {} {
+
+ # Checks to see if the user has less than 5 gigs of space left, and warns if they don't.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "free disk space"
+
+ set output [exec df -g]
+ set tokens [split $output \n]
+ set disk_info [lindex $tokens 1]
+ set availible [lindex $disk_info 3]
+
+ if {$availible < 5} {
+ ui_warn "you have less than 5 gigabytes free on your machine! This can cause serious errors. We recommend trying to clear out unnecessary \
+ programs and files by running 'sudo port reclaim', or manually uninstalling/deleting programs and folders on your drive."
+
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+ }
+
+ proc check_macports_location {} {
+
+ # Checks to see if port is where it should be. If it isn't, freak the frick out.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ output "MacPort's location"
+
+ if {[file exists ${macports::prefix}/bin/port] == 0} {
+ ui_error "port was not in ${macports::prefix}/bin. This can potentially cause errors. It's recommended you move it back to ${macports::prefix}/bin."
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+ }
+
+ proc check_for_app {app} {
+
+ # Check's if the binary supplied exists in /usr/bin. If it doesn't, it warns the user.
+ #
+ # Args:
+ # app - The name of the app to check for.
+ # Returns
+ # None
+
+ output "for '$app'"
+
+ if {[file exists /usr/bin/$app] == 0} {
+ ui_error "$app is needed by MacPorts to function normally, but wasn't found on this system. We'd recommend \
+ installing it for continued use of MacPorts."
+ success_fail 0
+ return
+ }
+
+ success_fail 1
+ }
+
+ proc check_xcode {config_options} {
+
+ # Checks to see if the currently installed version of Xcode works with the curent OS version.
+ #
+ # Args:
+ # config_options - The associative array containing all options in the config files
+ # Returns:
+ # None
+
+ output "correct Xcode version"
+
+ upvar $config_options config
+
+ set mac_version ${macports::macosx_version}
+ set xcode_current ${macports::xcodeversion}
+ set xcode_versions $config(xcode_version_$mac_version)
+
+ if {$xcode_current in $xcode_versions} {
+ success_fail 1
+ return
+
+ } else {
+ ui_error "currently installed version of Xcode, $xcode_current, is not supported by MacPorts. \
+ For your currently installed system, only the following versions of Xcode are supported: \
+ $xcode_versions"
+ success_fail 0
+ }
+ }
+
+ proc make_xcode_config {path} {
+
+ # Checks to see if xcode_versions.ini exists. If it does, it returns. If it doesn't, then it creats a defult config file.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ if {[file exists $path] == 0} {
+ ui_error "No configuration file found at $path. Please run,
+ \"port selfupdate\""
+ exit
+
+ }
+ }
+
+ proc make_user_config {path} {
+
+ # Builds a config file for the user using all default parameters if needed.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ if {[file exists $path] == 0} {
+
+ ui_warn "No configuration file found at $path. Creating generic config file."
+
+ set fd [open $path w]
+ puts $fd "macports_location=${macports::prefix}"
+ puts $fd "profile_path=${macports::user_home}/.bash_profile"
+ puts $fd "shell_location=/bin/bash"
+
+ close $fd
+ }
+ }
+
+ proc get_config {config_options parser_options path} {
+
+ # Reads in and parses the configuration file passed in to $path. After parsing, all variables found are assigned
+ # in the 'config_options' associative array.
+ #
+ # Args:
+ # config_options - The associative array responsible for holding all the configuration options.
+ # parser_options - The list responsible for holding each option to set/look for in the configuration file.
+ # path - The path to the correct config_file
+ # Returns:
+ # None.
+
+ upvar $config_options config
+
+ set fd [open $path r]
+ set text [read $fd]
+ set data [split $text "\n"]
+
+ close $fd
+
+ foreach line $data {
+
+ # Ignore comments
+ if {[string index $line 0] eq "#" } {
+ continue
+ }
+
+ #The tokens
+ set tokens [split $line "="]
+
+ # Only care about things that are in $parser_options
+ if {[lindex $tokens 0] in $parser_options} {
+ set config([lindex $tokens 0]) [lindex $tokens 1]
+
+ # Ignore whitespace
+ } elseif {[lindex $tokens 0] eq ""} {
+ continue
+
+ } else {
+ ui_error "unrecognized config option in file $path: [lindex $tokens 0]"
+ }
+ }
+ }
+
+ proc check_path {port_loc profile_path shell_loc} {
+
+ # Checks to see if port_location/bin and port_location/sbin are in the environmental $PATH variable.
+ # If they aren't, it appends it to the correct shell's profile file.
+ #
+ # Args:
+ # port_loc - The location of port (as set in the config file)
+ # profile_path - The location of the profile file (as set in the config file)
+ # shell_loc - The location of the shell binary (as set in the config file)
+ # Returns:
+ # None.
+
+ set path ${macports::user_path}
+ set split [split $path :]
+
+ if {"$port_loc/bin" in $split && "$port_loc/sbin" in $split } {
+
+ if {[lindex $split 0] != "$port_loc/bin"} {
+ ui_warn "$port_loc/bin is not first in your PATH environmental variable. This may or may not \
+ cause problems in the future."
+ }
+ return
+
+ } else {
+ ui_warn "your environmental \$PATH variable does not currently include, $port_loc/bin, which is where port is located. \
+ Would you like to add $port_loc/bin to your \$PATH variable now? \[Y/N\]"
+ set input [gets stdin]
+
+ if {$input == "y" || $input == "Y"} {
+ ui_msg "Attempting to add $port_loc/bin to $profile_path"
+
+ if {[file exists $profile_path] == 1} {
+ set fd [open $profile_path a]
+
+ } else {
+ ui_error "$profile_path does not exist."
+ }
+
+ puts $fd "export PATH=$port_loc/bin:$port_loc/sbin:\$PATH"
+ close $fd
+
+ ui_msg "Added PATH properly. Please execute, 'source $profile_path' in a new terminal window."
+
+ } elseif {$input == "n" || $input == "N"} {
+ ui_msg "Not fixing your \$PATH variable."
+
+ } else {
+ ui_msg "Not a valid choice: $input"
+ }
+ }
+ }
+}
Modified: branches/gsoc14-interactive/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc14-interactive/base/src/macports1.0/macports.tcl 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/macports1.0/macports.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -36,6 +36,8 @@
package provide macports 1.0
package require macports_dlist 1.0
package require macports_util 1.0
+package require doctor 1.0
+package require reclaim 1.0
package require Tclx
namespace eval macports {
@@ -55,7 +57,7 @@
variable user_options {}
variable portinterp_options "\
portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
- registry.path registry.format user_home \
+ registry.path registry.format user_home user_path \
portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
rsync_server rsync_options rsync_dir startupitem_type startupitem_install place_worksymlink macportsuser \
configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
@@ -658,6 +660,9 @@
set macports::user_home /dev/null/NO_HOME_DIR
}
+ # Save the path for future processing
+ set macports::user_path $env(PATH)
+
# Configure the search path for configuration files
set conf_files {}
lappend conf_files ${macports_conf_path}/macports.conf
@@ -1189,6 +1194,9 @@
}
}
+ # Check the last time 'reclaim' was run
+ macports::check_last_reclaim
+
# init registry
set db_path [file join ${registry.path} registry registry.db]
set db_exists [file exists $db_path]
@@ -2142,6 +2150,9 @@
set required_archs [$workername eval get_canonical_archs]
set depends_skip_archcheck [_mportkey $mport depends_skip_archcheck]
+ # Pluralize "arch" appropriately.
+ set s [expr {[llength $required_archs] == 1 ? "" : "s"}]
+
set test _portnameactive
foreach deptype $deptypes {
@@ -2184,7 +2195,7 @@
}
}
if {[llength $missing] > 0} {
- ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
+ ui_error "Cannot install [_mportkey $mport subport] for the arch${s} '$required_archs' because"
ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
ui_error "and the configured universal_archs '$macports::universal_archs' are not sufficient."
return -code error "architecture mismatch"
@@ -2196,12 +2207,12 @@
}
} else {
# already universal
- ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
+ ui_error "Cannot install [_mportkey $mport subport] for the arch${s} '$required_archs' because"
ui_error "its dependency $dep_portname is only installed for the archs '$active_archs'."
return -code error "architecture mismatch"
}
} else {
- ui_error "Cannot install [_mportkey $mport subport] for the arch(s) '$required_archs' because"
+ ui_error "Cannot install [_mportkey $mport subport] for the arch${s} '$required_archs' because"
ui_error "its dependency $dep_portname is only installed for the arch '$active_archs'"
ui_error "and does not have a universal variant."
return -code error "architecture mismatch"
@@ -2315,7 +2326,7 @@
ui_debug "Skipping $source"
continue
}
- set needs_portindex 0
+ set needs_portindex false
ui_info "Synchronizing local ports tree from $source"
switch -regexp -- [macports::getprotocol $source] {
{^file$} {
@@ -2330,24 +2341,32 @@
if {
[catch {
if {[getuid] == 0} {
- set euid [geteuid]
- set egid [getegid]
- ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
- setegid [name_to_gid [file attributes $portdir -group]]
- seteuid [name_to_uid [file attributes $portdir -owner]]
+ # Must change egid before dropping root euid.
+ set old_egid [getegid]
+ set new_egid [name_to_gid [file attributes $portdir -group]]
+ setegid $new_egid
+ ui_debug "Changed effective group ID from $old_egid to $new_egid"
+ set old_euid [geteuid]
+ set new_euid [name_to_uid [file attributes $portdir -owner]]
+ seteuid $new_euid
+ ui_debug "Changed effective user ID from $old_euid to $new_euid"
}
system $svn_commandline
if {[getuid] == 0} {
- seteuid $euid
- setegid $egid
+ seteuid $old_euid
+ ui_debug "Changed effective user ID from $new_euid to $old_euid"
+ setegid $old_egid
+ ui_debug "Changed effective group ID from $new_egid to $old_egid"
}
}]
} {
ui_debug $::errorInfo
ui_error "Synchronization of the local ports tree failed doing an svn update"
if {[getuid] == 0} {
- seteuid $euid
- setegid $egid
+ seteuid $old_euid
+ ui_debug "Changed effective user ID from $new_euid to $old_euid"
+ setegid $old_egid
+ ui_debug "Changed effective group ID from $new_egid to $old_egid"
}
incr numfailed
continue
@@ -2364,30 +2383,38 @@
if {
[catch {
if {[getuid] == 0} {
- set euid [geteuid]
- set egid [getegid]
- ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
- setegid [name_to_gid [file attributes $portdir -group]]
- seteuid [name_to_uid [file attributes $portdir -owner]]
+ # Must change egid before dropping root euid.
+ set old_egid [getegid]
+ set new_egid [name_to_gid [file attributes $portdir -group]]
+ setegid $new_egid
+ ui_debug "Changed effective group ID from $old_egid to $new_egid"
+ set old_euid [geteuid]
+ set new_euid [name_to_uid [file attributes $portdir -owner]]
+ seteuid $new_euid
+ ui_debug "Changed effective user ID from $old_euid to $new_euid"
}
system $git_commandline
if {[getuid] == 0} {
- seteuid $euid
- setegid $egid
+ seteuid $old_euid
+ ui_debug "Changed effective user ID from $new_euid to $old_euid"
+ setegid $old_egid
+ ui_debug "Changed effective group ID from $new_egid to $old_egid"
}
}]
} {
ui_debug $::errorInfo
ui_error "Synchronization of the local ports tree failed doing a git update"
if {[getuid] == 0} {
- seteuid $euid
- setegid $egid
+ seteuid $old_euid
+ ui_debug "Changed effective user ID from $new_euid to $old_euid"
+ setegid $old_egid
+ ui_debug "Changed effective group ID from $new_egid to $old_egid"
}
incr numfailed
continue
}
}
- set needs_portindex 1
+ set needs_portindex true
}
{^rsync$} {
# Where to, boss?
@@ -2470,7 +2497,7 @@
file delete -force ${destdir}/tmp
}
- set needs_portindex 1
+ set needs_portindex true
# now sync the index if the local file is missing or older than a day
if {![file isfile $indexfile] || [clock seconds] - [file mtime $indexfile] > 86400
|| [info exists options(no_reindex)]} {
@@ -2487,10 +2514,10 @@
ui_debug "Synchronization of the PortIndex failed doing rsync"
} else {
set ok 1
- set needs_portindex 0
+ set needs_portindex false
if {$is_tarball} {
set ok 0
- set needs_portindex 1
+ set needs_portindex true
# verify signature for PortIndex
set rsync_commandline "$macports::autoconf::rsync_path $rsync_options ${remote_indexfile}.rmd160 $destdir"
ui_debug $rsync_commandline
@@ -2498,7 +2525,7 @@
foreach pubkey $macports::archivefetch_pubkeys {
if {![catch {exec $openssl dgst -ripemd160 -verify $pubkey -signature ${destdir}/PortIndex.rmd160 ${destdir}/PortIndex} result]} {
set ok 1
- set needs_portindex 0
+ set needs_portindex false
ui_debug "successful verification with key $pubkey"
break
} else {
@@ -2612,7 +2639,7 @@
}
if {$needs_portindex} {
- set any_needed_portindex 1
+ set any_needed_portindex true
if {![info exists options(no_reindex)]} {
global macports::prefix
set indexdir [file dirname [macports::getindex $source]]
@@ -2628,9 +2655,12 @@
_mports_load_quickindex
}
- if {$numfailed > 0} {
- return -code error "Synchronization of $numfailed source(s) failed"
+ if {$numfailed == 1} {
+ return -code error "Synchronization of 1 source failed"
}
+ if {$numfailed >= 2} {
+ return -code error "Synchronization of $numfailed sources failed"
+ }
}
##
@@ -3323,11 +3353,15 @@
if {![macports::ui_isset ports_debug]} {
ui_msg {}
}
- ui_error "Cannot install $port for the arch(s) '$required_archs' because"
+
+ set s [expr {[llength $required_archs] == 1 ? "" : "s"}]
+
+ ui_error "Cannot install $port for the arch${s} '$required_archs' because"
if {$supported_archs ne {}} {
+ set ss [expr {[llength $supported_archs] == 1 ? "" : "s"}]
foreach arch $required_archs {
if {[lsearch -exact $supported_archs $arch] == -1} {
- ui_error "its dependency $dep only supports the arch(s) '$supported_archs'."
+ ui_error "its dependency $dep only supports the arch${ss} '$supported_archs'."
return
}
}
@@ -3335,15 +3369,15 @@
if {$has_universal} {
foreach arch $required_archs {
if {[lsearch -exact $universal_archs $arch] == -1} {
- ui_error "its dependency $dep does not build for the required arch(s) by default"
+ ui_error "its dependency $dep does not build for the required arch${s} by default"
ui_error "and the configured universal_archs '$universal_archs' are not sufficient."
return
}
}
- ui_error "its dependency $dep cannot build for the required arch(s)."
+ ui_error "its dependency $dep cannot build for the required arch${s}."
return
}
- ui_error "its dependency $dep does not build for the required arch(s) by default"
+ ui_error "its dependency $dep does not build for the required arch${s} by default"
ui_error "and does not have a universal variant."
}
@@ -4373,6 +4407,45 @@
return yes
}
+proc macports::doctor_main {opts} {
+
+ # Calls the main function for the 'port doctor' command.
+ #
+ # Args:
+ # None
+ # Returns:
+ # 0 on successful execution.
+
+ doctor::main $opts
+ return 0
+}
+
+proc macports::check_last_reclaim {} {
+
+ # An abstraction layer for the reclaim function, 'check_last_run'.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ reclaim::check_last_run
+ return 0
+}
+
+proc macports::reclaim_main {} {
+
+ # Calls the main function for the 'port reclaim' command.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ reclaim::main
+ return 0
+}
+
##
# Execute the rev-upgrade scan and attempt to rebuild all ports found to be
# broken. Depends on the revupgrade_mode setting from macports.conf.
@@ -4660,11 +4733,14 @@
machista::destroy_handle $handle
- if {[llength $broken_files] == 0} {
+ set num_broken_files [llength $broken_files]
+ set s [expr {$num_broken_files == 1 ? "" : "s"}]
+
+ if {$num_broken_files == 0} {
ui_msg "$macports::ui_prefix No broken files found."
return 0
}
- ui_msg "$macports::ui_prefix Found [llength $broken_files] broken file(s), matching files to ports"
+ ui_msg "$macports::ui_prefix Found $num_broken_files broken file${s}, matching files to ports"
set broken_ports {}
set broken_files [lsort -unique $broken_files]
foreach file $broken_files {
@@ -4716,7 +4792,9 @@
if {$fancy_output} {
ui_error "Please run port -d -y rev-upgrade and use the output to report a bug."
}
- error "Port $portname still broken after rebuilding [expr {$broken_port_counts($portname) - 1}] time(s)"
+ set rebuild_tries [expr {$broken_port_counts($portname) - 1}]
+ set s [expr {$rebuild_tries == 1 ? "" : "s"}]
+ error "Port $portname still broken after rebuilding $rebuild_tries time${s}"
} elseif {$broken_port_counts($portname) > 1 && [global_option_isset ports_binary_only]} {
error "Port $portname still broken after reinstalling -- can't rebuild due to binary-only mode"
}
@@ -4724,8 +4802,11 @@
}
unset temp_broken_ports
+ set num_broken_ports [llength $broken_ports]
+ set s [expr {$num_broken_ports == 1 ? "" : "s"}]
+
if {$macports::revupgrade_mode ne {rebuild}} {
- ui_msg "$macports::ui_prefix Found [llength $broken_ports] broken port(s):"
+ ui_msg "$macports::ui_prefix Found $num_broken_ports broken port${s}:"
foreach port $broken_ports {
ui_msg " [$port name] @[$port version] [$port variants][$port negated_variants]"
foreach f $broken_files_by_port($port) {
@@ -4735,7 +4816,7 @@
return 0
}
- ui_msg "$macports::ui_prefix Found [llength $broken_ports] broken port(s), determining rebuild order"
+ ui_msg "$macports::ui_prefix Found $num_broken_ports broken port${s}, determining rebuild order"
# broken_ports are the nodes in our graph
# now we need adjacents
foreach port $broken_ports {
Copied: branches/gsoc14-interactive/base/src/macports1.0/reclaim.tcl (from rev 124235, trunk/base/src/macports1.0/reclaim.tcl)
===================================================================
--- branches/gsoc14-interactive/base/src/macports1.0/reclaim.tcl (rev 0)
+++ branches/gsoc14-interactive/base/src/macports1.0/reclaim.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,387 @@
+# -*- 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
+# reclaim.tcl
+# $Id: macports.tcl 119177 2014-04-18 22:35:29Z cal at macports.org $
+#
+# Copyright (c) 2002 - 2003 Apple Inc.
+# Copyright (c) 2004 - 2005 Paul Guyot, <pguyot at kallisys.net>.
+# Copyright (c) 2004 - 2006 Ole Guldberg Jensen <olegb at opendarwin.org>.
+# Copyright (c) 2004 - 2005 Robert Shaw <rshaw at opendarwin.org>
+# Copyright (c) 2004 - 2014 The MacPorts Project
+# 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.
+
+# TODO:
+
+# Finished:
+# Add ui_debug statments
+# Catch some error-prone areas.
+# Remove the useless/structure comments and add actual docstrings.
+# Add copyright notice
+# Check if inactive files are dependents for other files.
+# Add test cases
+# Add distfile version checking.
+# Pretty sure we should be using ui_msg, instead of puts and what not. Should probably add that.
+# 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 registry_uninstall 2.0
+package require macports
+
+namespace eval reclaim {
+
+ proc main {args} {
+
+ # The main function. Calls each individual function that needs to be run.
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ uninstall_inactive
+ remove_distfiles
+ update_last_run
+ }
+
+ proc is_empty_dir {dir} {
+
+ # Test if the given directory is empty.
+ # Args:
+ # dir - A string path of the given directory to test
+ # Returns:
+ # 0 if the directory is not empty, 1 if it is.
+
+ # Get _all_ files
+ set filenames [glob -nocomplain -tails -directory $dir * .*]
+
+ # Yay complex statements! Use RE, lsearch, and llength to determine if the directory is empty.
+ expr {![llength [lsearch -all -not -regexp $filenames {^\.\.?$}]]}
+ }
+
+ proc walk_files {dir delete dist_paths} {
+
+ # Recursively walk through each directory that isn't an installed port and if delete each file that isn't a directory if requested.
+ # 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'.
+ # dist_paths - A list of the full paths for all distfiles from installed ports
+ # Returns:
+ # 'no' if no distfiles were found, and 'yes' if distfiles were found.
+
+ set found_distfile no
+ set root_dist [file join ${macports::portdbpath} distfiles]
+ set home_dist ${macports::user_home}/.macports/$root_dist
+
+
+ # If the directory is empty, and this isn't the root folder, delete it and recursively go up directories until a non-empty one is found.
+ if { $dir ne $root_dist && $dir ne $home_dist && [readdir $dir] eq ""} {
+
+ set up_dir [file dirname $dir]
+
+ ui_msg "Found empty directory: $dir. Attempting to delete."
+
+ if {[catch {file delete -force $dir} error] } {
+ ui_error "something went wrong when trying to delete $dir"
+ }
+
+ walk_files $up_dir $delete $dist_paths
+ return
+ }
+
+ foreach item [readdir $dir] {
+
+ set currentPath [file join $dir $item]
+
+ if {[file isdirectory $currentPath]} {
+
+ walk_files $currentPath $delete $dist_paths
+
+ } else {
+
+ # If the current file isn't in the known-installed-distfiles
+ if {[lsearch $dist_paths $currentPath] == -1} {
+ set found_distfile yes
+
+ ui_msg "Found distfile: $item"
+
+ if {$delete eq "yes"} {
+
+ ui_debug "Deleting file: $item"
+ ui_msg "Removing distfile: $item"
+
+ if {[catch {file delete $currentPath} error]} {
+ ui_error "something went wrong when trying to delete $currentPath"
+ }
+
+ # If the directory is now empty, recursively call on this directory, to delete it.
+ if {[is_empty_dir $dir]} {
+
+ ui_debug "Current directory is empty. Walking to $dir"
+ walk_files $dir $delete $dist_paths
+ }
+ }
+ }
+ }
+ }
+
+ return $found_distfile
+ }
+
+ proc remove_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_dist [file join ${macports::portdbpath} distfiles]
+ set home_dist ${macports::user_home}/.macports$root_dist
+
+ set port_info [get_info]
+ set dist_path [list]
+
+ foreach port $port_info {
+
+ set name [lindex $port 0]
+ set version [lindex $port 1]
+ set revision [lindex $port 2]
+ set variants [lindex $port 3]
+
+ # Get mport reference
+ if {[catch {set mport [mportopen_installed $name $version $revision $variants {}]} error]} {
+ ui_error "something went wrong when trying to get an mport reference."
+ }
+
+ # Setup sub-Tcl-interpreter that executed the installed port
+ set workername [ditem_key $mport workername]
+
+ # Append that port's distfiles to the list
+ set subdir [$workername eval return \$dist_subdir]
+ set name [$workername eval return \$distfiles]
+
+ set root_path [file join $root_dist $subdir $name]
+ set home_path [file join $home_dist $subdir $name]
+
+ # Add the full file path to the list, depending where it's located.
+ if {[file isfile $root_path]} {
+ ui_debug "Appending $root_path."
+ lappend dist_path $root_path
+
+ } else {
+ if {[file isfile $home_path]} {
+ ui_debug "Appending $home_path"
+ lappend dist_path $home_path
+ }
+ }
+ }
+
+ ui_debug "Calling walk_files on root directory."
+
+ # Walk through each directory, and delete any files found. Alert the user if no files were found.
+ if {[walk_files $root_dist yes $dist_path] eq "no"} {
+ ui_msg "No distfiles found in root directory."
+ }
+
+ if {[file exists $home_dist]} {
+
+ ui_debug "Calling walk_files on home directory."
+
+ if {[walk_files $home_dist yes $dist_path] eq "no"} {
+ ui_msg "No distfiles found in home directory."
+ }
+ }
+
+ return 0
+ }
+
+ proc close_file {file} {
+
+ # Closes the file, handling error catching if needed.
+ #
+ # Args:
+ # file - The file handler
+ # Returns:
+ # None
+ if {[catch {close $file} error]} {
+ ui_error "something went wrong when closing file, $file."
+ }
+ }
+
+ 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} {
+ ui_debug "App, [lindex $app 0], is inactive."
+ return 1
+ }
+ ui_debug "App, [lindex $app 0], is not inactive."
+ return 0
+ }
+
+ proc get_info {} {
+
+ # Get's the information of all installed appliations (those returned by registry::installed), 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 = variants, 4 = activity, and 5 = epoch.
+
+ if {[catch {set installed [registry::installed]} result]} {
+ ui_error "no installed applications found."
+ return {}
+ }
+
+ return $installed
+ }
+
+ proc update_last_run {} {
+
+ # Updates the last_reclaim textfile with the newest time the code has been ran.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ ui_debug "Updating last run information."
+
+ set path [file join ${macports::portdbpath} last_reclaim.txt]
+ set fd [open $path w]
+ puts $fd [clock seconds]
+ close_file $fd
+ }
+
+ proc check_last_run {} {
+
+ # Periodically warn's the user that they haven't run 'port reclaim' in two weeks, and that they should consider doing so.
+ #
+ # Args:
+ # None
+ # Returns:
+ # None
+
+ ui_debug "Checking last run information."
+
+ set path [file join ${macports::portdbpath} last_reclaim.txt]
+
+ if {[file exists $path]} {
+
+ set fd [open $path r]
+ set time [gets $fd]
+ close_file $fd
+
+ if {$time ne ""} {
+ if {[clock seconds] - $time > 1209600} {
+ ui_warn "you haven't run 'port reclaim' in two weeks. It's recommended you run this once every two weeks to help save space on your computer."
+ }
+ }
+ }
+ }
+
+ proc uninstall_inactive {} {
+
+ # Attempts to uninstall all inactive applications. (Performance is now O(N)!)
+ #
+ # Args:
+ # None
+ # Returns:
+ # 0 if execution was successful. Errors (for now) if execution wasn't.
+
+ set apps [get_info]
+ set inactive_apps [list]
+ set inactive_names [list]
+ set inactive_count 0
+
+ ui_debug "Iterating through all inactive apps."
+
+ foreach app $apps {
+
+ if { [is_inactive $app] } {
+ lappend inactive_apps $app
+ lappend inactive_names [lindex $app 0]
+ incr inactive_count
+ }
+ }
+
+ if { $inactive_count == 0 } {
+ ui_msg "Found no inactive ports."
+
+ } else {
+
+ ui_msg "Found inactive ports: $inactive_names."
+ ui_msg "Would you like to uninstall these apps? \[Y/N\]: "
+
+ set input [gets stdin]
+ if {$input eq "Y" || $input eq "y" } {
+
+ ui_debug "Iterating through all inactive apps... again."
+
+ foreach app $inactive_apps {
+ set name [lindex $app 0]
+
+ # Get all dependents for the current application
+ if {[catch {set dependents [registry::list_dependents $name [lindex 1] [lindex 2] [lindex 3]]} error]} {
+ ui_error "something went wrong when trying to enumerate all dependents for $name"
+ }
+ if {dependents ne ""} {
+ ui_warn "the following application ($name) is a dependent for $dependents. Are you positive you'd like to uninstall this
+ (this could break other applications)? \[Y/N\]"
+
+ set input [gets stdin]
+ if { $input eq "N" || "n" } {
+ ui_msg "Skipping application."
+ continue
+ }
+ }
+ ui_msg "Uninstalling: $name"
+
+ # Note: 'uninstall' takes a name, version, revision, variants and an options list.
+ if {[catch {registry_uninstall::uninstall $name [lindex $app 1] [lindex $app 2] [lindex $app 3] {}} error]} {
+ ui_error "something went wrong when uninstalling $name"
+ }
+ }
+ } else {
+ ui_msg "Not uninstalling applications."
+ }
+ }
+ return 0
+ }
+}
Copied: branches/gsoc14-interactive/base/src/macports1.0/tests/reclaim.test (from rev 124235, trunk/base/src/macports1.0/tests/reclaim.test)
===================================================================
--- branches/gsoc14-interactive/base/src/macports1.0/tests/reclaim.test (rev 0)
+++ branches/gsoc14-interactive/base/src/macports1.0/tests/reclaim.test 2014-08-21 17:47:06 UTC (rev 124236)
@@ -0,0 +1,163 @@
+# -*- 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
+
+package require tcltest 2
+package require reclaim 1.0
+namespace import tcltest::*
+
+set pwd [file dirname [file normalize $argv0]]
+
+source ../macports_test_autoconf.tcl
+package require macports 1.0
+
+array set ui_options {}
+mportinit ui_options
+
+test is_empty_dir {
+
+ # Regression test for is_empty_dir.
+ #
+ # Constraints:
+ # None.
+
+ walk_files
+ Test for correctly identifying an empty directory.
+
+} -body {
+
+ set empty "emptyDir"
+ file mkdir $empty
+
+ if {[reclaim::is_empty_dir $empty] == 0} {
+ return "FAIL: Did not detect empty directory."
+ }
+
+ return "Successfully detected empty directory."
+
+} -cleanup {
+ file delete -force $empty
+
+} -result "Successfully detected empty directory."
+
+test remove_distfiles {
+
+ # Regression test for remove_distfiles.
+ #
+ # Constraints:
+ # None.
+
+ Test for distfiles being successfully removed.
+
+} -body {
+
+ set path [file join ${macports::portdbpath} distfiles]
+ set file [file join $path "test.txt"]
+
+ set fd [open $file w]
+ close $fd
+
+ reclaim::remove_distfiles
+
+ if {[file exists $file]} {
+ return "FAIL: Did not remove distfile."
+ }
+
+ return "Successfully removed distfile."
+
+} -cleanup {
+ file delete -force $file
+
+} -result "Successfully removed distfile."
+
+test update_last_run {
+
+ # Regression test for update_last_run.
+ #
+ # Constraints:
+ # Require's root to run.
+
+ Tests for last_reclaim.txt being updated.
+
+} -constraints {
+ root
+
+} -body {
+
+ set path [file join ${macports::portdbpath} last_reclaim.txt]
+
+ set fd [open $path w]
+ close $fd
+
+ set fd [open $path r]
+ set old_time [gets $fd]
+ close $fd
+
+ reclaim::update_last_run
+
+ set fd [open $path r]
+ set new_time [gets $fd]
+ close $fd
+
+ if {$new_time == $old_time} {
+ return "FAIL: Did not update to the current time."
+ }
+
+ return "Successfully updated to the correct time."
+
+} -cleanup {
+ set fd [open $path w]
+ puts $fd $old_time
+ close $fd
+
+} -result "Successfully updated to the correct time."
+
+
+test walk_files {
+
+ # Regression test for walk_files.
+ #
+ # Constraints:
+ # Require's root to run.
+
+ Tests if walking through the files, and deleting distfiles, ignoring normal files, and removing directory trees works.
+
+} -constraints {
+ root
+
+} -body {
+
+ set path [file join ${macports::portdbpath} distfiles]
+ set dir [file join $path tmp_dir]
+ set subdir [file join $dir other_tmp_dir]
+ set bad_dist [file join $subdir bad_distfile.txt]
+ set bad_dist2 [file join $dir bad_distfile2.txt]
+ set good_dist [file join $dir good_distfile.txt]
+ set dist_list [list]
+
+ lappend dist_list $good_dist
+
+ file mkdir $subdir
+
+ set $fd [open $bad_dist w]
+ close $fd
+
+ set $fd [open $bad_dist2 w]
+ close $fd
+
+ set $fd [open $good_dist w]
+ close $fd
+
+ reclaim::walk_files $dir yes $dist_list
+
+ if {[file exists $bad_dist] || [file exists $bad_dist2] || [file exists $subdir] || ![file exists $good_dist] || ![file exists $dir]} {
+ return "FAIL: Did not delete the correct files, or deleted files that should not have been deleted."
+ }
+
+ return "Successfully deleted all files that needed to be deleted."
+
+} -cleanup {
+ file delete -force $dir
+
+} -result "Successfully deleted all files that needed to be deleted."
+
+cleanupTests
+
Modified: branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in
===================================================================
--- branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in 2014-08-21 17:47:06 UTC (rev 124236)
@@ -13,6 +13,9 @@
OBJS+=strlcat.o
endif
+# tracelib.o has an additional dependency
+tracelib.o: ../darwintracelib1.0/sandbox_actions.h
+
SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/pextlib1.0
Property changes on: branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base/src/pextlib1.0/Makefile:37343-46937
/branches/gsoc08-privileges/base/src/pextlib1.0/Makefile.in:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/Makefile:51231-60371
/branches/gsoc09-logging/base/src/pextlib1.0/Makefile.in:51231-60371
/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile:78828-88375
/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile.in:78828-88375
/branches/gsoc13-tests/src/pextlib1.0/Makefile.in:106692-111324
/branches/universal-sanity/base/src/pextlib1.0/Makefile:51872-52323
/branches/universal-sanity/base/src/pextlib1.0/Makefile.in:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/Makefile:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/branches/variant-descs-14482/base/src/pextlib1.0/Makefile.in:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/Makefile.in:49341-104698,119514-123795
/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile:45682-46060
/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile.in:45682-46060
/users/perry/base-select/src/pextlib1.0/Makefile:44044-44692
/users/perry/base-select/src/pextlib1.0/Makefile.in:44044-44692
+ /branches/gsoc08-privileges/base/src/pextlib1.0/Makefile:37343-46937
/branches/gsoc08-privileges/base/src/pextlib1.0/Makefile.in:37343-46937
/branches/gsoc09-logging/base/src/pextlib1.0/Makefile:51231-60371
/branches/gsoc09-logging/base/src/pextlib1.0/Makefile.in:51231-60371
/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile:78828-88375
/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile.in:78828-88375
/branches/gsoc13-tests/src/pextlib1.0/Makefile.in:106692-111324
/branches/universal-sanity/base/src/pextlib1.0/Makefile:51872-52323
/branches/universal-sanity/base/src/pextlib1.0/Makefile.in:51872-52323
/branches/variant-descs-14482/base/src/pextlib1.0/Makefile:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/branches/variant-descs-14482/base/src/pextlib1.0/Makefile.in:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/pextlib1.0/Makefile.in:49341-104698,119514-124235
/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile:45682-46060
/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile.in:45682-46060
/users/perry/base-select/src/pextlib1.0/Makefile:44044-44692
/users/perry/base-select/src/pextlib1.0/Makefile.in:44044-44692
Modified: branches/gsoc14-interactive/base/src/pextlib1.0/tracelib.c
===================================================================
--- branches/gsoc14-interactive/base/src/pextlib1.0/tracelib.c 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/pextlib1.0/tracelib.c 2014-08-21 17:47:06 UTC (rev 124236)
@@ -59,6 +59,7 @@
#include <cregistry/portgroup.h>
#include <cregistry/entry.h>
#include <registry2.0/registry.h>
+#include <darwintracelib1.0/sandbox_actions.h>
#include "tracelib.h"
@@ -84,7 +85,7 @@
static char *name;
static char *sandbox;
-static char *filemap, *filemap_end;
+static size_t sandboxLength;
static char *depends;
static int sock = -1;
static int kq = -1;
@@ -95,11 +96,16 @@
static Tcl_Interp *interp;
static pthread_mutex_t sock_mutex = PTHREAD_MUTEX_INITIALIZER;
static int cleanuping = 0;
-static char *sdk = NULL;
static void send_file_map(int sock);
static void dep_check(int sock, char *path);
-static void sandbox_violation(int sock, const char *path);
+
+typedef enum {
+ SANDBOX_UNKNOWN,
+ SANDBOX_VIOLATION
+} sandbox_violation_t;
+static void sandbox_violation(int sock, const char *path, sandbox_violation_t type);
+
static void ui_warn(const char *format, ...) __printflike(1, 2);
#if 0
static void ui_info(const char *format, ...) __printflike(1, 2);
@@ -179,9 +185,8 @@
* \return a Tcl return code
*/
static int TracelibSetSandboxCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
- int len;
char *src, *dst;
- enum { NORMAL, ESCAPE } state = NORMAL;
+ enum { NORMAL, ACTION, ESCAPE } state = NORMAL;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "number of arguments should be exactly 3");
@@ -189,8 +194,8 @@
}
src = Tcl_GetString(objv[2]);
- len = strlen(src) + 2;
- sandbox = malloc(len);
+ sandboxLength = strlen(src) + 2;
+ sandbox = malloc(sandboxLength);
if (!sandbox) {
Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
return TCL_ERROR;
@@ -213,18 +218,62 @@
/* : was escaped, keep literally */
*dst++ = ':';
state = NORMAL;
+ } else if (state == ACTION) {
+ /* : -> \0, we're done with this entry */
+ *dst++ = '\0';
+ state = NORMAL;
} else {
- /* : -> \0, unless it has been escaped */
+ /* unescaped : should never occur in normal state */
+ free(sandbox);
+ Tcl_SetResult(interp, "Unexpected colon before action specification.", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ break;
+ case '=':
+ if (state == ESCAPE) {
+ /* = was escaped, keep literally */
+ *dst++ = '=';
+ state = NORMAL;
+ } else {
+ /* hit =, this is the end of the path, the action follows */
*dst++ = '\0';
+ state = ACTION;
}
break;
+ case '+':
+ case '-':
+ case '?':
+ if (state == ACTION) {
+ /* control character after equals, convert to binary */
+ switch (*src) {
+ case '+':
+ *dst++ = FILEMAP_ALLOW;
+ break;
+ case '-':
+ *dst++ = FILEMAP_DENY;
+ break;
+ case '?':
+ *dst++ = FILEMAP_ASK;
+ break;
+ }
+ } else {
+ /* before equals sign, copy literally */
+ *dst++ = *src;
+ }
+ break;
default:
if (state == ESCAPE) {
/* unknown escape sequence, free buffer and raise an error */
free(sandbox);
- Tcl_SetResult(interp, "unknown escape sequence", TCL_STATIC);
+ Tcl_SetResult(interp, "Unknown escape sequence.", TCL_STATIC);
return TCL_ERROR;
}
+ if (state == ACTION) {
+ /* unknown control character, free buffer and raise an error */
+ free(sandbox);
+ Tcl_SetResult(interp, "Unknown control character. Possible values are +, -, and ?.", TCL_STATIC);
+ return TCL_ERROR;
+ }
/* otherwise: copy the char */
*dst++ = *src;
break;
@@ -291,8 +340,10 @@
if (strcmp(buf, "filemap") == 0) {
send_file_map(sock);
+ } else if (strcmp(buf, "sandbox_unknown") == 0) {
+ sandbox_violation(sock, f, SANDBOX_UNKNOWN);
} else if (strcmp(buf, "sandbox_violation") == 0) {
- sandbox_violation(sock, f);
+ sandbox_violation(sock, f, SANDBOX_VIOLATION);
} else if (strcmp(buf, "dep_check") == 0) {
dep_check(sock, f);
} else {
@@ -310,68 +361,12 @@
* \param[in] sock the socket to send the sandbox bounds to
*/
static void send_file_map(int sock) {
- if (!filemap) {
- char *t, * _;
-
- size_t remaining = BUFSIZE;
- filemap = (char *)malloc(remaining);
- if (!filemap) {
- ui_warn("send_file_map: memory allocation failed");
- return;
- }
- t = filemap;
-
-# define append_allow(path, resolution) do { strlcpy(t, path, remaining); \
- if (remaining < (strlen(t)+3)) { \
- remaining=0; \
- fprintf(stderr, "tracelib: insufficient filemap memory\n"); \
- } else { \
- remaining-=strlen(t)+3; \
- } \
- t+=strlen(t)+1; \
- *t++=resolution; \
- *t++=0; \
- } while(0);
-
- if (enable_fence) {
- for (_ = sandbox; *_; _ += strlen(_) + 1) {
- append_allow(_, 0);
- }
-
- append_allow("/bin", 0);
- append_allow("/sbin", 0);
- append_allow("/dev", 0);
- append_allow(Tcl_GetVar(interp, "prefix", TCL_GLOBAL_ONLY), 2);
- /* If there is no SDK we will allow everything in /usr /System/Library etc, else add binaries to allow, and redirect root to SDK. */
- if (sdk && *sdk) {
- char buf[260];
- buf[0] = '\0';
- strlcat(buf, Tcl_GetVar(interp, "developer_dir", TCL_GLOBAL_ONLY), 260);
- strlcat(buf, "/SDKs/", 260);
- strlcat(buf, sdk, 260);
-
- append_allow("/usr/bin", 0);
- append_allow("/usr/sbin", 0);
- append_allow("/usr/libexec/gcc", 0);
- append_allow("/System/Library/Perl", 0);
- append_allow("/", 1);
- strlcpy(t - 1, buf, remaining);
- t += strlen(t) + 1;
- } else {
- append_allow("/usr", 0);
- append_allow("/System/Library", 0);
- append_allow("/Library", 0);
- append_allow(Tcl_GetVar(interp, "developer_dir", TCL_GLOBAL_ONLY), 0);
- }
- } else {
- append_allow("/", 0);
- }
- append_allow("", 0);
- filemap_end = t;
-# undef append_allow
+ if (enable_fence) {
+ answer_s(sock, sandbox, sandboxLength);
+ } else {
+ char allowAllSandbox[5] = {'/', '\0', FILEMAP_ALLOW, '\0', '\0'};
+ answer_s(sock, allowAllSandbox, sizeof(allowAllSandbox));
}
-
- answer_s(sock, filemap, filemap_end - filemap);
}
/**
@@ -381,9 +376,22 @@
* \param[in] sock socket reporting the violation; unused.
* \param[in] path the offending path to be passed to the callback
*/
-static void sandbox_violation(int sock UNUSED, const char *path) {
+static void sandbox_violation(int sock UNUSED, const char *path, sandbox_violation_t type) {
Tcl_SetVar(interp, "path", path, 0);
- Tcl_Eval(interp, "slave_add_sandbox_violation $path");
+ int retVal = TCL_OK;
+ switch (type) {
+ case SANDBOX_VIOLATION:
+ retVal = Tcl_Eval(interp, "slave_add_sandbox_violation $path");
+ break;
+ case SANDBOX_UNKNOWN:
+ retVal = Tcl_Eval(interp, "slave_add_sandbox_unknown $path");
+ break;
+ }
+
+ if (retVal != TCL_OK) {
+ fprintf(stderr, "Error evaluating Tcl statement to add sandbox violation: %s\n", Tcl_GetStringResult(interp));
+ }
+
Tcl_UnsetVar(interp, "path", 0);
}
@@ -781,9 +789,6 @@
unlink(name);
safe_free(name);
}
- if (filemap) {
- safe_free(filemap);
- }
if (depends) {
safe_free(depends);
}
@@ -838,10 +843,6 @@
static int TracelibEnableFence(Tcl_Interp *interp UNUSED) {
enable_fence = 1;
- if (filemap) {
- free(filemap);
- }
- filemap = 0;
return TCL_OK;
}
#endif /* defined(HAVE_TRACEMODE_SUPPORT) */
Modified: branches/gsoc14-interactive/base/src/port/port.tcl
===================================================================
--- branches/gsoc14-interactive/base/src/port/port.tcl 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/port/port.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -2725,7 +2725,23 @@
return $status
}
+proc action_doctor { action portlist opts } {
+ if {[prefix_unwritable]} {
+ return 1
+ }
+ macports::doctor_main $opts
+ return 0
+}
+proc action_reclaim { action portlist opts } {
+ if {[prefix_unwritable]} {
+ return 1
+ }
+ macports::reclaim_main
+ return 0
+}
+
+
proc action_upgrade { action portlist opts } {
if {[require_portlist portlist "yes"] || ([prefix_unwritable] && ![macports::global_option_isset ports_dryrun])} {
return 1
@@ -4205,6 +4221,8 @@
\
upgrade [list action_upgrade [ACTION_ARGS_PORTS]] \
rev-upgrade [list action_revupgrade [ACTION_ARGS_NONE]] \
+ reclaim [list action_reclaim [ACTION_ARGS_NONE]] \
+ doctor [list action_doctor [ACTION_ARGS_NONE]] \
\
version [list action_version [ACTION_ARGS_NONE]] \
platform [list action_platform [ACTION_ARGS_NONE]] \
@@ -4260,7 +4278,6 @@
mdmg [list action_target [ACTION_ARGS_PORTS]] \
mpkg [list action_target [ACTION_ARGS_PORTS]] \
pkg [list action_target [ACTION_ARGS_PORTS]] \
- portpkg [list action_target [ACTION_ARGS_PORTS]] \
\
quit [list action_exit [ACTION_ARGS_NONE]] \
exit [list action_exit [ACTION_ARGS_NONE]] \
@@ -4365,6 +4382,7 @@
log {{phase 1} {level 1}}
upgrade {force enforce-variants no-replace no-rev-upgrade}
rev-upgrade {id-loadcmd-check}
+ doctor {quiet}
}
##
Modified: branches/gsoc14-interactive/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc14-interactive/base/src/port1.0/portfetch.tcl 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/port1.0/portfetch.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -428,7 +428,7 @@
git.url git.branch git.sha1 git.cmd
set options "-q"
- if {[string length ${git.branch}] == 0} {
+ if {${git.branch} eq ""} {
# if we're just using HEAD, we can make a shallow repo
set options "$options --depth=1"
}
@@ -438,7 +438,7 @@
return -code error [msgcat::mc "Git clone failed"]
}
- if {[string length ${git.branch}] > 0} {
+ if {${git.branch} ne ""} {
set env "GIT_DIR=${worksrcpath}/.git GIT_WORK_TREE=${worksrcpath}"
set cmdstring "$env ${git.cmd} checkout -q ${git.branch} 2>&1"
ui_debug "Executing $cmdstring"
Modified: branches/gsoc14-interactive/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/gsoc14-interactive/base/src/port1.0/porttrace.tcl 2014-08-21 17:17:31 UTC (rev 124235)
+++ branches/gsoc14-interactive/base/src/port1.0/porttrace.tcl 2014-08-21 17:47:06 UTC (rev 124236)
@@ -37,329 +37,455 @@
package require portutil 1.0
namespace eval porttrace {
-}
+ ##
+ # The fifo currently used as server socket to establish communication
+ # between traced processes and the server-side of trace mode.
+ variable fifo
-proc porttrace::trace_start {workpath} {
- global os.platform developer_dir macportsuser
- if {${os.platform} == "darwin"} {
- if {[catch {package require Thread} error]} {
- ui_warn "trace requires Tcl Thread package ($error)"
- } else {
- global env trace_fifo trace_sandboxbounds portpath distpath altprefix
- # Create a fifo.
- # path in unix socket limited to 109 chars
- # # set trace_fifo "$workpath/trace_fifo"
- set trace_fifo "/tmp/macports_trace_[pid]-[expr {int(rand()*1000)}]"
- file delete -force $trace_fifo
+ ##
+ # The Tcl thread that runs the server side of trace mode and deals with
+ # requests from traced processes.
+ variable thread
- # Create the thread/process.
- create_slave $workpath $trace_fifo
+ ##
+ # A list of files to which access was denied by trace mode.
+ variable sandbox_violation_list [list]
- # Launch darwintrace.dylib.
+ ##
+ # A list of files inside the MacPorts prefix but unknown to MacPorts that
+ # were used by the current trace session.
+ variable sandbox_unknown_list [list]
- set tracelib_path [file join ${portutil::autoconf::tcl_package_path} darwintrace1.0 darwintrace.dylib]
+ proc appendEntry {sandbox path action} {
+ upvar 2 $sandbox sndbxlst
- if {[info exists env(DYLD_INSERT_LIBRARIES)] && [string length "$env(DYLD_INSERT_LIBRARIES)"] > 0} {
- set env(DYLD_INSERT_LIBRARIES) "${env(DYLD_INSERT_LIBRARIES)}:${tracelib_path}"
- } else {
- set env(DYLD_INSERT_LIBRARIES) ${tracelib_path}
- }
- set env(DARWINTRACE_LOG) "$trace_fifo"
- # The sandbox is limited to:
- # workpath
- # /tmp
- # /private/tmp
- # /var/tmp
- # /private/var/tmp
- # $TMPDIR
- # /dev/null
- # /dev/tty
- # /Library/Caches/com.apple.Xcode
- # $CCACHE_DIR
- # $HOMEDIR/.ccache
- set trace_sandbox [list \
- $workpath \
- $portpath \
- $distpath \
- /tmp \
- /private/tmp \
- /var/tmp \
- /private/var/tmp \
- /var/folders \
- /private/var/folders \
- /var/empty \
- /private/var/empty \
- /var/run \
- /private/var/run \
- /var/db/xcode_select_link \
- /private/var/db/xcode_select_link \
- /var/db/mds \
- /private/var/db/mds \
- /var/db/launchd.db \
- /private/var/db/launchd.db \
- [file normalize ~${macportsuser}/Library/Preferences/com.apple.dt.Xcode.plist] \
- "$env(HOME)/Library/Preferences/com.apple.dt.Xcode.plist" \
- /Library/Caches/com.apple.Xcode \
- /Library/LaunchDaemons \
- /Library/LaunchAgents \
- /dev \
- /etc/passwd \
- /etc/groups \
- /etc/localtime \
- [file normalize ${developer_dir}/../..] \
- "$env(HOME)/.ccache"]
- if {[info exists env(TMPDIR)]} {
- lappend trace_sandbox $env(TMPDIR)
- }
- if {[info exists env(CCACHE_DIR)]} {
- lappend trace_sandbox $env(CCACHE_DIR)
- }
+ set mapping {}
+ # Escape backslashes with backslashes
+ lappend mapping "\\" "\\\\"
+ # Escape colons with \:
+ lappend mapping ":" "\\:"
+ # Escape equal signs with \=
+ lappend mapping "=" "\\="
- ui_debug "Tracelib Sandbox is:"
- foreach sandbox $trace_sandbox {
- ui_debug "\t$sandbox"
- }
- set trace_sandboxbounds [join $trace_sandbox :]
- tracelib setsandbox $trace_sandboxbounds
+ set normalizedPath [file normalize $path]
+ lappend sndbxlst "[string map $mapping $path]=$action"
+ if {$normalizedPath ne $path} {
+ lappend sndbxlst "[string map $mapping $normalizedPath]=$action"
}
}
-}
-# Enable the fence.
-# Only done for targets that should only happen in the sandbox.
-proc porttrace::trace_enable_fence {} {
- tracelib enablefence
-}
+ ##
+ # Append a trace sandbox entry suitable for allowing access to
+ # a directory to a given sandbox list.
+ #
+ # @param sandbox The name of the sandbox list variable
+ # @param path The path that should be permitted
+ proc allow {sandbox path} {
+ appendEntry $sandbox $path "+"
+ }
-# Check the list of ports.
-# Output a warning for every port the trace revealed a dependency on
-# that isn't included in portslist
-# This method must be called after trace_start
-proc porttrace::trace_check_deps {target portslist} {
- # Get the list of ports.
- set ports [slave_send porttrace::slave_get_ports]
+ ##
+ # Append a trace sandbox entry suitable for denying access to a directory
+ # (and stopping processing of the sandbox) to a given sandbox list.
+ #
+ # @param sandbox The name of the sandbox list variable
+ # @param path The path that should be denied
+ proc deny {sandbox path} {
+ appendEntry $sandbox $path "-"
+ }
- # Compare with portslist
- set portslist [lsort $portslist]
- foreach port $ports {
- if {[lsearch -sorted -exact $portslist $port] == -1} {
- ui_warn "Target $target has an undeclared dependency on $port"
- }
+ ##
+ # Append a trace sandbox entry suitable for deferring the access decision
+ # back to MacPorts to query for dependencies to a given sandbox list.
+ #
+ # @param sandbox The name of the sandbox list variable
+ # @param path The path that should be handed back to MacPorts for further
+ # processing.
+ proc ask {sandbox path} {
+ appendEntry $sandbox $path "?"
}
- foreach port $portslist {
- if {[lsearch -sorted -exact $ports $port] == -1} {
- ui_debug "Target $target has no traceable dependency on $port"
- }
- }
-}
-# Check that no violation happened.
-# Output a warning for every sandbox violation the trace revealed.
-# This method must be called after trace_start
-proc porttrace::trace_check_violations {} {
- # Get the list of violations.
- set violations [slave_send porttrace::slave_get_sandbox_violations]
+ ##
+ # Start a trace mode session with the given $workpath. Creates a thread to
+ # handle requests from traced processes and sets up the sandbox bounds. You
+ # must call trace_stop once for each call to trace_start after you're done
+ # tracing processes.
+ #
+ # @param workpath The $workpath of the current installation
+ proc trace_start {workpath} {
+ global \
+ altprefix developer_dir distpath env macportsuser os.platform \
+ portpath prefix
- foreach violation [lsort -unique $violations] {
- ui_warn "An activity was attempted outside sandbox: $violation"
- }
-}
+ variable fifo
-# Stop the trace and return the list of ports the port depends on.
-# This method must be called after trace_start
-proc porttrace::trace_stop {} {
- global os.platform
- if {${os.platform} == "darwin"} {
- global env trace_fifo macosx_version
- foreach var {DYLD_INSERT_LIBRARIES DARWINTRACE_LOG} {
- array unset env $var
- if {$macosx_version eq "10.5"} {
- unsetenv $var
- }
- }
+ if {[catch {package require Thread} error]} {
+ ui_warn "Trace mode requires Tcl Thread package ($error)"
+ return 0
+ }
- #kill socket
- tracelib clean
+ # Select a name for the socket to be used to communicate with the
+ # processes being traced. Note that Unix sockets are limited to 109
+ # characters and that the the macports user must be able to connect to
+ # the socket (and in case of non-root installations, the current user,
+ # too). We're not prefixing the path in /tmp with a separate
+ # macports-specific directory, because the might not be writable by all
+ # users.
+ set fifo "/tmp/macports-trace-[pid]-[expr {int(rand() * 10000)}]"
- # Clean up.
- slave_send porttrace::slave_stop
+ # Make sure the socket doesn't exist yet (this would cause errors
+ # later)
+ file delete -force $fifo
- # Delete the slave.
- delete_slave
+ # Create the server-side of the trace socket; this will handle requests
+ # from the traced processed.
+ create_slave $workpath $fifo
- file delete -force $trace_fifo
+ # Launch darwintrace.dylib.
+ set tracelib [file join ${portutil::autoconf::tcl_package_path} darwintrace1.0 darwintrace.dylib]
+
+ # Add darwintrace.dylib as last entry in DYLD_INSERT_LIBRARIES
+ if {[info exists env(DYLD_INSERT_LIBRARIES)] && [string length $env(DYLD_INSERT_LIBRARIES)] > 0} {
+ set env(DYLD_INSERT_LIBRARIES) "${env(DYLD_INSERT_LIBRARIES)}:${tracelib}"
+ } else {
+ set env(DYLD_INSERT_LIBRARIES) ${tracelib}
+ }
+ # Tell traced processes where to find their communication socket back
+ # to this code.
+ set env(DARWINTRACE_LOG) $fifo
+
+ # The sandbox is limited to:
+ set trace_sandbox [list]
+
+ # Allow work-, port-, and distpath
+ allow trace_sandbox $workpath
+ allow trace_sandbox $portpath
+ allow trace_sandbox $distpath
+
+ # Allow standard system directories
+ allow trace_sandbox "/bin"
+ allow trace_sandbox "/sbin"
+ allow trace_sandbox "/dev"
+ allow trace_sandbox "/usr/bin"
+ allow trace_sandbox "/usr/sbin"
+ allow trace_sandbox "/usr/include"
+ allow trace_sandbox "/usr/lib"
+ allow trace_sandbox "/usr/libexec"
+ allow trace_sandbox "/usr/share"
+ allow trace_sandbox "/System/Library"
+ # Deny /Library/Frameworks, third parties install there
+ deny trace_sandbox "/Library/Frameworks"
+ # But allow the rest of /Library
+ allow trace_sandbox "/Library"
+
+ # Allow a few configuration files
+ allow trace_sandbox "/etc/passwd"
+ allow trace_sandbox "/etc/groups"
+ allow trace_sandbox "/etc/localtime"
+
+ # Allow temporary locations
+ allow trace_sandbox "/tmp"
+ allow trace_sandbox "/var/tmp"
+ allow trace_sandbox "/var/folders"
+ allow trace_sandbox "/var/empty"
+ allow trace_sandbox "/var/run"
+ if {[info exists env(TMPDIR)]} {
+ set tmpdir [string trim $env(TMPDIR)]
+ if {$tmpdir ne ""} {
+ allow trace_sandbox $tmpdir
+ }
+ }
+
+ # Allow access to some Xcode specifics
+ allow trace_sandbox "/var/db/xcode_select_link"
+ allow trace_sandbox "/var/db/mds"
+ allow trace_sandbox [file normalize ~${macportsuser}/Library/Preferences/com.apple.dt.Xcode.plist]
+ allow trace_sandbox "$env(HOME)/Library/Preferences/com.apple.dt.Xcode.plist"
+
+ # Allow access to developer_dir; however, if it ends with /Contents/Developer, strip
+ # that. If it doesn't leave that in place to avoid allowing access to "/"!
+ set ddsplit [file split [file normalize [file join ${developer_dir} ".." ".."]]]
+ if {[llength $ddsplit] > 2 && [lindex $ddsplit end-1] eq "Contents" && [lindex $ddsplit end] eq "Developer"} {
+ set ddsplit [lrange $ddsplit 0 end-2]
+ }
+ allow trace_sandbox [file join {*}$ddsplit]
+
+ # Allow launchd.db access to avoid failing on port-load(1)/port-unload(1)/port-reload(1)
+ allow trace_sandbox "/var/db/launchd.db"
+
+ # Deal with ccache
+ allow trace_sandbox "$env(HOME)/.ccache"
+ if {[info exists env(CCACHE_DIR)]} {
+ set ccachedir [string trim $env(CCACHE_DIR)]
+ if {$ccachedir ne ""} {
+ allow trace_sandbox $ccachedir
+ }
+ }
+
+ # Defer back to MacPorts for dependency checks inside $prefix. This must be at the end,
+ # or it'll be used instead of more specific rules.
+ ask trace_sandbox $prefix
+
+ ui_debug "Tracelib Sandbox is:"
+ foreach trace_entry $trace_sandbox {
+ ui_debug "\t$trace_entry"
+ }
+
+ tracelib setsandbox [join $trace_sandbox :]
}
-}
-# Private
-# Create the slave thread.
-proc porttrace::create_slave {workpath trace_fifo} {
- global trace_thread prefix developer_dir registry.path
- # Create the thread.
- set trace_thread [macports_create_thread]
+ ##
+ # Stop the running trace session and clean up the trace helper thread and
+ # the communication socket. Just must call this once for each call to
+ # trace_start.
+ proc trace_stop {} {
+ global \
+ env \
+ macosx_version
- # The slave thred needs this file and macports 1.0
- thread::send $trace_thread "package require porttrace 1.0"
- thread::send $trace_thread "package require macports 1.0"
- # slave needs ui_{info,warn,debug,error}...
- # make sure to sync this with ../pextlib1.0/tracelib.c!
- thread::send $trace_thread "macports::ui_init debug"
- thread::send $trace_thread "macports::ui_init info"
- thread::send $trace_thread "macports::ui_init warn"
- thread::send $trace_thread "macports::ui_init error"
- # and these variables
- thread::send $trace_thread "set prefix \"$prefix\"; set developer_dir \"$developer_dir\""
- # The slave thread requires the registry package.
- thread::send $trace_thread "package require registry 1.0"
- # and an open registry
- thread::send $trace_thread "registry::open [file join ${registry.path} registry registry.db]"
+ variable fifo
- # Initialize the slave
- thread::send $trace_thread "porttrace::slave_init $trace_fifo $workpath"
+ foreach var {DYLD_INSERT_LIBRARIES DARWINTRACE_LOG} {
+ array unset env $var
+ if {$macosx_version eq "10.5"} {
+ unsetenv $var
+ }
+ }
- # Run slave asynchronously
- thread::send -async $trace_thread "porttrace::slave_run"
-}
+ # Kill socket
+ tracelib clean
+ # Delete the socket file
+ file delete -force $fifo
-# Private
-# Send a command to the thread without waiting for the result.
-proc porttrace::slave_send_async {command} {
- global trace_thread
+ # Delete the slave.
+ delete_slave
+ }
- thread::send -async $trace_thread "$command"
-}
+ ##
+ # Enable the sandbox. This is only called for targets that should be run
+ # inside the sandbox.
+ proc trace_enable_fence {} {
+ tracelib enablefence
+ }
-# Private
-# Send a command to the thread.
-proc porttrace::slave_send {command} {
- global trace_thread
+ ##
+ # Print a list of sandbox violations, separated into a list of files that
+ # actually exist and were hidden, and a list of files that would have been
+ # hidden, if they existed.
+ #
+ # Also print a list of files inside the MacPorts prefix that were not
+ # installed by a port and thus not hidden, but might still cause
+ # non-repeatable builds.
+ #
+ # This method must not be called before trace_start or after trace_stop.
+ proc trace_check_violations {} {
+ # Get the list of violations and print it; separate the list into existing
+ # and non-existent files to cut down the noise.
+ set violations [slave_send porttrace::slave_get_sandbox_violations]
- # ui_warn "slave send $command ?"
+ set existingFiles [list]
+ set missingFiles [list]
+ foreach violation [lsort -unique $violations] {
+ if {![catch {file lstat $violation _}]} {
+ lappend existingFiles $violation
+ } else {
+ lappend missingFiles $violation
+ }
+ }
- thread::send $trace_thread "$command" result
- return $result
-}
+ set existingFilesLen [llength $existingFiles]
+ if {$existingFilesLen > 0} {
+ if {$existingFilesLen > 1} {
+ ui_warn "The following existing files were hidden from the build system by trace mode:"
+ } else {
+ ui_warn "The following existing file was hidden from the build system by trace mode:"
+ }
+ foreach violation $existingFiles {
+ ui_msg " $violation"
+ }
+ }
-# Private
-# Destroy the thread.
-proc porttrace::delete_slave {} {
- global trace_thread
+ set missingFilesLen [llength $missingFiles]
+ if {$missingFilesLen > 0} {
+ if {$missingFilesLen > 1} {
+ ui_info "The following files would have been hidden from the build system by trace mode if they existed:"
+ } else {
+ ui_info "The following file would have been hidden from the build system by trace mode if it existed:"
+ }
+ foreach violation $missingFiles {
+ ui_info " $violation"
+ }
+ }
- # Destroy the thread.
- thread::release $trace_thread
-}
+ set unknowns [slave_send porttrace::slave_get_sandbox_unknowns]
+ set existingUnknowns [list]
+ foreach unknown [lsort -unique $unknowns] {
+ if {![catch {file lstat $unknown _}]} {
+ lappend existingUnknowns $unknown
+ }
+ # We don't care about files that don't exist inside MacPorts' prefix
+ }
-# Private.
-# Slave method to read a line from the trace.
-proc porttrace::slave_read_line {chan} {
- global ports_list trace_filemap sandbox_violation_list workpath env
+ set existingUnknownsLen [llength $existingUnknowns]
+ if {$existingUnknownsLen > 0} {
+ if {$existingUnknownsLen > 1} {
+ ui_warn "The following files inside the MacPorts prefix not installed by a port were accessed:"
+ } else {
+ ui_warn "The following file inside the MacPorts prefix not installed by a port was accessed:"
+ }
+ foreach unknown $existingUnknowns {
+ ui_msg " $unknown"
+ }
+ }
+ }
- while 1 {
- # We should never get EOF, actually.
- if {[eof $chan]} {
- break
- }
+ ##
+ # Create a thread that will contain the server-side of a macports trace
+ # mode setup. This part of the code (most of it actually implemented in
+ # pextlib1.0/tracelib.c) will create a Unix socket that all traced
+ # processes will initially connect to to get the sandbox bounds. It will
+ # also handle requests for dependency checks from traced processes and
+ # provide the appropriate answers to the client and track sandbox
+ # violations.
+ #
+ # You must call delete_slave to clean up the data structures associated
+ # with this slave thread.
+ #
+ # @param workpath The workpath of this installation
+ # @param fifo The Unix socket name to be created
+ proc create_slave {workpath fifo} {
+ global prefix developer_dir registry.path
+ variable thread
- # The line is of the form: verb\tpath
- # Get the path by chopping it.
- set theline [gets $chan]
+ # Create the thread.
+ set thread [macports_create_thread]
- if {[fblocked $chan]} {
- # Exit the loop.
- break
- }
+ # The slave thred needs this file and macports 1.0
+ thread::send $thread "package require porttrace 1.0"
+ thread::send $thread "package require macports 1.0"
- set line_length [string length $theline]
+ # slave needs ui_{info,warn,debug,error}...
+ # make sure to sync this with ../pextlib1.0/tracelib.c!
+ thread::send $thread "macports::ui_init debug"
+ thread::send $thread "macports::ui_init info"
+ thread::send $thread "macports::ui_init warn"
+ thread::send $thread "macports::ui_init error"
- # Skip empty lines.
- if {$line_length > 0} {
- set path_start [expr {[string first "\t" $theline] + 1}]
- set op [string range $theline 0 [expr {$path_start - 2}]]
- set path [string range $theline $path_start [expr {$line_length - 1}]]
+ # and these variables
+ thread::send $thread "set prefix \"$prefix\"; set developer_dir \"$developer_dir\""
+ # The slave thread requires the registry package.
+ thread::send $thread "package require registry 1.0"
+ # and an open registry
+ thread::send $thread "registry::open [file join ${registry.path} registry registry.db]"
- # open/execve
- if {$op eq "open" || $op eq "execve"} {
- # Only work on files.
- if {[file isfile $path]} {
- # Did we process the file yet?
- if {![filemap exists trace_filemap $path]} {
- # Obtain information about this file.
- set port [registry::file_registered $path]
- if { $port != 0 } {
- # Add the port to the list.
- if {[lsearch -sorted -exact $ports_list $port] == -1} {
- lappend ports_list $port
- set ports_list [lsort $ports_list]
- # Maybe fill trace_filemap for efficiency?
- }
- }
+ # Initialize the slave
+ thread::send $thread "porttrace::slave_init $fifo $workpath"
- # Add the file to the tree with port information..
- # Ignore errors. Errors can occur if a directory was
- # created where a file once lived.
- # This doesn't affect existing ports and we just
- # add this information to speed up port detection.
- catch {filemap set trace_filemap $path $port}
- }
- }
- } elseif {$op eq "sandbox_violation"} {
- lappend sandbox_violation_list $path
- }
- }
- }
-}
+ # Run slave asynchronously
+ thread::send -async $thread "porttrace::slave_run"
+ }
-# Private.
-# Slave init method.
-proc porttrace::slave_init {fifo p_workpath} {
- global ports_list trace_filemap sandbox_violation_list
- # Save the workpath.
- set workpath $p_workpath
- # Create a virtual filemap.
- filemap create trace_filemap
- set ports_list {}
- set sandbox_violation_list {}
- tracelib setname $fifo
+ ##
+ # Initialize the slave thread. This is the first user code called in the
+ # thread after creating it and setting it up.
+ #
+ # @param fifo The path of the Unix socket that should be created by
+ # tracelib
+ # @param p_workpath The workpath of the current installation
+ proc slave_init {fifo p_workpath} {
+ variable sandbox_violation_list
+ variable sandbox_unknown_list
- if {[catch {tracelib opensocket} err]} {
- global errorInfo
- ui_warn "Error in tracelib: $err"
- ui_debug "Backtrace: $errorInfo"
- }
-}
+ # Save the workpath.
+ set workpath $p_workpath
-proc porttrace::slave_run {} {
- if {[catch {tracelib run} err]} {
- global errorInfo
- ui_warn "Error in tracelib: $err"
- ui_debug "Backtrace: $errorInfo"
- }
-}
+ # Initialize the sandbox violation lists
+ set sandbox_violation_list {}
+ set sandbox_unknown_list {}
-# Private.
-# Slave cleanup method.
-proc porttrace::slave_stop {} {
- global trace_filemap
- # Close the virtual filemap.
- filemap close trace_filemap
- # Close the pipe (both ends).
-}
+ # Create the socket
+ tracelib setname $fifo
+ tracelib opensocket
+ }
-# Private.
-# Slave ports export method.
-proc porttrace::slave_get_ports {} {
- global ports_list
- return $ports_list
-}
+ ##
+ # Actually start the server component that will deal with requests from
+ # trace mode clients. This will occupy the thread until a different thread
+ # calls tracelib closesocket or tracelib clean.
+ proc slave_run {} {
+ tracelib run
+ }
-# Private.
-# Slave sandbox violations export method.
-proc porttrace::slave_get_sandbox_violations {} {
- global sandbox_violation_list
- return $sandbox_violation_list
-}
+ ##
+ # Destroy the slave thread. You must call this once for each call to
+ # create_slave.
+ proc delete_slave {} {
+ variable thread
-proc porttrace::slave_add_sandbox_violation {path} {
- global sandbox_violation_list
- lappend sandbox_violation_list $path
+ # Destroy the thread.
+ thread::release $thread
+ }
+
+ ##
+ # Send a command to the trace thread created by create_slave, wait for its
+ # completion and return its result. The behavior of this proc is undefined
+ # when called before create_slave or after delete_slave.
+ #
+ # @param command The Tcl command to be executed in the trace thread
+ # @return The return value of the Tcl command, executed in the trace thread
+ proc slave_send {command} {
+ variable thread
+
+ thread::send $thread "$command" result
+ return $result
+ }
+
+ ##
+ # Return a list of sandbox violations stored in the trace server thread.
+ #
+ # @return List of files that the traced processed tried to access but were
+ # outside the sandbox bounds.
+ proc slave_get_sandbox_violations {} {
+ variable sandbox_violation_list
+
+ return $sandbox_violation_list
+ }
+
+ ##
+ # Add a sandbox violation. This is called directly from
+ # pextlib1.0/tracelib.c. You won't find calls to this method in Tcl code.
+ #
+ # @param path The path of the file that a traced process tried to access
+ # but violated the sandbox bounds.
+ proc slave_add_sandbox_violation {path} {
+ variable sandbox_violation_list
+
+ lappend sandbox_violation_list $path
+ }
+
+ ##
+ # Return a list of files accessed inside the MacPorts prefix but not
+ # registered to any port.
+ #
+ # @return List of files that the traced processed tried to access but
+ # couldn't be matched to a port by MacPorts.
+ proc slave_get_sandbox_unknowns {} {
+ variable sandbox_unknown_list
+
+ return $sandbox_unknown_list
+ }
+
+ ##
+ # Track an access to a file within the MacPorts prefix that MacPorts
+ # doesn't know about. This is called directly from pextlib1.0/tracelib.c.
+ # You won't find calls to this method in Tcl code.
+ #
+ # @param path The path of the file that a traced process tried to access
+ # inside the MacPorts prefix, but MacPorts couldn't match to
+ # a port.
+ proc slave_add_sandbox_unknown {path} {
+ variable sandbox_unknown_list
+
+ lappend sandbox_unknown_list $path
+ }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140821/b9f3d97a/attachment-0001.html>
More information about the macports-changes
mailing list