Skip to content
Permalink
Browse files

Add a helpful "contents" function for seeing what your port just inst…

…alled.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@1040 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Jordan K. Hubbard
Jordan K. Hubbard committed Oct 12, 2002
1 parent acd5372 commit 3b565e56f571bd966f8247fd145e6f8ad926f838
Showing with 72 additions and 1 deletion.
  1. +1 −1 src/port1.0/Makefile
  2. +1 −0 src/port1.0/port.tcl
  3. +70 −0 src/port1.0/portcontents.tcl
@@ -3,7 +3,7 @@ INSTALLDIR= ${PREFIX}/share/darwinports/Tcl/port1.0
DSTUSR?= root
DSTGRP?= wheel

SRCS= port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl portinstall.tcl portregistry.tcl portdepends.tcl portinstall.tcl portuninstall.tcl portregistry.tcl portdepends.tcl portclean.tcl portpackage.tcl
SRCS= port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl portinstall.tcl portregistry.tcl portdepends.tcl portinstall.tcl portuninstall.tcl portregistry.tcl portdepends.tcl portclean.tcl portpackage.tcl portcontents.tcl

all:

@@ -44,6 +44,7 @@ package require portuninstall 1.0
package require portregistry 1.0
package require portclean 1.0
package require portpackage 1.0
package require portcontents 1.0

# System wide default configuration
if [info exists portdefaultconf] {
@@ -0,0 +1,70 @@
# ex:ts=4
# portuninstall.tcl
#
# Copyright (c) 2002 Apple Computer, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

package provide portcontents 1.0
package require portutil 1.0

set com.apple.contents [target_new com.apple.contents contents_main]
${com.apple.contents} set runtype always
${com.apple.contents} provides contents
${com.apple.contents} requires main

set UI_PREFIX "---> "

proc contents_main {args} {
global portname portversion UI_PREFIX

set rfile [registry_exists $portname $portversion]
if [string length $rfile] {
if [regexp .bz2$ $rfile] {
set fd [open "|bunzip2 -c $rfile" r]
} else {
set fd [open $rfile r]
}
set entry [read $fd]
close $fd

# look for a contents list
set ix [lsearch $entry contents]
if {$ix >= 0} {
set contents [lindex $entry [incr ix]]
set uninst_err 0
ui_msg "Contents of ${portname}-${portversion}:"
foreach f $contents {
ui_msg [lindex $f 0]
}
} else {
return -code error "No contents list for ${portname}-${portversion}"
}
} else {
return -code error "Contents listing failed - no registry entry"
}
}

0 comments on commit 3b565e5

Please sign in to comment.
You can’t perform that action at this time.