[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ${var:+"quo ted"} and similar, inside unquoted here-docs
From: |
Ralf Wildenhues |
Subject: |
Re: ${var:+"quo ted"} and similar, inside unquoted here-docs |
Date: |
Mon, 30 Aug 2010 21:33:13 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
Hi Eric,
* Eric Blake wrote on Mon, Aug 30, 2010 at 05:09:05PM CEST:
> On 08/29/2010 08:59 AM, Ralf Wildenhues wrote:
> >-AS_BOX([Configuring AC_PACKAGE_TARNAME${TIMESTAMP:+" (Build:$TIMESTAMP)"}
> >AC_PACKAGE_VERSION])
> >+timestamp_string=
> >+if test -n "$TIMESTAMP"; then
> >+ timestamp_string=" (Build:$TIMESTAMP)"
> >+fi
>
> Why not:
>
> timestamp_string="${TIMESTAMP:+ (Build:$TIMESTAMP)}"
>
> instead of the if/fi?
Thanks, I'm committing that in your name.
> Or, since we know the workaround is to remove the "" inside
> here-docs, why not:
>
> AS_BOX([Configuring AC_PACKAGE_TARNAME${TIMESTAMP:+
> (Build:$TIMESTAMP)} AC_PACKAGE_VERSION])
Well, if I don't have to know that I'm in a here-document, then I prefer
not wanting to know; somebody might "fix" the code in the future.
You're right though that it is documented with AS_BOX.
Cheers,
Ralf
2010-08-30 Eric Blake <address@hidden
Simplify recent configure quoting portability workaround.
* configure.ac: Simplify setting of timestamp_string.
diff --git a/configure.ac b/configure.ac
index 87f3ce1..aaa946f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,10 +113,7 @@ case $lt_alpha in
TIMESTAMP=
;;
esac
-timestamp_string=
-if test -n "$TIMESTAMP"; then
- timestamp_string=" (Build:$TIMESTAMP)"
-fi
+timestamp_string="${TIMESTAMP:+ (Build:$TIMESTAMP)}"
AS_BOX([Configuring AC_PACKAGE_TARNAME$timestamp_string AC_PACKAGE_VERSION])
echo
AC_SUBST([TIMESTAMP])