Support package info [source] URL attributes
This commit is contained in:
parent
4b6a3a9c5f
commit
4ebd3de828
@ -164,6 +164,14 @@ struct PackageContentListHandler : BPackageContentHandler {
|
||||
printf("\tlicense: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_URLS:
|
||||
printf("\tURL: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_SOURCE_URLS:
|
||||
printf("\tsource URL: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_PROVIDES:
|
||||
printf("\tprovides: %s", value.resolvable.name);
|
||||
if (value.resolvable.haveVersion) {
|
||||
|
@ -115,6 +115,16 @@ struct RepositoryContentListHandler : BRepositoryContentHandler {
|
||||
printf("\tlicense: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_URLS:
|
||||
if (fVerbose)
|
||||
printf("\tURL: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_SOURCE_URLS:
|
||||
if (fVerbose)
|
||||
printf("\tsource URL: %s\n", value.string);
|
||||
break;
|
||||
|
||||
case B_PACKAGE_INFO_PROVIDES:
|
||||
if (!fVerbose)
|
||||
break;
|
||||
|
@ -376,6 +376,14 @@ ReaderImplBase::PackageAttributeHandler::HandleAttribute(
|
||||
value.string);
|
||||
break;
|
||||
|
||||
case B_HPKG_ATTRIBUTE_ID_PACKAGE_URL:
|
||||
fPackageInfoValue.SetTo(B_PACKAGE_INFO_URLS, value.string);
|
||||
break;
|
||||
|
||||
case B_HPKG_ATTRIBUTE_ID_PACKAGE_SOURCE_URL:
|
||||
fPackageInfoValue.SetTo(B_PACKAGE_INFO_SOURCE_URLS, value.string);
|
||||
break;
|
||||
|
||||
case B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES:
|
||||
fPackageInfoValue.resolvable.name = value.string;
|
||||
fPackageInfoValue.attributeID = B_PACKAGE_INFO_PROVIDES;
|
||||
|
@ -431,6 +431,28 @@ WriterImplBase::RegisterPackageInfo(PackageAttributeList& attributeList,
|
||||
attributeList.Add(license);
|
||||
}
|
||||
|
||||
// URL list
|
||||
const BObjectList<BString>& urlList = packageInfo.URLList();
|
||||
for (int i = 0; i < urlList.CountItems(); ++i) {
|
||||
PackageAttribute* url = new PackageAttribute(
|
||||
B_HPKG_ATTRIBUTE_ID_PACKAGE_URL, B_HPKG_ATTRIBUTE_TYPE_STRING,
|
||||
B_HPKG_ATTRIBUTE_ENCODING_STRING_TABLE);
|
||||
url->string = fPackageStringCache.Get(urlList.ItemAt(i)->String());
|
||||
attributeList.Add(url);
|
||||
}
|
||||
|
||||
// source URL list
|
||||
const BObjectList<BString>& sourceURLList = packageInfo.SourceURLList();
|
||||
for (int i = 0; i < sourceURLList.CountItems(); ++i) {
|
||||
PackageAttribute* url = new PackageAttribute(
|
||||
B_HPKG_ATTRIBUTE_ID_PACKAGE_SOURCE_URL,
|
||||
B_HPKG_ATTRIBUTE_TYPE_STRING,
|
||||
B_HPKG_ATTRIBUTE_ENCODING_STRING_TABLE);
|
||||
url->string = fPackageStringCache.Get(
|
||||
sourceURLList.ItemAt(i)->String());
|
||||
attributeList.Add(url);
|
||||
}
|
||||
|
||||
// provides list
|
||||
const BObjectList<BPackageResolvable>& providesList
|
||||
= packageInfo.ProvidesList();
|
||||
|
Loading…
Reference in New Issue
Block a user