From 1c8c736a69383c6c5d77daad57ac255b8f9c9972 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 21 Apr 2006 15:52:04 +0000 Subject: [PATCH] Adding ability to work from $PATH, and ability to default over to unzip if jar xf doesn't work. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@395920 13f79535-47bb-0310-9956-ffa450edef68 --- maven-meeper/src/bin/deploy-bundle | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/maven-meeper/src/bin/deploy-bundle b/maven-meeper/src/bin/deploy-bundle index b789f559e2..2419256154 100755 --- a/maven-meeper/src/bin/deploy-bundle +++ b/maven-meeper/src/bin/deploy-bundle @@ -7,7 +7,16 @@ VERSION=$3 [ "${BUNDLEURL}" = "" ] && echo && echo "You must specify a bundle URL!" && echo && exit WORKDIR=bundle.tmp -SCRIPTDIR=`dirname $0` + +base=`basename $0` +mylocation=`which $base` + +SCRIPTDIR=`dirname $mylocation` + +[ -d $SCRIPTDIR ] || SCRIPTDIR=. + +echo "Script directory is: ${SCRIPTDIR}" + # repo dir relative to WORKDIR REPODIR=$HOME/repository-staging/to-ibiblio/maven @@ -17,6 +26,7 @@ mkdir $WORKDIR cd $WORKDIR +echo "Retrieving URL: '${BUNDLEURL}'" wget $BUNDLEURL BUNDLE=`echo $BUNDLEURL | sed -e 's#^.*/##;'` @@ -26,25 +36,34 @@ BUNDLE=tmp.jar ( - jar xf $BUNDLE + echo "Unzipping original bundle." + jar xf $BUNDLE || unzip $BUNDLE # copy files in subdirs to workdir + echo "Copying files to working directory." for d in `find ./* -type d` ; do for f in `find $d -type f` ; do cp $f .; done; done + echo "Searching for POM:" + echo "...checking for 'project.xml'" POM=project.xml if [ ! -f ${POM} ] then + echo "...checking for 'pom.xml'" POM=pom.xml fi + if [ ! -f ${POM} ] then + echo "...searching for **/*.pom" POM=`find . -iname *.pom` fi + [ "" == "${POM}" ] && echo && echo "Cannot deploy without the pom.xml or project.xml file!" && echo && exit [ ! -f ${POM} ] && echo && echo "Cannot deploy without the pom.xml or project.xml file!" && echo && exit + echo "POM is: '${POM}'" less $POM $SCRIPTDIR/d2u ${POM}