Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug 678475 - Make mozconfig-find always return an absolute path. Patc…

…h adapted from code by Hiroyuki Ikezoe <hiikezoe@mozilla-japan.org>. r=ted

--HG--
branch : COMM70_20110817_RELBRANCH
extra : transplant_source : /%EDwWS%C7%C71%C1%F0%85%23X%D4%AC5%CE%BB%A5c
  • Loading branch information...
commit 203c146cdd7ca1b6d79a7a503d369ed8d45b2236 1 parent 6894d0d
Siddharth Agarwal sid0 authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 build/autoconf/mozconfig-find
23 build/autoconf/mozconfig-find
View
@@ -46,6 +46,27 @@
#
topsrcdir=$1
+abspath() {
+ if uname -s | grep -q MINGW; then
+ # We have no way to figure out whether we're in gmake or pymake right
+ # now. gmake gives us Unix-style paths while pymake gives us Windows-style
+ # paths, so attempt to handle both.
+ regexes='^\([A-Za-z]:\|\\\\\|\/\) ^\/'
+ else
+ regexes='^\/'
+ fi
+
+ for regex in $regexes; do
+ if echo $1 | grep -q $regex; then
+ echo $1
+ exit 0
+ fi
+ done
+
+ # If we're at this point, we have a relative path
+ echo `pwd`/$1
+}
+
for _config in "$MOZCONFIG" \
"$MOZ_MYCONFIG"
do
@@ -66,7 +87,7 @@ for _config in "$MOZCONFIG" \
"$HOME/.mozmyconfig.sh"
do
if test -f "$_config"; then
- echo "$_config";
+ echo `abspath $_config`
exit 0
fi
done
Please sign in to comment.
Something went wrong with that request. Please try again.