Ticket #10211: tag_cache.diff

File tag_cache.diff, 1.2 KB (added by augiedoggie, 10 years ago)

Crude attempt at remote tags

  • build/scripts/determine_haiku_revision

    commit d5b469fbe586b950394dae0b1b0b5791d1cb97cf
    Author: Chris Roberts <cpr420@gmail.com>
    Date:   Fri Nov 1 22:27:00 2013 -0600
    
        Initial attempt at remote tags for determining haiku revision
    
    diff --git a/build/scripts/determine_haiku_revision b/build/scripts/determine_haiku_revision
    index 465180a..99f1075 100755
    a b if [ -z "$revision" -o "$lastBuiltRevision" != "$localRev" ]; then  
    3030    # the revision we use is the description of HEAD with respect to the
    3131    # last reachable hrev-(haiku-revision-)tag
    3232    revision=`git describe --dirty --tags --match=hrev*`
     33    if [ -z "$revision" ];then
     34        echo "Updating tag cache: $haikuBuildOutputDir/tag.cache"
     35        git ls-remote -t git://git.haiku-os.org/haiku > $haikuBuildOutputDir/tag.cache
     36        tag=$(grep $(git rev-parse @{u}) $haikuBuildOutputDir/tag.cache | grep hrev | cut -f3 -d/)
     37        if [ -n "$tag" ];then
     38            extraCommits=$(git log @{u}.. --oneline | wc -l)
     39            currentHash=$(git rev-parse --short HEAD)
     40            revision="$tag-$extraCommits-g$currentHash"
     41        fi
     42    fi
    3343    if [ -z "$revision" ]; then
    3444        # failed to find any hrev tags, use short hash instead
    3545        revision=`git rev-parse --short HEAD`