#!/usr/bin/env bash

org_dir=$PWD
BR_DIR="$( cd -- "$(dirname "$0")/../../../" >/dev/null 2>&1 ; pwd -P )"

cd "$BR_DIR"

SVNREV=$(svn info | awk '/^Last Changed Rev: /{print($4);bSuccess=1} END{if(!bSuccess) exit(1);}')
if [ $? -eq 1 ]; then
    SVNREV=$(svn info | awk '/^Letzte ge\xC3\xA4nderte Rev: /{print($4);bSuccess=1} END{if(!bSuccess) exit(1);}')
fi

SVNMOD=$(svn status | awk '/^M/{bFound=1;} END{if(bFound) print("*");}')

echo $SVNREV$SVNMOD > ${TARGET_DIR}/home/user/linuxbbsvnrev.txt

cd "$org_dir"
