Fix bug in hs-libraries field munging.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Wed, 18 Mar 2015 22:28:29 +0000 (15:28 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 24 Mar 2015 02:09:49 +0000 (19:09 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate with 7.8 stage0 and HEAD stage0

Reviewers: austin, kgardas

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D740

compiler/ghc.mk

index b692891..132a4dd 100644 (file)
@@ -727,11 +727,12 @@ endif
 # Note [munge-stage1-package-config]
 # Strip the date/patchlevel from the version of stage1.  See Note
 # [fiddle-stage1-version] above.
+# NB: The sed expression for hs-libraries is a bit weird to be POSIX-compliant.
 ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
 compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config
        sed -e 's/^\(version: .*\)\.$(ProjectPatchLevel)$$/\1/' \
            -e 's/^\(id: .*\)\.$(ProjectPatchLevel)$$/\1/' \
-           -e 's/^\(hs-libraries: HSghc-.*\)\.$(ProjectPatchLevel)$$/\1/' \
+           -e 's/^\(hs-libraries: HSghc-.*\)\.$(ProjectPatchLevel)\(-[A-Za-z0-9][A-Za-z0-9]*\)*$$/\1\2/' \
          < $< > $@
        "$(compiler_stage1_GHC_PKG)" update --force $(compiler_stage1_GHC_PKG_OPTS) $@