Ticket #4459: 0002-Use-configure-detected-or-user-specified-sed-in-buil.patch

File 0002-Use-configure-detected-or-user-specified-sed-in-buil.patch, 6.9 KB (added by karlson2k, 10 months ago)
  • autogen.sh

    From 3cd09c318abce9c9e6979f1a7ff2e3c0117af258 Mon Sep 17 00:00:00 2001
    From: Evgeny Grin <k2k@narod.ru>
    Date: Fri, 19 May 2023 18:06:02 +0300
    Subject: [PATCH 2/3] Use configure detected or user specified sed in build
     system
    
    Sometimes system default sed is not the best option.
    With this modification user may easily override sed used by build system
    without editing any file.
    
    Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
    ---
     autogen.sh                             | 2 +-
     configure.ac                           | 2 +-
     contrib/Makefile.am                    | 8 ++++----
     doc/man/date-of-man-include.am         | 6 +++---
     m4.include/mc-glib.m4                  | 2 +-
     m4.include/mc-version.m4               | 2 +-
     maint/utils/find-dup-includes/runme.sh | 2 +-
     maint/utils/update-years.sh            | 4 ++--
     po/Rules-pot-defaults                  | 2 +-
     version.sh                             | 2 +-
     10 files changed, 16 insertions(+), 16 deletions(-)
    
    diff --git a/autogen.sh b/autogen.sh
    index ca46179af..ee76efc22 100755
    a b rm -f INSTALL && ln -s doc/INSTALL 
    1313 
    1414# Generate po/POTFILES.in 
    1515${XGETTEXT:-xgettext} --keyword=_ --keyword=N_ --keyword=Q_ --output=- \ 
    16         `find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\ 
     16        `find . -name '*.[ch]'` | ${SED-sed} -ne '/^#:/{s/#://;s/:[0-9]*/\ 
    1717/g;s/ //g;p;}' | \ 
    1818        grep -v '^$' | sort | uniq >po/POTFILES.in 
    1919 
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 07c987e00..90934491c 100644
    a b po/Makefile.in 
    708708 
    709709dnl https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable/30932102#30932102 
    710710AC_CONFIG_FILES( 
    711 [misc/syntax/Syntax], [sed -i -e "s%\${prefix}%$PREFIX%" misc/syntax/Syntax], [export PREFIX=$prefix] 
     711[misc/syntax/Syntax], [${SED-sed} -i -e "s%\${prefix}%$PREFIX%" misc/syntax/Syntax], [export PREFIX=$prefix] 
    712712) 
    713713 
    714714AC_CONFIG_FILES([ 
  • contrib/Makefile.am

    diff --git a/contrib/Makefile.am b/contrib/Makefile.am
    index 4a97905d9..7065279b1 100644
    a b EXTRA_DIST = \ 
    1919        $(noinst_DATA) 
    2020 
    2121mc.csh: $(top_builddir)/config.status $(srcdir)/mc.csh.in 
    22         sed "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.csh.in > mc.csh 
     22        $(SED) "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.csh.in > mc.csh 
    2323 
    2424mc.sh: $(top_builddir)/config.status $(srcdir)/mc.sh.in 
    25         sed "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.sh.in > mc.sh 
     25        $(SED) "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.sh.in > mc.sh 
    2626 
    2727mc-wrapper.csh: $(top_builddir)/config.status $(srcdir)/mc-wrapper.csh.in 
    28         sed "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.csh.in > mc-wrapper.csh 
     28        $(SED) "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.csh.in > mc-wrapper.csh 
    2929 
    3030mc-wrapper.sh: $(top_builddir)/config.status $(srcdir)/mc-wrapper.sh.in 
    31         sed "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.sh.in > mc-wrapper.sh 
     31        $(SED) "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.sh.in > mc-wrapper.sh 
    3232 
  • doc/man/date-of-man-include.am

    diff --git a/doc/man/date-of-man-include.am b/doc/man/date-of-man-include.am
    index c6b1e692c..2770b5368 100644
    a b MAN_DATE_CMD = \ 
    1313 
    1414mc.1: $(srcdir)/mc.1.in 
    1515        MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \ 
    16         sed $(SED_PARAMETERS) $< > $@ 
     16        $(SED) $(SED_PARAMETERS) $< > $@ 
    1717 
    1818mcedit.1: $(srcdir)/mcedit.1.in 
    1919        MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \ 
    20         sed $(SED_PARAMETERS) $< > $@ 
     20        $(SED) $(SED_PARAMETERS) $< > $@ 
    2121 
    2222mcview.1: $(srcdir)/mcview.1.in 
    2323        MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \ 
    24         sed $(SED_PARAMETERS) $< > $@ 
     24        $(SED) $(SED_PARAMETERS) $< > $@ 
  • m4.include/mc-glib.m4

    diff --git a/m4.include/mc-glib.m4 b/m4.include/mc-glib.m4
    index ba4901f79..400820729 100644
    a b AC_DEFUN([mc_G_MODULE_SUPPORTED], [ 
    4949            esac 
    5050 
    5151            if test -n "$lib"; then 
    52                 lib1=`echo $i | sed 's/^-l//'` 
     52                lib1=`echo $i | ${SED-sed} 's/^-l//'` 
    5353                if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then 
    5454                    add="$GLIB_LIBDIR/lib${lib1}.a" 
    5555                else 
  • m4.include/mc-version.m4

    diff --git a/m4.include/mc-version.m4 b/m4.include/mc-version.m4
    index 51b6b77c4..ba89b5f99 100644
    a b dnl @modified Andrew Borodin <aborodin@vmail.ru> 
    1010 
    1111AC_DEFUN([mc_VERSION],[ 
    1212    if test -f ${srcdir}/mc-version.h; then 
    13         VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/mc-version.h | sed 's/.*"\(.*\)"$/\1/') 
     13        VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/mc-version.h | ${SED-sed} 's/.*"\(.*\)"$/\1/') 
    1414    else 
    1515        VERSION="unknown" 
    1616    fi 
  • maint/utils/find-dup-includes/runme.sh

    diff --git a/maint/utils/find-dup-includes/runme.sh b/maint/utils/find-dup-includes/runme.sh
    index 9e7c5802d..040e8586d 100755
    a b findIncludeDupsInDir() { 
    3737    dir_name=$1; shift 
    3838 
    3939    for i in $(find "${dir_name}" -name '*.[ch]'); do 
    40         file_name=$(echo $i | sed 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g') 
     40        file_name=$(echo $i | ${SED-sed} 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g') 
    4141        [ $(grep "^\s*${file_name}$" -c "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/exclude-list.cfg") -ne 0 ] && continue 
    4242        "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/find-in-one-file.pl" "${i}" 
    4343    done 
  • maint/utils/update-years.sh

    diff --git a/maint/utils/update-years.sh b/maint/utils/update-years.sh
    index 1188fb1c8..7370d2559 100755
    a b LINE="Copyright (C)" 
    99for i in "$SOURCES"; do 
    1010    # replace year: XXXX-YYYY -> XXXX-ZZZZ 
    1111    # add year: XXXX -> XXXX-ZZZZ 
    12     sed -i -e " 
     12    ${SED-sed} -i -e " 
    1313        1,20 { 
    1414                /$LINE/s/-[0-9]\{4\}$/-$YEAR/ 
    1515        }; 
    for i in "$SOURCES"; do 
    1919done 
    2020 
    2121# special case 
    22 sed -i -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c 
     22${SED-sed} -i -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c 
  • po/Rules-pot-defaults

    diff --git a/po/Rules-pot-defaults b/po/Rules-pot-defaults
    index 2cf834ede..1c51b56e2 100644
    a b  
    11 
    22update-po: Makefile 
    33        $(MAKE) $(DOMAIN).pot-update && \ 
    4         sed \ 
     4        $(SED) \ 
    55            -e '/#, fuzzy/d' \ 
    66            -e 's/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: $(PACKAGE) $(VERSION)/' \ 
    77            -e 's/^"Plural-Forms: nplurals=INTEGER;/# "Plural-Forms: nplurals=INTEGER;/' \ 
  • version.sh

    diff --git a/version.sh b/version.sh
    index 0565b7448..970ecb5a6 100755
    a b SHOR_MC_VERSION="${PREV_MC_VERSION}" 
    6363 
    6464if [ -r "${VERSION_FILE}" ] 
    6565  then 
    66     PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"` 
     66    PREV_MC_VERSION=`${SED-sed} -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"` 
    6767    CURR_MC_VERSION="${PREV_MC_VERSION}" 
    6868    SHOR_MC_VERSION="${PREV_MC_VERSION}" 
    6969fi