haiku/headers/os/package/RepositoryConfig.h
Andrew Lindesay 3b17d8dd7f 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
2018-07-05 20:06:54 +00:00

69 lines
1.5 KiB
C++

/*
* Copyright 2011-2018, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__REPOSITORY_CONFIG_H_
#define _PACKAGE__REPOSITORY_CONFIG_H_
#include <Entry.h>
#include <String.h>
namespace BPackageKit {
class BRepositoryConfig {
public:
BRepositoryConfig();
BRepositoryConfig(const BString& name,
const BString& url, uint8 priority);
BRepositoryConfig(const BEntry& entry);
virtual ~BRepositoryConfig();
status_t Store(const BEntry& entry) const;
status_t SetTo(const BEntry& entry);
status_t InitCheck() const;
const BString& Name() const;
const BString& BaseURL() const;
const BString& URL() const;
uint8 Priority() const;
bool IsUserSpecific() const;
const BEntry& Entry() const;
BString PackagesURL() const;
void SetName(const BString& name);
void SetBaseURL(const BString& url);
void SetURL(const BString& url);
void SetPriority(uint8 priority);
void SetIsUserSpecific(bool isUserSpecific);
public:
static const uint8 kUnsetPriority = 0;
private:
status_t fInitStatus;
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;
BEntry fEntry;
};
} // namespace BPackageKit
#endif // _PACKAGE__REPOSITORY_CONFIG_H_