From 4de5345d768d2ad9b54ec6843eaf86125a6db5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Sun, 27 Aug 2006 00:29:52 +0000 Subject: [PATCH] Make the win32 script run even from outside of the its directory. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14735 57a11ea4-9604-0410-9ed3-97b8803252fd --- packaging/win32/README | 2 +- packaging/win32/install.sh | 45 +++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/packaging/win32/README b/packaging/win32/README index 6ac0d69911..49e517ba93 100644 --- a/packaging/win32/README +++ b/packaging/win32/README @@ -23,7 +23,7 @@ to $DOWNLOAD_DIR Start/Enter any MSYS shell. Let the automated build begin by: - $INSTALLER_DIR/installer.sh + $INSTALLER_DIR/install.sh Good luck! diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index b9bf6fa69a..f0710d27e1 100644 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -2,10 +2,21 @@ set -e -function add_step() { - steps=("${steps[@]}" "$@") +function add_step() { steps=("${steps[@]}" "$@"); } +function qpushd() { pushd "$@" >/dev/null; } +function qpopd() { popd >/dev/null; } + +# c:/dir/sub +function win_fs_path() { + echo "$*" | sed 's,\\,/,g' } +# /c/dir/sub +function unix_path() { + echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g' +} + +qpushd "$(dirname $(unix_path "$0"))" . custom.sh SEPS_ACLOCAL_FLAGS=" " @@ -48,9 +59,6 @@ function die() { } function quiet() { "$@" &>/dev/null; } -function qpushd() { pushd "$@" >/dev/null; } -function qpopd() { popd >/dev/null; } - function add_to_env() { _SEP=`eval echo '"$'"SEPS_$2"'"'` _ENV=`eval echo '"$'"$2"'"'` @@ -66,16 +74,6 @@ function add_to_env() { fi } -# c:/dir/sub -function win_fs_path() { - echo "$*" | sed 's,\\,/,g' -} - -# /c/dir/sub -function unix_path() { - echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g' -} - function prepare() { mkdir -p $TMP_DIR for _ENV in $ENV_VARS; do @@ -130,7 +128,7 @@ function inst_dtk() { else set -e smart_wget $DTK_URL $DOWNLOAD_DIR - echo "!!! The path must be: $MSYS_DIR !!!" + echo "!!! When asked for an installation path, specify $MSYS_DIR !!!" $DOWNLOAD_UDIR/msysDTK-*.exe for file in \ /bin/{aclocal*,auto*,ifnames,libtool*,guile*} \ @@ -154,7 +152,7 @@ function inst_mingw() { _MINGW_WFSDIR=`win_fs_path $MINGW_DIR` smart_wget $MINGW_URL $DOWNLOAD_DIR echo "!!! Install g++ !!!" - echo "!!! The path must be: $MINGW_DIR !!!" + echo "!!! When asked for an installation path, specify $MINGW_DIR !!!" $DOWNLOAD_UDIR/MinGW-*.exe (echo "y"; echo "y"; echo "$_MINGW_WFSDIR") | sh pi.sh fi @@ -172,7 +170,7 @@ function inst_unzip() { else set -e smart_wget $UNZIP_URL $DOWNLOAD_DIR - echo "!!! The path must be: $UNZIP_DIR !!!" + echo "!!! When asked for an installation path, specify $UNZIP_DIR !!!" $DOWNLOAD_UDIR/unzip-*.exe fi add_to_env $_UNZIP_UDIR/bin PATH @@ -328,7 +326,7 @@ function inst_glade() { else set -e smart_wget $GLADE_URL $DOWNLOAD_DIR - echo "!!! The path must be: $GLADE_DIR !!!" + echo "!!! When asked for an installation path, specify $GLADE_DIR !!!" $DOWNLOAD_UDIR/gtk-win32-devel-*.exe qpushd $GLADE_DIR\\lib\\pkgconfig cp cairo.pc cairo.pc.bak @@ -579,7 +577,7 @@ function inst_svn() { else set -e smart_wget $SVN_URL $DOWNLOAD_DIR - echo "!!! The path must be: $SVN_DIR !!!" + echo "!!! When asked for an installation path, specify $SVN_DIR !!!" $DOWNLOAD_UDIR/svn-*.exe fi } @@ -642,3 +640,10 @@ for step in "${steps[@]}" ; do eval $step done finish +qpopd + + +### Local Variables: *** +### sh-basic-offset: 4 *** +### tab-width: 8 *** +### End: ***