Add a package info "install-path" attribute

The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.
This commit is contained in:
Ingo Weinhold
2011-11-25 06:19:35 +01:00
parent 7efa133cb4
commit 6ae0ecd49a
12 changed files with 70 additions and 1 deletions
+3
View File
@@ -60,6 +60,7 @@ public:
const BString& Vendor() const;
const BString& Packager() const;
const BString& Checksum() const;
const BString& InstallPath() const;
uint32 Flags() const;
@@ -89,6 +90,7 @@ public:
void SetVendor(const BString& vendor);
void SetPackager(const BString& packager);
void SetChecksum(const BString& checksum);
void SetInstallPath(const BString& installPath);
void SetFlags(uint32 flags);
@@ -174,6 +176,7 @@ private:
BObjectList<BString> fReplacesList;
BString fChecksum;
BString fInstallPath;
};
@@ -37,6 +37,8 @@ enum BPackageInfoAttributeID {
B_PACKAGE_INFO_URLS, // list
B_PACKAGE_INFO_SOURCE_URLS, // list
B_PACKAGE_INFO_CHECKSUM, // sha256-checksum
B_PACKAGE_INFO_INSTALL_PATH, // package install path; only for package
// building
//
B_PACKAGE_INFO_ENUM_COUNT,
};
+1
View File
@@ -126,6 +126,7 @@ enum BHPKGAttributeID {
B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES_COMPATIBLE = 41,
B_HPKG_ATTRIBUTE_ID_PACKAGE_URL = 42,
B_HPKG_ATTRIBUTE_ID_PACKAGE_SOURCE_URL = 43,
B_HPKG_ATTRIBUTE_ID_PACKAGE_INSTALL_PATH = 44,
//
B_HPKG_ATTRIBUTE_ID_ENUM_COUNT,
};
+1
View File
@@ -48,6 +48,7 @@ public:
~BPackageWriter();
status_t Init(const char* fileName, uint32 flags = 0);
status_t SetInstallPath(const char* installPath);
void SetCheckLicenses(bool checkLicenses);
status_t AddEntry(const char* fileName, int fd = -1);
status_t Finish();
@@ -10,6 +10,8 @@
#include <util/DoublyLinkedList.h>
#include <util/OpenHashTable.h>
#include <String.h>
#include <package/hpkg/PackageWriter.h>
#include <package/hpkg/Strings.h>
#include <package/hpkg/WriterImplBase.h>
@@ -43,6 +45,7 @@ public:
~PackageWriterImpl();
status_t Init(const char* fileName, uint32 flags);
status_t SetInstallPath(const char* installPath);
void SetCheckLicenses(bool checkLicenses);
status_t AddEntry(const char* fileName, int fd = -1);
status_t Finish();
@@ -148,6 +151,7 @@ private:
StringCache fStringCache;
BPackageInfo fPackageInfo;
BString fInstallPath;
bool fCheckLicenses;
};