BPackageWriter: Add SetCheckLicenses()
The default is still "true", but now it is possible to disable the license check.
This commit is contained in:
parent
14f94ae7d4
commit
7efa133cb4
@ -48,6 +48,7 @@ public:
|
||||
~BPackageWriter();
|
||||
|
||||
status_t Init(const char* fileName, uint32 flags = 0);
|
||||
void SetCheckLicenses(bool checkLicenses);
|
||||
status_t AddEntry(const char* fileName, int fd = -1);
|
||||
status_t Finish();
|
||||
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
~PackageWriterImpl();
|
||||
|
||||
status_t Init(const char* fileName, uint32 flags);
|
||||
void SetCheckLicenses(bool checkLicenses);
|
||||
status_t AddEntry(const char* fileName, int fd = -1);
|
||||
status_t Finish();
|
||||
|
||||
@ -147,6 +148,7 @@ private:
|
||||
StringCache fStringCache;
|
||||
|
||||
BPackageInfo fPackageInfo;
|
||||
bool fCheckLicenses;
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,6 +39,14 @@ BPackageWriter::Init(const char* fileName, uint32 flags)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BPackageWriter::SetCheckLicenses(bool checkLicenses)
|
||||
{
|
||||
if (fImpl != NULL)
|
||||
fImpl->SetCheckLicenses(checkLicenses);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BPackageWriter::AddEntry(const char* fileName, int fd)
|
||||
{
|
||||
|
@ -455,7 +455,8 @@ PackageWriterImpl::PackageWriterImpl(BPackageWriterListener* listener)
|
||||
fDataBufferSize(2 * B_HPKG_DEFAULT_DATA_CHUNK_SIZE_ZLIB),
|
||||
fRootEntry(NULL),
|
||||
fRootAttribute(NULL),
|
||||
fTopAttribute(NULL)
|
||||
fTopAttribute(NULL),
|
||||
fCheckLicenses(true)
|
||||
{
|
||||
}
|
||||
|
||||
@ -484,6 +485,13 @@ PackageWriterImpl::Init(const char* fileName, uint32 flags)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PackageWriterImpl::SetCheckLicenses(bool checkLicenses)
|
||||
{
|
||||
fCheckLicenses = checkLicenses;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
PackageWriterImpl::AddEntry(const char* fileName, int fd)
|
||||
{
|
||||
@ -569,9 +577,11 @@ PackageWriterImpl::Finish()
|
||||
|
||||
RegisterPackageInfo(PackageAttributes(), fPackageInfo);
|
||||
|
||||
status_t result = _CheckLicenses();
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
if (fCheckLicenses) {
|
||||
status_t result = _CheckLicenses();
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((Flags() & B_HPKG_WRITER_UPDATE_PACKAGE) != 0)
|
||||
_CompactHeap();
|
||||
|
Loading…
Reference in New Issue
Block a user