Ticket #1754: 0001-fwmod-Identify-SVN_VERSION-when-you-cloned-from-Git-.2.patch

Datei 0001-fwmod-Identify-SVN_VERSION-when-you-cloned-from-Git-.2.patch, 1.1 KB (hinzugefügt von dileks, vor 6 Jahren)

[PATCH] fwmod: Identify SVN_VERSION when you cloned from Git repository (v2)

  • fwmod

    From eaebe995f62ac390e2c95f64961f85130ab88c14 Mon Sep 17 00:00:00 2001
    From: Sedat Dilek <sedat.dilek@gmail.com>
    Date: Tue, 27 Mar 2012 19:52:49 +0200
    Subject: [PATCH] fwmod: Identify SVN_VERSION when you cloned from Git
     repository (v2)
    
    For details about Git repository see <http://freetz.org/wiki/common/source_code>.
    
    [ v2: Rework identification and check first for empty string ]
    
    Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
    ---
     fwmod |    6 ++++++
     1 files changed, 6 insertions(+), 0 deletions(-)
    
    diff --git a/fwmod b/fwmod
    index c4776b6..18e1686 100755
    a b if [ "$DO_MOD" -gt 0 ]; then 
    688688            [ "${SVN_VERSION:0:6}" == "export" ] && SVN_VERSION="" 
    689689            [ "$SVN_VERSION" != "" ] && SVN_VERSION="-$SVN_VERSION" 
    690690        fi 
     691        # Identify SVN_VERSION when you cloned from Git repository 
     692        # For details see <http://freetz.org/wiki/common/source_code> 
     693        if [ -d .git ] && [ -f $(which git) ]; then 
     694            SVN_VERSION=$(git log | grep git-svn-id | head -1 | cut -d '@' -f 2 | cut -d ' ' -f 1) 
     695            [ "$SVN_VERSION" != "" ] && SVN_VERSION="-$SVN_VERSION" 
     696        fi 
    691697    fi 
    692698 
    693699    SUBVERSION="$(cat $SUBVERSION_FILE)${SVN_VERSION}"