Changeset 344


Ignore:
Timestamp:
Sep 28, 2012, 2:49:04 AM (8 years ago)
Author:
ehem
Message:

Simplify Subversion revision retrieval routines. Should be faster, are
simpler.

Location:
branches/contrib/rules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/rules/debwrt.mk

    r332 r344  
    2020VERSION:=2.1$(BUILD_CYCLE_ID)
    2121RELEASE_DATE=$(shell LC_ALL=c date +"%d %B %Y")
    22 SVN_REVISION:=$(shell $(SCRIPT_GET_SVN_REVISION))
     22SVN_REVISION:=$(call get_svn_revision)
    2323DEBWRTVERSION:=$(RELEASE) - $(VERSION) - [ $(RELEASE_DATE) ($(SVN_REVISION)) ]
    2424DEBWRT_VERSION:=$(RELEASE)-$(VERSION)
  • branches/contrib/rules/functions.mk

    r2 r344  
    1818# Strip quotes
    1919qstrip=$(strip $(subst ",,$(1)))
    20 #")
     20
     21# Get the SVN revision of something (always returns a number, 0 if absent)
     22get_svn_revision=$(shell svnversion $(1) | sed -e's/^\([0-9]*\).*$/\1/g' -e's/^$/0/g')
     23
  • branches/contrib/rules/get_svn_revision.sh

    r13 r344  
    1 #!/bin/bash
     1#!/bin/sh
    22# DebWrt - Debian on Embedded devices
    33#
    4 # Copyright (C) 2010 Johan van Zoomeren <amain@debwrt.net>
     4# Copyright (C) 2012 Elliott Mitchell <ehem+debwrt@m5p.com>
    55#
    66# This program is free software: you can redistribute it and/or modify
     
    1717# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1818
    19 if [ "" != "$1" ]; then
    20         cd $1
    21 fi
     19svnversion $1 | sed -e's/^\([0-9]*\).*$/r\1/g' -e's/^r$/runknown/g'
    2220
    23 REV=`svnversion . | sed 's/[A-Z]//g' | sed 's/:.*$//'`
    24 REV="${REV:+r$REV}"
    25 if [ "" == "$REV" ]; then REV="unknown"; fi
    26 echo $REV
Note: See TracChangeset for help on using the changeset viewer.