014eed80e2
* Under the base URL there are supposed to be the repository files and a subdirectory "packages". * Fix the repository URL related confusion introduced earlier. The URL in the repository info (and thus in the repository file) is supposed to be the base URL for the repository. It is not a (potentially) different base URL for the package files. Package and repository files were supposed to live in the same directory. Now, by requiring the package files to live in a subdirectory -- which can also be a symlink -- we gain some flexibility. The URL in the repository config is usually the same as the in the repository info, unless it refers to a mirror site. This allows for mirrors to copy the original repository verbatim. * Remove the PackageURL rule and introduce a DownloadPackage rule instead. The URL for a package file cannot be computed in the jam parsing phase anymore, as it contains the hash value of the package list. * BRepositoryConfig: Add PackagesURL() for convenience.
62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
/*
|
|
* Copyright 2011, 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;
|
|
uint8 Priority() const;
|
|
bool IsUserSpecific() const;
|
|
|
|
const BEntry& Entry() const;
|
|
|
|
BString PackagesURL() const;
|
|
|
|
void SetName(const BString& name);
|
|
void SetBaseURL(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;
|
|
uint8 fPriority;
|
|
bool fIsUserSpecific;
|
|
|
|
BEntry fEntry;
|
|
};
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
#endif // _PACKAGE__REPOSITORY_CONFIG_H_
|