added versioning

This commit is contained in:
tihmstar 2016-12-31 18:30:12 +01:00
parent 1e8ac9c117
commit 89b250d817
4 changed files with 15 additions and 2 deletions

View file

@ -24,3 +24,5 @@ unset NOCONFIGURE
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi
./setBuildVersion.sh

View file

@ -18,6 +18,11 @@
#define PACKAGE_URL "http://libimobiledevice.org"
#undef VERSION_COMMIT_SHA
#undef VERSION_COMMIT_COUNT
#define VERSION_COMMIT_COUNT "undefined version number"
#define VERSION_COMMIT_SHA "undefined version commit"
#endif /* config_h */

View file

@ -14,6 +14,8 @@
#include "all_tsschecker.h"
#include "tsschecker.h"
#include "config.h"
#define safeFree(buf) if (buf) free(buf), buf = NULL
#define safePlistFree(buf) if (buf) plist_free(buf), buf = NULL
@ -38,8 +40,9 @@ static struct option longopts[] = {
void cmd_help(){
printf("Usage: futurerestore [OPTIONS] IPSW\n");
printf("Allows restoring nonmatching iOS/Sep/Baseband\n\n");
printf("Allows restoring nonmatching iOS/Sep/Baseband\n");
printf("Version: " VERSION_COMMIT_SHA" - " VERSION_COMMIT_COUNT"\n\n");
printf(" -t, --apticket PATH\t\tApticket used for restoring\n");
printf(" -b, --baseband PATH\t\tBaseband to be flashed\n");
printf(" -p, --baseband-manifest PATH\tBuildmanifest for requesting baseband ticket\n");

3
setBuildVersion.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
sed -i '.bak' "s/.*define VERSION_COMMIT_COUNT.*/#define VERSION_COMMIT_COUNT \"$(git rev-list --count HEAD)\"/" ./tsschecker/all_tsschecker.h 2>/dev/null || sed -i "s/.*VERSION_COMMIT_COUNT.*/#define VERSION_COMMIT_COUNT \"$(git rev-list --count HEAD)\"/" ./tsschecker/all_tsschecker.h 2>/dev/null
sed -i '.bak' "s/.*define VERSION_COMMIT_SHA.*/#define VERSION_COMMIT_SHA \"$(git rev-parse HEAD)\"/" ./tsschecker/all_tsschecker.h 2>/dev/null || sed -i "s/.*VERSION_COMMIT_SHA.*/#define VERSION_COMMIT_SHA \"$(git rev-parse HEAD)\"/" ./tsschecker/all_tsschecker.h 2>/dev/null