From 5147de169ea3616475f5cf6a48b6741e5279242f Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 9 Oct 2012 16:42:33 -0400 Subject: [PATCH] updated to point at jdk rather than jre level for java. new script that looks for a filename pattern inside a jar/zip/etc. --- customizing/fred/java_profile.sh | 4 ++-- scripts/archival/find_in_arch.sh | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 scripts/archival/find_in_arch.sh diff --git a/customizing/fred/java_profile.sh b/customizing/fred/java_profile.sh index b78309e0..7e0c1721 100644 --- a/customizing/fred/java_profile.sh +++ b/customizing/fred/java_profile.sh @@ -43,11 +43,11 @@ export JAVA_BIN_PIECE=bin if [ ! -d "$JAVA_HOME" ]; then # first try a recent linux version. - export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre + export JAVA_HOME=/usr/lib/jvm/java-6-sun fi if [ ! -d "$JAVA_HOME" ]; then # try an even more recent version. - export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre + export JAVA_HOME=/usr/lib/jvm/java-7-oracle fi if [ ! -d "$JAVA_HOME" ]; then JAVA_HOME="$(ls -d c:/tools/*jdk* 2>/dev/null)" diff --git a/scripts/archival/find_in_arch.sh b/scripts/archival/find_in_arch.sh new file mode 100644 index 00000000..f8c2b63d --- /dev/null +++ b/scripts/archival/find_in_arch.sh @@ -0,0 +1,41 @@ +#!/bin/bash +############## +# Name : find_in_arch +# Author : Chris Koeritz +# Rights : Copyright (C) 2012-$now by Feisty Meow Concerns, Ltd. +############## +# This script is free software; you can modify/redistribute it under the terms +# of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ] +# Feel free to send updates to: [ fred@gruntose.com ] +############## +# +# scours through the archive files (tar, zip, etc) in a directory looking for a pattern +# in the file. any matches are reported. + +dir="$1"; shift +pattern="$1"; shift + +if [ -z "$dir" -o -z "$pattern" ]; then + echo This utility requires a directory to scan for archives, and a pattern to + echo look for within each archive. Any matches are reported. + exit 1 +fi + +TMPFILE="$(mktemp "$TMP/jarfinding.XXXXXX")" + +#hmmm: below would be nicer if we had a util that told us all the types of archives +# that we support. then we could just skim across those types. + +# locate all the archive files under the path. +find "$dir" -iname "*.jar" -o -iname "*.zip" -o -iname "*.tar" \ + -o -iname "*.iar" -o -iname "*.oar" \ + >"$TMPFILE" + +while read line; do + bash $FEISTY_MEOW_SCRIPTS/archival/listarch.sh "$line" 2>&1 | grep -i "$pattern" >/dev/null + if [ $? -eq 0 ]; then echo ==== Found pattern in $line ====; fi +done <"$TMPFILE" + +\rm -f "$TMPFILE" + + -- 2.34.1