Package Kit: reduce identifer/base-url confusion

For historical reasons, the package kit has an "url" field that is not
actually meant to be used as an URL. Rename it in the API and user
facing output as "identifier" to make it clear what the file is used
for. This change preserves the "url" key in on-disk and online storage
(hpkr files, stored settings, etc) in an attempt to not break anything.

Fix one remaining misuse of the "url" field as an URL in
get_package_dependencies.

Add an unit test showing that BUrl does parse "tab" URIs properly (there
is just a protocol and a path segment).

Change-Id: I339ce526e5798d42d78ae650855d7e988dbb4a1a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2542
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Adrien Destugues
2020-05-09 20:04:50 +00:00
committed by waddlesplash
parent 5ef5cba68a
commit aa272ca35c
11 changed files with 73 additions and 46 deletions
+5 -5
View File
@@ -28,7 +28,7 @@ public:
const BString& Name() const;
const BString& BaseURL() const;
const BString& URL() const;
const BString& Identifier() const;
uint8 Priority() const;
bool IsUserSpecific() const;
@@ -38,7 +38,7 @@ public:
void SetName(const BString& name);
void SetBaseURL(const BString& url);
void SetURL(const BString& url);
void SetIdentifier(const BString& url);
void SetPriority(uint8 priority);
void SetIsUserSpecific(bool isUserSpecific);
@@ -52,9 +52,9 @@ private:
BString fBaseURL;
// this URL is the URL that can be used to access the data of
// the repository - it points to a single mirror.
BString fURL;
// this URL is actually an identifier for the repository
// that is consistent across mirrors.
BString fIdentifier;
// an identifier for the repository that is consistent across
// mirrors. Usually a tag: or uuid: URI.
uint8 fPriority;
bool fIsUserSpecific;
+7 -5
View File
@@ -34,7 +34,7 @@ public:
const BString& Name() const;
const BString& BaseURL() const;
const BString& URL() const;
const BString& Identifier() const;
const BString& Vendor() const;
const BString& Summary() const;
uint8 Priority() const;
@@ -44,7 +44,7 @@ public:
void SetName(const BString& name);
void SetBaseURL(const BString& url);
void SetURL(const BString& url);
void SetIdentifier(const BString& url);
void SetVendor(const BString& vendor);
void SetSummary(const BString& summary);
void SetPriority(uint8 priority);
@@ -61,6 +61,7 @@ public:
static const char* const kNameField;
static const char* const kURLField;
static const char* const kIdentifierField;
static const char* const kBaseURLField;
static const char* const kVendorField;
static const char* const kSummaryField;
@@ -79,9 +80,10 @@ private:
BString fName;
BString fBaseURL;
// This is the URL to a single mirror. This field is optional.
BString fURL;
// This is an identifier for the repository that applies
// across mirrors.
BString fIdentifier;
// This is an identifier in the form of an URI for the
// repository, that applies across mirrors. Good choices of
// URI schemes are tag: and uuid:, for example.
BString fVendor;
BString fSummary;
uint8 fPriority;