mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
Show the builds commit ID during boot
This commit is contained in:
parent
78c2fbce22
commit
6f653db8a5
1
Makefile
1
Makefile
@ -100,6 +100,7 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||
# automatically build a list of object files for our project
|
||||
#---------------------------------------------------------------------------------
|
||||
SVNREV := $(shell bash ./svnrev.sh)
|
||||
GITVER := $(shell bash ./gitver.sh)
|
||||
IMPORTFILES := $(shell bash ./filelist.sh)
|
||||
export CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
export CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
|
25
gitver.sh
Normal file
25
gitver.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#! /bin/bash
|
||||
commit_id=$(git rev-parse --short=7 HEAD 2>/dev/null)
|
||||
[ -z "$commit_id" ] && commit_id="0000001"
|
||||
commit_message=$(git show -s --format="%<(52,trunc)%s" $commit_id 2>/dev/null | sed -e 's/[[:space:]]*$//')
|
||||
[ -z "$commit_message" ] && commit_message="unable to get the commit message"
|
||||
commit_id_old=$(cat ./source/gitver.c 2>/dev/null | tr -d '\n' | sed -r 's/.*([0-9a-f]{7}).*/\1/')
|
||||
|
||||
if [ "$commit_id" != "$commit_id_old" ] || [ ! -f ./source/gitver.c ]; then
|
||||
|
||||
cat <<EOF > ./source/gitver.c
|
||||
#define GIT_HASH "$commit_id"
|
||||
|
||||
const char *commitID()
|
||||
{
|
||||
return GIT_HASH;
|
||||
}
|
||||
EOF
|
||||
|
||||
if [ -z "$commit_id_old" ]; then
|
||||
echo "Created gitver.c and set the commit ID to $commit_id ($commit_message)" >&2
|
||||
else
|
||||
echo "Changed the commit ID from $commit_id_old to $commit_id ($commit_message)" >&2
|
||||
fi
|
||||
echo >&2
|
||||
fi
|
@ -25,6 +25,7 @@
|
||||
#include "utils/tools.h"
|
||||
#include "sys.h"
|
||||
#include "svnrev.h"
|
||||
#include "gitver.h"
|
||||
|
||||
extern bool isWiiVC; // in sys.cpp
|
||||
|
||||
@ -53,13 +54,13 @@ StartUpProcess::StartUpProcess()
|
||||
versionTxt->SetPosition(20, screenheight-20);
|
||||
|
||||
#ifdef FULLCHANNEL
|
||||
versionTxt->SetTextf("v3.0c Rev. %s", GetRev());
|
||||
versionTxt->SetTextf("v3.0c Rev. %s (%s)", GetRev(), commitID());
|
||||
#else
|
||||
versionTxt->SetTextf("v3.0 Rev. %s", GetRev());
|
||||
versionTxt->SetTextf("v3.0 Rev. %s (%s)", GetRev(), commitID());
|
||||
#endif
|
||||
|
||||
#if 1 // enable if you release a modded version - enabled by default to differentiate official releases
|
||||
versionTxt->SetTextf("v3.0 Rev. %s mod", GetRev());
|
||||
versionTxt->SetTextf("v3.0 Rev. %s mod (%s)", GetRev(), commitID());
|
||||
#endif
|
||||
|
||||
cancelTxt = new GuiText("Press B to cancel", 18, (GXColor) {255, 255, 255, 255});
|
||||
|
15
source/gitver.h
Normal file
15
source/gitver.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef GITVER_H
|
||||
#define GITVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
const char *commitID();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user