From 0532c9ab4c3686adfaa7eaf8e8ec2217a2cfb59d Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 22 Jul 2006 22:27:48 +0000 Subject: Do a better job of trying to be able to run these scripts from 'anywhere' git-svn-id: https://svn.musicpd.org/mpd/trunk@4430 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- scripts/makedist.sh | 5 +++++ scripts/makerpm.sh | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/makedist.sh b/scripts/makedist.sh index dca64d21..d342cea3 100755 --- a/scripts/makedist.sh +++ b/scripts/makedist.sh @@ -5,6 +5,9 @@ PWD=`pwd` ## assume the base directory. if test "`basename $PWD`" == "scripts"; then cd ../ +else + MYOLDPWD=`pwd` + cd `dirname $0`/../ fi if test -e Makefile @@ -17,4 +20,6 @@ make dist if test "`basename $PWD`" == "scripts"; then cd contrib/ +else + cd $MYOLDPWD fi diff --git a/scripts/makerpm.sh b/scripts/makerpm.sh index 52104c8a..bfa2b47f 100755 --- a/scripts/makerpm.sh +++ b/scripts/makerpm.sh @@ -4,9 +4,9 @@ PWD=`pwd` ## If we're not in the scripts directory ## assume the base directory. -if test "`basename $PWD`" != "scripts" && \ - test -d scripts; then - cd scripts +if test "`basename $PWD`" != "scripts"; then + MYOLDPWD=`pwd` + cd `dirname $0` fi ./makedist.sh @@ -25,5 +25,5 @@ then fi if test "`basename $PWD`" != "scripts"; then - cd .. + cd $MYOLDPWD fi -- cgit v1.2.3