package[_repo]: Print version correctly

Use BPackageVersion::ToString() instead of assembling the version
string manually. This fixes the incorrect pre-release separator.
This commit is contained in:
Ingo Weinhold 2013-04-19 01:31:47 +02:00
parent ea8b5c257d
commit b50e5e3307
2 changed files with 2 additions and 18 deletions

View File

@ -265,15 +265,7 @@ private:
static void _PrintPackageVersion(const BPackageVersionData& version)
{
printf("%s", version.major);
if (version.minor != NULL && version.minor[0] != '\0')
printf(".%s", version.minor);
if (version.micro != NULL && version.micro[0] != '\0')
printf(".%s", version.micro);
if (version.preRelease != NULL && version.preRelease[0] != '\0')
printf("-%s", version.preRelease);
if (version.revision > 0)
printf("-%" B_PRIu32, version.revision);
printf("%s", BPackageVersion(version).ToString().String());
}
private:

View File

@ -231,15 +231,7 @@ struct RepositoryContentListHandler : BRepositoryContentHandler {
private:
static void _PrintPackageVersion(const BPackageVersionData& version)
{
printf("%s", version.major);
if (version.minor != NULL && version.minor[0] != '\0')
printf(".%s", version.minor);
if (version.micro != NULL && version.micro[0] != '\0')
printf(".%s", version.micro);
if (version.preRelease != NULL && version.preRelease[0] != '\0')
printf("-%s", version.preRelease);
if (version.revision > 0)
printf("-%" B_PRIu32, version.revision);
printf("%s", BPackageVersion(version).ToString().String());
}
private: