* add basic stuff for putting svn rev into the programs for identification.

* only tested on kubuntu with ohneswanzenegger so far
This commit is contained in:
giantpune 2011-05-28 06:50:16 +00:00
parent 530f360482
commit 7f3c6d1d25
8 changed files with 42 additions and 2 deletions

3
.gitattributes vendored
View File

@ -160,3 +160,6 @@ thp_player/thpwindow.ui -text
thp_player/vol_high.png -text
thp_player/vol_low.png -text
thp_player/vol_med.png -text
tools/SubWCRev.exe -text
tools/makesvnrev.sh -text
tools/svnrev_template.h -text

View File

@ -249,6 +249,21 @@ quint8 AttrFromSave( const SaveGame &save, const QString &name )
return 0;
}
QString CleanSvnStr( const QString &orig )
{
QString ret = orig;
if( ret.isEmpty() )
return ret;
QRegExp notNum( "[^0-9]" );
QStringList parts = ret.split( notNum, QString::SkipEmptyParts );
if( parts.size() )
return parts.at( parts.size() - 1 );
return ret;
}
#define CERTS_DAT_SIZE 2560
const quint8 certs_dat[ CERTS_DAT_SIZE ] = {
0x00, 0x01, 0x00, 0x01, 0x7D, 0x9D, 0x5E, 0xBA, 0x52, 0x81, 0xDC, 0xA7, 0x06, 0x5D, 0x2F, 0x08,

View File

@ -78,6 +78,9 @@ QByteArray ReadFile( const QString &path );
//save a file to disc
bool WriteFile( const QString &path, const QByteArray &ba );
//cleanup an svn revision string
QString CleanSvnStr( const QString &orig );
#define CERTS_DAT_SIZE 2560
extern const quint8 certs_dat[ CERTS_DAT_SIZE ];
extern const quint8 root_dat[];

View File

@ -1,5 +1,6 @@
#include "mainwindow.h"
#include "newnandbin.h"
#include "svnrev.h"
#include "ui_mainwindow.h"
#include "../WiiQt/settingtxtdialog.h"
@ -57,7 +58,6 @@ MainWindow::MainWindow( QWidget *parent ) : QMainWindow( parent ), ui( new Ui::M
LoadSettings();
ui->lineEdit_nandPath->setText( "./testNand.bin" );
}
MainWindow::~MainWindow()
@ -785,7 +785,7 @@ void MainWindow::on_actionAbout_triggered()
"<br><br>IT SHOULD ONLY BE USED BY PEOPLE THAT KNOW HOW TO VERIFY THE FILES IT PRODUCES. AND HAVE A WAY TO FIX A BRICKED WII SHOULD THIS PROGRAM HAVE BUGS"
"<br><br>YOU HAVE BEEN WARNED"
"<br>giantpune" );
QMessageBox::critical( this, tr( "About" ), txt );
QMessageBox::critical( this, tr( "svn r%1" ).arg( CleanSvnStr( SVN_REV_STR ) ), txt );
}
#if 0

View File

@ -39,3 +39,14 @@ FORMS += mainwindow.ui \
../WiiQt/settingtxtdialog.ui \
newnandbin.ui
RESOURCES += rc.qrc
# create new svnrev.h
unix {
system( chmod 755 ../tools/makesvnrev.sh )
system( ../tools/makesvnrev.sh )
}
win32 {
system( ../tools/SubWCRev.exe "." "../tools/svnrev_template.h" "./svnrev.h" )
}

BIN
tools/SubWCRev.exe Normal file

Binary file not shown.

6
tools/makesvnrev.sh Executable file
View File

@ -0,0 +1,6 @@
REV=`svnversion -n .`
echo $REV
cat > ./svnrev.h <<EOF
#define SVN_REV $REV
#define SVN_REV_STR "$REV"
EOF

2
tools/svnrev_template.h Normal file
View File

@ -0,0 +1,2 @@
#define SVN_REV $WCREV$
#define SVN_REV_STR "$WCMODS?$WCREV$M:$WCREV$$"