diff options
author | Ingo Weinhold <ingo_weinhold@gmx.de> | 2013-04-18 15:14:04 +0200 |
---|---|---|
committer | Ingo Weinhold <ingo_weinhold@gmx.de> | 2013-04-18 18:10:43 +0200 |
commit | ce79dec8a03a122dd17eefdb3cdc66068c4d0de7 (patch) | |
tree | 39e6086978e73586a24d7e49802a67cd424e8383 /ext | |
parent | f3deacb9edf20625f3c62574addea4132b14de60 (diff) | |
download | libsolv-ce79dec8a03a122dd17eefdb3cdc66068c4d0de7.tar.gz libsolv-ce79dec8a03a122dd17eefdb3cdc66068c4d0de7.tar.bz2 libsolv-ce79dec8a03a122dd17eefdb3cdc66068c4d0de7.zip |
repo_haiku: get rid of haiku_version_to_string()
Use BPackageVersion::ToString() instead.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/repo_haiku.cpp | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/ext/repo_haiku.cpp b/ext/repo_haiku.cpp index a417934..092b957 100644 --- a/ext/repo_haiku.cpp +++ b/ext/repo_haiku.cpp @@ -17,31 +17,6 @@ using namespace BPackageKit; using namespace BPackageKit::BHPKG; -static BString haiku_version_to_string(const BPackageVersion &version) -{ - if (version.InitCheck() != B_OK) - return BString(); - - // compose "<major>.<minor>.<micro>" (empty epoch) - BString string(version.Major()); - if (!version.Minor().IsEmpty()) - { - string << '.' << version.Minor(); - if (!version.Micro().IsEmpty()) - string << '.' << version.Micro(); - } - - // append pre-release - if (!version.PreRelease().IsEmpty()) - string << '-' << version.PreRelease(); - - // append revision - if (version.Revision() != 0) - string << '-' << version.Revision(); - - return string; -} - static void add_dependency(Repo *repo, Offset &dependencies, const char *name, const char *version, int flags, const char* compatVersion = NULL) { @@ -68,7 +43,7 @@ static void add_dependency(Repo *repo, Offset &dependencies, const char *name, static void add_dependency(Repo *repo, Offset &dependencies, const char *name, const BPackageVersion &version, int flags) { - add_dependency(repo, dependencies, name, haiku_version_to_string(version), + add_dependency(repo, dependencies, name, version.ToString(), flags); } @@ -78,8 +53,8 @@ static void add_resolvables(Repo *repo, Offset &dependencies, for (int32 i = 0; BPackageResolvable *resolvable = resolvables.ItemAt(i); i++) { add_dependency(repo, dependencies, resolvable->Name(), - haiku_version_to_string(resolvable->Version()), REL_EQ, - haiku_version_to_string(resolvable->CompatibleVersion())); + resolvable->Version().ToString(), REL_EQ, + resolvable->CompatibleVersion().ToString()); } } @@ -153,8 +128,7 @@ static Id add_package_info_to_repo(Repo *repo, Repodata *repoData, else solvable->arch = pool_str2id(pool, BPackageInfo::kArchitectureNames[packageInfo.Architecture()], 1); - solvable->evr = pool_str2id(pool, - haiku_version_to_string(packageInfo.Version()), 1); + solvable->evr = pool_str2id(pool, packageInfo.Version().ToString(), 1); solvable->vendor = pool_str2id(pool, packageInfo.Vendor(), 1); repodata_set_str(repoData, solvable - pool->solvables, SOLVABLE_SUMMARY, packageInfo.Summary()); |