GNU bug report logs - #15769
building on OpenBSD fails because of a shell pattern problem

Previous Next

Package: emacs;

Reported by: Han Boetes <han <at> boetes.org>

Date: Thu, 31 Oct 2013 16:04:01 UTC

Severity: important

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15769 in the body.
You can then email your comments to 15769 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 16:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Han Boetes <han <at> boetes.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 31 Oct 2013 16:04:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Han Boetes <han <at> boetes.org>
To: bug-gnu-emacs <at> gnu.org
Subject: building on OpenBSD fails because of a shell pattern problem
Date: Thu, 31 Oct 2013 14:41:33 +0100
I really don't know why the old version fails on a directory without any
non ascii chars but this patch fixes it. If this is acceptable for
everyone then please apply this patch.

diff --git a/configure.ac b/configure.ac
index 9263d39..87df628 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,7 +92,7 @@ for var in "`pwd`" "$temp_srcdir" "$prefix" "$exec_prefix" \

   dnl configure sets LC_ALL=C early on, so this range should work.
   case "$var" in
-    *[[^\ -~]]*) AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var]) ;;
+    *[[^\ ~-]]*) AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var]) ;;
   esac

 done






# Han




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 17:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 15769 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Han Boetes <han <at> boetes.org>
Cc: 15769 <at> debbugs.gnu.org
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 13:27:24 -0400
This will become irrelevant if http://debbugs.gnu.org/15260 gets fixed,
but in the meantime, please give details of:

exactly what version of OpenBSD this is
what shell /bin/sh is
and send the config.log as attachment

Han Boetes wrote:

> -    *[[^\ -~]]*) AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var]) ;;
> +    *[[^\ ~-]]*) AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var]) ;;

These are not the same thing.

[^\ -~] is supposed to match any character not in the range " " to "~",
which, under LC_ALL=C, should be the range of ASCII characters, AFAIK. 
Maybe someone knows a better, portable way to test for non-ASCII?
I'd rather not do: [^a-zA-Z0-9...] if at all possible.

Yours, [^\ ~-], should match any character that is not " " , "~", or "-".
I have no idea how this can work for you...

Maybe "^" does not work as negation in your shell?

The autoconf manual does say that [^...] is not portable (apparently we
should use [!...] instead), but [^...] is extensively used elsewhere in
the Emacs build rules, and [!...] not at all.

Does it work for you if you use:

   *[[!\ ~-]]*) AC_MSG_ERROR ...

?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 17:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 15769 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Han Boetes <han <at> boetes.org>
Cc: 15769 <at> debbugs.gnu.org
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 13:30:07 -0400
Glenn Morris wrote:

> Does it work for you if you use:
>
>    *[[!\ ~-]]*) AC_MSG_ERROR ...

Argh, I meant to say

   *[[!\ -~]]*) AC_MSG_ERROR ...

Ie, just swap "^" for "!".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 18:07:01 GMT) Full text and rfc822 format available.

Message #14 received at 15769 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Han Boetes <han <at> boetes.org>
Cc: 15769 <at> debbugs.gnu.org
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 14:06:48 -0400
Or maybe sed will work better than the shell?

*** configure.ac	2013-10-27 18:57:20 +0000
--- configure.ac	2013-10-31 18:02:36 +0000
***************
*** 91,99 ****
      "$datarootdir" "$bindir" "$datadir" "$sharedstatedir" "$libexecdir"; do
  
    dnl configure sets LC_ALL=C early on, so this range should work.
!   case "$var" in
!     *[[^\ -~]]*) AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var]) ;;
!   esac
  
  done
  
--- 91,100 ----
      "$datarootdir" "$bindir" "$datadir" "$sharedstatedir" "$libexecdir"; do
  
    dnl configure sets LC_ALL=C early on, so this range should work.
!   dnl This seems more portable than using a case statement with *[[^\ -~]]*)
!   var=`echo "$var" | sed 's/[[ -~]]//g'`
! 
!   test -n "$var" && AC_MSG_ERROR([Emacs cannot be built or installed in a directory whose name contains non-ASCII characters: $var])
  
  done
  





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 20:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 15769 <at> debbugs.gnu.org (full text, mbox):

From: Han Boetes <han <at> boetes.org>
To: 15769 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 21:51:49 +0100
Hello Glenn,

The /bin/sh implementation of OpenBSD is ksh; 

   http://www.openbsd.org/cgi-bin/man.cgi?query=ksh&sektion=1

This patch does fix the issue. But it does beg the question why this
fails with ksh and not with bash and zsh. I also asked the question on
the OpenBSD mailinglist. It would be nice if we could run this in the
shell of course and not depend on an external application.

http://marc.info/?l=openbsd-bugs&m=138323779500515&w=2

More to follow soon in that thread.


# Han




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 21:12:01 GMT) Full text and rfc822 format available.

Message #20 received at 15769 <at> debbugs.gnu.org (full text, mbox):

From: Han Boetes <han <at> boetes.org>
To: 15769 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 22:11:18 +0100
Glenn Morris wrote:
> Argh, I meant to say
> 
>    *[[!\ -~]]*) AC_MSG_ERROR ...
> 
> Ie, just swap "^" for "!".

I just got a portability hint from Thorsten Glaser:

  "mirabilos| in shell moet je ! ipv ^ gebruiken voor inverted match"

So yes indeed, we have to use ! and not ^ in the shell. :-)



# Han




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 31 Oct 2013 21:43:01 GMT) Full text and rfc822 format available.

Notification sent to Han Boetes <han <at> boetes.org>:
bug acknowledged by developer. (Thu, 31 Oct 2013 21:43:02 GMT) Full text and rfc822 format available.

Message #25 received at 15769-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 15769-done <at> debbugs.gnu.org
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 17:42:29 -0400
Version: 24.4

>> Ie, just swap "^" for "!".

Well, you live and learn. Bash and zsh allow either [^...] or [!...],
but ksh only the latter. I guess every other instance of [^...] in the
Emacs build rules must be in sed rather than the shell.

So I changed ^ for !, but the whole check is likely to get removed soon
anyway.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15769; Package emacs. (Thu, 31 Oct 2013 21:52:02 GMT) Full text and rfc822 format available.

Message #28 received at 15769-done <at> debbugs.gnu.org (full text, mbox):

From: Han Boetes <han <at> boetes.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 15769-done <at> debbugs.gnu.org
Subject: Re: bug#15769: building on OpenBSD fails because of a shell pattern
 problem
Date: Thu, 31 Oct 2013 22:51:44 +0100
Glenn Morris wrote:
> Well, you live and learn. Bash and zsh allow either [^...] or [!...],
> but ksh only the latter. I guess every other instance of [^...] in the
> Emacs build rules must be in sed rather than the shell.
> 
> So I changed ^ for !, but the whole check is likely to get removed soon
> anyway.

Incase you run debian I can recommend installing mksh and use it for
testing.

mksh is a clone of this ksh version. They both try to be as POSIX
compliant as possible. It's great for finding bashisms.



# Han




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Nov 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.