[Assorted-commits] SF.net SVN: assorted: [808] shell-tools/trunk/src/bash-commons/common.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-05-13 22:46:59
|
Revision: 808 http://assorted.svn.sourceforge.net/assorted/?rev=808&view=rev Author: yangzhang Date: 2008-05-13 15:47:02 -0700 (Tue, 13 May 2008) Log Message: ----------- added some documentation to shell tools; removed indent etc Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2008-05-13 22:43:21 UTC (rev 807) +++ shell-tools/trunk/src/bash-commons/common.bash 2008-05-13 22:47:02 UTC (rev 808) @@ -161,18 +161,6 @@ silence type "$@" } -#indent() { -# let ++indent || true -#} -# -#deindent() { -# let --indent || true -#} -# -#noindent() { -# indent=0 -#} - log() { echo "$@" } @@ -265,8 +253,9 @@ rsync -e ssh -u -a --delete "$@" } +# Find and remove all broken links in the given directory (and subdirs). rm-broken-symlinks() { - find . -type l | + find "$@" -type l | while read file ; do if [ ! -e "$file" ] ; then sudo -u pkg rm "$file" @@ -274,6 +263,7 @@ done } +# XXX figure out wtf this is for. make this more general? populate-prefix-dir() { local target="$1" for j in bin info lib man src usr ; do @@ -294,6 +284,8 @@ # the GNU version: sed ':a; $!N; s/\n/ /; ta' } +# Parses a classpath from an Eclipse .classpath file (first arg) and sets the +# CLASSPATH variable accordingly for the subsequent command. get-classpath() { local classpath_file="$1" shift @@ -301,6 +293,7 @@ join-lines : ):$CLASSPATH" "$@" } +# Find the first available DNS name. XXX make this more general find-first-avail-name() { for i in {a..z}; do for j in {a..z}; do @@ -406,13 +399,12 @@ sort -u } +# bbfix, by Patrick Reynolds (reynolds .at. cs duke edu) +# Too trivial to copyright. It's in the public domain! +# +# Usage: +# ./bbfix foo.eps bbfix() { - # bbfix, by Patrick Reynolds (reynolds .at. cs duke edu) - # Too trivial to copyright. It's in the public domain! - # - # Usage: - # ./bbfix foo.eps - if [ $# = 0 ]; then echo "Usage:" echo " $0 file.eps [file.eps [file.eps [...]]]" @@ -425,6 +417,8 @@ done } +# Install a python package to the specified directory. Takes care of creating +# the dir and setting the PYTHONPATH appropriately for the setup process. pyinstall() { local prefix="$1" pkgdir="$1/lib/python2.5/site-packages" mkdir -p $pkgdir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |