Skip to content
Snippets Groups Projects
Select Git revision
  • digital-empire
  • slopey-speedey-launchey-funtime
  • slopey-speedy-funtime
  • master default
  • public_flatsprite
  • next
  • apng-conditional-disable
  • tiny-makefile-fix
  • sound-handle-fix
  • tiny-joystick-fix
  • fixer-mixer
  • opengl-bigmap-fix
  • opengl-mappalette-fix
  • opengl-fullbrightsprite-fix
  • openglquickfixes
  • orbital-camera
  • fake-contrast-fix
  • software-light-changes
  • fixedrounding-hotfix
  • reduced_palette
  • SRB2_release_2.1.15
  • SRB2_release_2.1.14
  • SRB2_release_2.1.12
  • SRB2_release_2.1.11
  • SRB2_release_2.1.10
  • SRB2_release_2.1.9
  • SRB2_release_2.1.8
  • SRB2_release_2.1.7
  • SRB2_release_2.1.6
  • SRB2_release_2.1.5
  • SRB2_release_2.1.4
  • SRB2_release_2.1.3
  • SRB2_release_2.1.2
  • SRB2_release_2.1.1
  • SRB2_release_2.1
35 results

comptime.sh

Blame
  • Forked from STJr / SRB2
    15225 commits behind the upstream repository.
    comptime.sh 1.00 KiB
    #!/bin/bash -e
    path="."
    if [ x"$1" != x ]; then
    	path="$1"
    fi
    
    versiongit() {
    	gitbranch=`git rev-parse --abbrev-ref HEAD`
    	gitversion=`git rev-parse HEAD`
    	cat <<EOF > $path/comptime.h
    
    // Do not edit!  This file was autogenerated
    // by the $0 script with git
    //
    const char* compbranch = "$gitbranch";
    const char* comprevision = "${gitversion:0:8}";
    EOF
    exit 0
    }
    
    versionsvn() {
    	svnrevision=`svnversion -n $1`
    	cat <<EOF > $path/comptime.h
    
    // Do not edit!  This file was autogenerated
    // by the $0 script with subversion
    //
    const char* compbranch = "Subversion";
    const char* comprevision = "r$svnrevision";
    EOF
    exit 0
    }
    
    versionfake() {
    	cat <<EOF > $path/comptime.h
    
    // Do not edit!  This file was autogenerated
    // by the $0 script with an unknown or nonexist SCM
    //
    const char* compbranch = "Unknown";
    const char* comprevision = "illegal";
    EOF
    }
    
    compversion() {
    touch $path/comptime.c
    versionfake
    test -d $path/.svn && versionsvn
    test -d $path/../.git && versiongit
    exit 1
    }
    
    test -f $path/comptime.c && compversion
    exit 2