Ticket #13232: 20180301_1458_mythbuild_version.patch

File 20180301_1458_mythbuild_version.patch, 1.9 KB (added by Peter Bennett, 2 years ago)

Always use correct version when building

  • android/mythbuild.sh

    diff --git a/android/mythbuild.sh b/android/mythbuild.sh
    index c4dbd93..65a18d0 100755
    a b if [ $SHADOW_BUILD = 1 ]; then 
    287287else
    288288        # cheap mans shadow build
    289289        MYTHTVSRC=.
     290        SOURCE_VERSION=$(git -C $MYMYTHPATH describe --dirty || git -C $MYMYTHPATH describe || echo Unknown)
     291        BRANCH=$(git -C $MYMYTHPATH branch --no-color | sed -e '/^[^\*]/d' -e 's/^\* //' -e 's/(no branch)/exported/')
     292        pushd $MYMYTHBUILDPATH
     293        echo "Format" > EXPORTED_VERSION
     294        echo "SOURCE_VERSION=\"$SOURCE_VERSION\"" > VERSION
     295        echo "BRANCH=\"$BRANCH\"" >> VERSION
     296        popd
    290297        if [ ! -e $MYMYTHBUILDBASEPATH/mythtv/stamp_shadow_android ] ; then
    291298                rm -r $MYMYTHBUILDBASEPATH
    292299                cp -as `readlink -f $MYMYTHPATH` $MYMYTHBUILDBASEPATH
    else 
    294301                pushd $MYMYTHBUILDBASEPATH
    295302                git -C $MYMYTHPATH ls-files -o | grep -vE "kdev4|user|src" | xargs -n1 rm
    296303                popd
    297                 SOURCE_VERSION=$(git -C $MYMYTHPATH describe --dirty || git -C $MYMYTHPATH describe || echo Unknown)
    298                 BRANCH=$(git -C $MYMYTHPATH branch --no-color | sed -e '/^[^\*]/d' -e 's/^\* //' -e 's/(no branch)/exported/')
    299                 pushd $MYMYTHBUILDPATH
    300                 rm EXPORTED_VERSION || true
    301                 rm VERSION || true
    302                 popd
    303304                touch $MYMYTHBUILDBASEPATH/mythtv/stamp_shadow_android
    304305        fi
    305306        pwd
    306         if [ ! -e $MYMYTHBUILDBASEPATH/mythtv/stamp_configure_android ] ; then
    307                 cd $MYMYTHBUILDPATH
    308                 echo "Format" > EXPORTED_VERSION
    309                 echo "SOURCE_VERSION=\"$SOURCE_VERSION\"" > VERSION
    310                 echo "BRANCH=\"$BRANCH\"" >> VERSION
    311                 export MYTHLIBVERSION=${SOURCE_VERSION%%-*}
    312                 export MYTHLIBVERSION=${MYTHLIBVERSION#v}
    313         else
    314                 cd $MYMYTHBUILDPATH
    315                 source VERSION
    316                 export MYTHLIBVERSION=${SOURCE_VERSION%%-*}
    317                 export MYTHLIBVERSION=${MYTHLIBVERSION#v}
    318         fi
     307        cd $MYMYTHBUILDPATH
     308        export MYTHLIBVERSION=${SOURCE_VERSION%%-*}
     309        export MYTHLIBVERSION=${MYTHLIBVERSION#v}
    319310        export GIT_CEILING_DIRECTORIES="`readlink -f ..`"
    320311fi
    321312