diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/abspath | 9 | ||||
-rwxr-xr-x | tools/cpof | 30 | ||||
-rwxr-xr-x | tools/diffPickled | 51 | ||||
-rwxr-xr-x | tools/git-get-rev | 5 | ||||
-rwxr-xr-x | tools/packcp | 5 | ||||
-rwxr-xr-x | tools/pathResolver | 11 | ||||
-rwxr-xr-x | tools/quickcp | 8 | ||||
-rwxr-xr-x | tools/scalawhich | 4 | ||||
-rwxr-xr-x | tools/showPickled | 32 | ||||
-rwxr-xr-x | tools/starrcp | 5 | ||||
-rwxr-xr-x | tools/strapcp | 8 | ||||
-rwxr-xr-x | tools/truncate | 7 |
12 files changed, 175 insertions, 0 deletions
diff --git a/tools/abspath b/tools/abspath new file mode 100755 index 0000000000..a2d1410b9b --- /dev/null +++ b/tools/abspath @@ -0,0 +1,9 @@ +#!/bin/sh +# +# print the absolute path of each argument + +for relpath in $* ; do + D=`dirname "$relpath"` + B=`basename "$relpath"` + echo "`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B" +done
\ No newline at end of file diff --git a/tools/cpof b/tools/cpof new file mode 100755 index 0000000000..ab5a42b4fb --- /dev/null +++ b/tools/cpof @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Creates a classpath out of the contents of each directory +# given as an argument. + +if [ $# == 0 ] ; then + echo "Usage: $0 [dir1 dir2 ...]" + exit 1 +fi + +THISDIR=`dirname $0` +ABSCMD="${THISDIR}/abspath" +CPRES="" + +for dir in $* ; do + absdir=`${ABSCMD} $dir` + LS=`ls -1 ${absdir}` + + for x in $LS ; do + ABS=`${ABSCMD} "${absdir}/${x}"` + CPRES="${CPRES}:${ABS}" + done +done + +# shaving the : off the beginning. Applause to /bin/sh for +# keeping us humble about how far we've come. +LEN=$(( ${#CPRES} - 1 )) +result=${CPRES:1:${LEN}} + +echo $result diff --git a/tools/diffPickled b/tools/diffPickled new file mode 100755 index 0000000000..b4a345dc7d --- /dev/null +++ b/tools/diffPickled @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Shows the difference in pickler output between two variations on a class. +# +# If quick and strap are built normally you can run +# +# diffPickled foo.bar.Baz +# +# to see any differences between them in that class. + +USAGE="Usage: $0 classpath1 classpath2 class" +TOOLSDIR=`dirname $0` +BUILDDIR="${TOOLSDIR}/../build" +QUICKDIR="${BUILDDIR}/quick" +STRAPDIR="${BUILDDIR}/strap" + +CP1="" +CP2="" +CLASS="" + +if [ $# == 1 ] ; then + if [ -e ${QUICKDIR} ] && [ -e ${STRAPDIR} ] ; then + CP1=`${TOOLSDIR}/quickcp` + CP2=`${TOOLSDIR}/strapcp` + CLASS=$1 + else + echo $USAGE + echo "(If only one argument is given, $QUICKDIR and $STRAPDIR must exist.)" + exit 1 + fi +elif [ $# == 3 ] ; then + CP1=$1 + CP2=$2 + CLASS=$3 +else + echo $USAGE + exit 1 +fi + +TMPDIR="/tmp/scala_pickle_diff${RANDOM}" + +if mkdir -m 0700 "$TMPDIR" 2>/dev/null ; then + ${TOOLSDIR}/showPickled -cp $CP1 $CLASS > "${TMPDIR}/out1.txt" + ${TOOLSDIR}/showPickled -cp $CP2 $CLASS > "${TMPDIR}/out2.txt" + diff "${TMPDIR}/out1.txt" "${TMPDIR}/out2.txt" + rm -rf ${TMPDIR} +else + echo "Failed to create temporary directory ${TMPDIR}." + exit 1 +fi + diff --git a/tools/git-get-rev b/tools/git-get-rev new file mode 100755 index 0000000000..9adda35ca7 --- /dev/null +++ b/tools/git-get-rev @@ -0,0 +1,5 @@ +#!/bin/sh +# + +GIT_PAGER=cat +git log -10 | grep git-svn-id | head -1
\ No newline at end of file diff --git a/tools/packcp b/tools/packcp new file mode 100755 index 0000000000..42bce9e266 --- /dev/null +++ b/tools/packcp @@ -0,0 +1,5 @@ +#!/bin/sh +# + +THISDIR=`dirname $0` +${THISDIR}/cpof ${THISDIR}/../build/pack/lib diff --git a/tools/pathResolver b/tools/pathResolver new file mode 100755 index 0000000000..efff45ea62 --- /dev/null +++ b/tools/pathResolver @@ -0,0 +1,11 @@ +#!/bin/sh +# + +WHICH=`which scala` +BASE=`dirname $WHICH` +LIBDIR=$BASE/../lib + +echo Using ${WHICH}. +echo + +java -cp "${LIBDIR}/*" scala.tools.util.PathResolver $* diff --git a/tools/quickcp b/tools/quickcp new file mode 100755 index 0000000000..0bfcad1941 --- /dev/null +++ b/tools/quickcp @@ -0,0 +1,8 @@ +#!/bin/sh +# + +THISDIR=`dirname $0` +cp=`${THISDIR}/cpof ${THISDIR}/../build/quick/classes` +fjbg=`${THISDIR}/abspath ${THISDIR}/../lib/fjbg.jar` + +echo ${cp}:${fjbg} diff --git a/tools/scalawhich b/tools/scalawhich new file mode 100755 index 0000000000..6a4b1788a8 --- /dev/null +++ b/tools/scalawhich @@ -0,0 +1,4 @@ +#!/bin/sh +# + +scala scala.tools.util.Which $* diff --git a/tools/showPickled b/tools/showPickled new file mode 100755 index 0000000000..27421c3ae5 --- /dev/null +++ b/tools/showPickled @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Shows the pickled scala data in a classfile. + +if [ $# == 0 ] ; then + echo "Usage: $0 [--bare] [-cp classpath] <class*>" + exit 1 +fi + +TOOLSDIR=`dirname $0` +CPOF="$TOOLSDIR/cpof" + +PACK="$TOOLSDIR/../build/pack/lib" +QUICK="$TOOLSDIR/../build/quick/classes" +STARR="$TOOLSDIR/../lib" +CP="" + +if [ -f "${PACK}/scala-library.jar" ] ; then + CP=`${TOOLSDIR}/packcp` +elif [ -d "${QUICK}/library" ] ; then + CP=`${TOOLSDIR}/quickcp` +else + CP=`${TOOLSDIR}/starrcp` +fi + +if [ "$1" == "-cp" ] ; then + shift + CP="${1}:${CP}" + shift +fi + +java -cp "$CP" scala.tools.nsc.util.ShowPickled $* diff --git a/tools/starrcp b/tools/starrcp new file mode 100755 index 0000000000..6add5665b5 --- /dev/null +++ b/tools/starrcp @@ -0,0 +1,5 @@ +#!/bin/sh +# + +THISDIR=`dirname $0` +${THISDIR}/cpof ${THISDIR}/../lib
\ No newline at end of file diff --git a/tools/strapcp b/tools/strapcp new file mode 100755 index 0000000000..61e4a61b2c --- /dev/null +++ b/tools/strapcp @@ -0,0 +1,8 @@ +#!/bin/sh +# + +THISDIR=`dirname $0` +cp=`${THISDIR}/cpof ${THISDIR}/../build/strap/classes` +fjbg=`${THISDIR}/abspath ${THISDIR}/../lib/fjbg.jar` + +echo ${cp}:${fjbg} diff --git a/tools/truncate b/tools/truncate new file mode 100755 index 0000000000..b7f410e25d --- /dev/null +++ b/tools/truncate @@ -0,0 +1,7 @@ +#!/bin/bash + +find . -type f -not -path "*.svn*" -name "*.scala" -exec sed -i "" -e 's/$ *Id.*$/$Id$/g' {} \; +find . -type f -not -path "*.svn*" -name "*.java" -exec sed -i "" -e 's/$ *Id.*$/$Id$/g' {} \; +find . -type f -not -path "*.svn*" -name "*.cs" -exec sed -i "" -e 's/$ *Id.*$/$Id$/g' {} \; +find . -type f -not -path "*.svn*" -name "*.js" -exec sed -i "" -e 's/$ *Id.*$/$Id$/g' {} \; +find . -type f -not -path "*.svn*" -name "*.scala.disabled" -exec sed -i "" -e 's/$ *Id.*$/$Id$/g' {} \; |