[前][次][番号順一覧][スレッド一覧]

ruby-changes:27237

From: nobu <ko1@a...>
Date: Sun, 17 Feb 2013 16:57:53 +0900 (JST)
Subject: [ruby-changes:27237] nobu:r39289 (trunk): configure.in: unexpand_shvar

nobu	2013-02-17 16:57:43 +0900 (Sun, 17 Feb 2013)

  New Revision: 39289

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39289

  Log:
    configure.in: unexpand_shvar
    
    * configure.in (unexpand_shvar): regularize a shell variable by
      unexpanding shell variables in it.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in

Index: configure.in
===================================================================
--- configure.in	(revision 39288)
+++ configure.in	(revision 39289)
@@ -3229,6 +3229,23 @@ shvar_to_cpp() { https://github.com/ruby/ruby/blob/trunk/configure.in#L3229
     eval $var='"$val"'
 }
 
+unexpand_shvar() {
+    local var=$1 val n v expr quote
+    shift
+    test "$#" == 0 && return
+    quote=['s/${[^${}"]*}/"&"/g']
+    for n do
+        eval v='"$'$n'"'
+	v="`echo \"$v\" | sed -e \"$quote\" -e ['s/[][$|.\\?*]/\\\\&/g']`"
+	if test -n "$v"; then
+	    expr=["${expr};s|"'\("[^$"]*\)'"$v|\\1\${$n}\"|g"]
+	    AS_CASE(["$v"], [*'${'*'}'*], [expr=["$expr;s|$v|\"\${$n}\"|g"]])
+	fi
+    done
+    expr=["${quote}${expr};"'s/"\(\${[^${}"]*}\)"/\1/g']
+    eval $var='"`echo \"\\\"${'$var'}\\\"\" | sed \"$expr;s/\\\"\\\"//g;s/^\\\"//;s/\\\"\\\$//\"`"'
+}
+
 rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
 AC_ARG_WITH(rubylibprefix,
 	    AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
@@ -3313,6 +3330,10 @@ AC_ARG_WITH(vendorarchdir, https://github.com/ruby/ruby/blob/trunk/configure.in#L3330
             [vendorarchdir=$withval],
             [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
 
+unexpand_shvar rubylibprefix       exec_prefix libdir RUBY_BASE_NAME
+unexpand_shvar rubyarchprefix      exec_prefix libdir arch RUBY_BASE_NAME archlibdir rubylibprefix
+unexpand_shvar rubysitearchprefix  exec_prefix libdir sitearch arch RUBY_BASE_NAME archlibdir sitearchlibdir rubylibprefix
+unexpand_shvar exec_prefix         prefix arch RUBY_BASE_NAME
 if test "${LOAD_RELATIVE+set}"; then
     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
     RUBY_EXEC_PREFIX='""'
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39288)
+++ ChangeLog	(revision 39289)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Feb 17 16:57:41 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (unexpand_shvar): regularize a shell variable by
+	  unexpanding shell variables in it.
+
 Sun Feb 17 01:19:00 2013  Zachary Scott  <zachary@z...>
 
 	* ext/psych/lib/psych/y.rb: Document Kernel#y by Adam Stankiewicz

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]