diff options
author | John Stebbins <[email protected]> | 2015-08-25 09:48:14 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-11-09 08:39:18 -0800 |
commit | 2ae0de42922185fd1b23751c58d8a1ff671f52be (patch) | |
tree | 864229a9ecd20c71b8fd00ba80adce61f2abd20a /libhb/hb.c | |
parent | 602ede716370c1ca16e784f8008a75c14f77f854 (diff) |
build: use git version info instead of svn
Migrate from svn to git. Since our build system automatically generates
version info from the svn repo, this needs to change when we move the
repo to git.
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index ab71570f6..1af021cd5 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -503,15 +503,68 @@ hb_handle_t * hb_init_dl( int verbose, int update_check ) return h; } +// Make sure these strings at least exist in the executable even though +// they may not all be visible in the frontend. +static const char* hb_title = HB_PROJECT_TITLE; +static const char* hb_name = HB_PROJECT_NAME; +static const char* hb_website = HB_PROJECT_URL_WEBSITE; +static const char* hb_community = HB_PROJECT_URL_COMMUNITY; +static const char* hb_irc = HB_PROJECT_URL_IRC; +static const char* hb_version = HB_PROJECT_VERSION; +static const int hb_build = HB_PROJECT_BUILD; +static const char* hb_repo_url = HB_PROJECT_REPO_URL; +static const char* hb_repo_tag = HB_PROJECT_REPO_TAG; +static const int hb_repo_rev = HB_PROJECT_REPO_REV; +static const char* hb_repo_hash = HB_PROJECT_REPO_HASH; +static const char* hb_repo_branch = HB_PROJECT_REPO_BRANCH; +static const char* hb_repo_remote = HB_PROJECT_REPO_REMOTE; +static const char* hb_repo_type = HB_PROJECT_REPO_TYPE; + +const char * hb_get_full_description() +{ + static char * desc = NULL; + if (desc == NULL) + { + desc = hb_strdup_printf("%s\n" + "\tWebsite: %s\n" + "\tForum: %s\n" + "\tIRC: %s\n" + "\tBuild Type: %s\n" + "\tRepository: %s\n" + "\tRelease Tag: %s\n" + "\tRevision: %d\n" + "\tCommit Hash: %s\n" + "\tBranch: %s\n" + "\tRemote: %s", + hb_title, hb_website, hb_community, hb_irc, + hb_repo_type, hb_repo_url, hb_repo_tag, hb_repo_rev, + hb_repo_hash, hb_repo_branch, hb_repo_remote); + } + return desc; +} /** * Returns current version of libhb. * @param h Handle to hb_handle_t. * @return character array of version number. */ -char * hb_get_version( hb_handle_t * h ) +const char * hb_get_version( hb_handle_t * h ) { - return HB_PROJECT_VERSION; + // Silence compiler warnings for unused variables + ((void)(hb_title)); + ((void)(hb_name)); + ((void)(hb_website)); + ((void)(hb_community)); + ((void)(hb_irc)); + ((void)(hb_version)); + ((void)(hb_repo_url)); + ((void)(hb_repo_tag)); + ((void)(hb_repo_rev)); + ((void)(hb_repo_hash)); + ((void)(hb_repo_branch)); + ((void)(hb_repo_remote)); + ((void)(hb_repo_type)); + return hb_version; } /** @@ -521,7 +574,7 @@ char * hb_get_version( hb_handle_t * h ) */ int hb_get_build( hb_handle_t * h ) { - return HB_PROJECT_BUILD; + return hb_build; } /** |