HaikuDepot / PackageKit: Repositories 'Identifier' URL

Repositories are identified with a 'url' in the
remote 'repo.info' file.  There is also a
'base url' which is the URL locally with which
the system is able to access the repository
data on.  There is some confusion between these
two terms in the source.  This change aims to
separate the two out and consistently name them.
The settings for the repository locally also was
not storing these values and that has been fixed.
Debug info about the repositories also did not
display the two urls consistently and will now
also do so.  Finally, HaikuDepot now correlates
locally configured repositories with the data in
HaikuDepotServer using the identifier URL; this
makes the use of mirrors with HaikuDepot possible.

Fixes #13888
Change-Id: I66dfe589b05c24e1ab123a6945352e0f24b60bf1
This commit is contained in:
Andrew Lindesay
2018-07-05 20:06:54 +00:00
committed by Kacper Kasper
parent a00c8c4491
commit 3b17d8dd7f
21 changed files with 314 additions and 84 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2011, Haiku, Inc.
* Copyright 2011-2018, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__REPOSITORY_CONFIG_H_
@@ -28,6 +28,7 @@ public:
const BString& Name() const;
const BString& BaseURL() const;
const BString& URL() const;
uint8 Priority() const;
bool IsUserSpecific() const;
@@ -37,6 +38,7 @@ public:
void SetName(const BString& name);
void SetBaseURL(const BString& url);
void SetURL(const BString& url);
void SetPriority(uint8 priority);
void SetIsUserSpecific(bool isUserSpecific);
@@ -48,6 +50,11 @@ private:
BString fName;
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.
uint8 fPriority;
bool fIsUserSpecific;
+11 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2011, Haiku, Inc.
* Copyright 2011-2018, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__REPOSITORY_INFO_H_
@@ -33,7 +33,8 @@ public:
status_t InitCheck() const;
const BString& Name() const;
const BString& OriginalBaseURL() const;
const BString& BaseURL() const;
const BString& URL() const;
const BString& Vendor() const;
const BString& Summary() const;
uint8 Priority() const;
@@ -42,7 +43,8 @@ public:
const BStringList& LicenseTexts() const;
void SetName(const BString& name);
void SetOriginalBaseURL(const BString& url);
void SetBaseURL(const BString& url);
void SetURL(const BString& url);
void SetVendor(const BString& vendor);
void SetSummary(const BString& summary);
void SetPriority(uint8 priority);
@@ -59,6 +61,7 @@ public:
static const char* const kNameField;
static const char* const kURLField;
static const char* const kBaseURLField;
static const char* const kVendorField;
static const char* const kSummaryField;
static const char* const kPriorityField;
@@ -74,7 +77,11 @@ private:
status_t fInitStatus;
BString fName;
BString fOriginalBaseURL;
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 fVendor;
BString fSummary;
uint8 fPriority;