Ticket #10028: 0002-The-sed-on-Mac-OS-X-does-not-have-the-gnu-compatible.patch

File 0002-The-sed-on-Mac-OS-X-does-not-have-the-gnu-compatible.patch, 992 bytes (added by nielx, 11 years ago)
  • build/jam/FileRules

    From 459e1acbed1083a4076e405d31fd73bc68117a81 Mon Sep 17 00:00:00 2001
    From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
    Date: Sun, 29 Sep 2013 10:22:21 +0200
    Subject: [PATCH 2/4] The sed on Mac OS X does not have the gnu-compatible -r
     flag
    
    Unlike the regular *BSD sed, Mac OS explicitly requires the -E flag
    ---
     build/jam/FileRules | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/build/jam/FileRules b/build/jam/FileRules
    index 6a4b02e..707dba7 100644
    a b rule DownloadFile file : url : source  
    454454
    455455actions ChecksumFileSHA256
    456456{
    457     $(HOST_SHA256) $(2) | sed -r 's,([^[:space:]]*).*,\1,' > $(1)
     457    if [$(HOST_PATFORM) == "darwin"]; then
     458        sed_regexp = "-E"
     459    else
     460        sed_regexp = "-r"
     461    fi
     462    $(HOST_SHA256) $(2) | sed $(sed_regexp) 's,([^[:space:]]*).*,\1,' > $(1) ;
    458463        # The sed part is only necessary for sha256sum, but it doesn't harm for
    459464        # sha256 either.
    460465}