[commit: ghc] master: haddock.mk: Use \{1,\} instead of \+ (82cf672)

git at git.haskell.org git at git.haskell.org
Mon Nov 16 21:04:24 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/82cf6724b97ed40d5efedfd28bd3cccf90d1dff2/ghc

>---------------------------------------------------------------

commit 82cf6724b97ed40d5efedfd28bd3cccf90d1dff2
Author: Ben Gamari <ben at well-typed.com>
Date:   Mon Nov 16 16:42:16 2015 +0200

    haddock.mk: Use \{1,\} instead of \+
    
    This works around Mac OS X's sed, which doesn't support \+.
    For the record,
    
        The regex implementation in Mac OS X 10.8 and later is based on a heavily
        modified subset of TRE, http://laurikari.net/tre/


>---------------------------------------------------------------

82cf6724b97ed40d5efedfd28bd3cccf90d1dff2
 rules/haddock.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rules/haddock.mk b/rules/haddock.mk
index 499adad..e716bb8 100644
--- a/rules/haddock.mk
+++ b/rules/haddock.mk
@@ -10,10 +10,10 @@
 #
 # -----------------------------------------------------------------------------
 
-HADDOCK_VER := $(shell grep "^version:" utils/haddock/haddock.cabal | sed "s/^version: \+//")
-HADDOCK_MAJOR_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1/')
-HADDOCK_MINOR_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\2/')
-HADDOCK_PATCH_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\3/')
+HADDOCK_VER := $(shell grep "^version:" utils/haddock/haddock.cabal | sed "s/version: *//")
+HADDOCK_MAJOR_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/\1/')
+HADDOCK_MINOR_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/\2/')
+HADDOCK_PATCH_VER := $(shell echo $(HADDOCK_VER) | sed 's/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/\3/')
 HADDOCK_VERSION_STRING := $(shell echo $$(($(HADDOCK_MAJOR_VER) * 1000 + $(HADDOCK_MINOR_VER) * 10 + $(HADDOCK_PATCH_VER))))
 
 define haddock  # args: $1 = dir,  $2 = distdir



More information about the ghc-commits mailing list