Ticket #403: 0003-more-elegant-extraction-of-old-version.patch

File 0003-more-elegant-extraction-of-old-version.patch, 834 bytes (added by ossi, 10 years ago)
  • maint/version.sh

    From 487b1b58d8ca6ea4dac220e203d712ed1e1e616b Mon Sep 17 00:00:00 2001
    From: Oswald Buddenhagen <ossi@kde.org>
    Date: Sat, 13 Jun 2009 10:14:06 +0200
    Subject: [PATCH 3/4] more elegant extraction of old version
    
    sed is rather powerful ;)
    ---
     maint/version.sh |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/maint/version.sh b/maint/version.sh
    index a3d6114..8a1fb18 100755
    a b new_version="$(git describe 2>/dev/null)" 
    3030 
    3131saved_version= 
    3232[ -r  ${VERSION_FILE} ] && { 
    33     saved_version=$(grep '^#define MC_CURRENT_VERSION' ${VERSION_FILE}| sed -r 's/.*"(.*)"$/\1/') 
     33    saved_version=$(sed -rn 's/^#define MC_CURRENT_VERSION "(.*)"$/\1/p' ${VERSION_FILE}) 
    3434} 
    3535 
    3636[ -z "${saved_version}" -o "${saved_version}" != "${new_version}" ] && {