more work on package kit:
* rip BRepositoryHeader out of BRepositoryConfig and add support for it to BRepositoryCache * implement repository removal * some minor cleanups git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40290 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__DROP_REPOSITORY_REQUEST_H_
|
||||
#define _PACKAGE__DROP_REPOSITORY_REQUEST_H_
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <package/Context.h>
|
||||
#include <package/Request.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class DropRepositoryRequest : public BRequest {
|
||||
typedef BRequest inherited;
|
||||
|
||||
public:
|
||||
DropRepositoryRequest(const BContext& context,
|
||||
const BString& repositoryName);
|
||||
virtual ~DropRepositoryRequest();
|
||||
|
||||
virtual status_t CreateInitialJobs();
|
||||
|
||||
private:
|
||||
BString fRepositoryName;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__ADD_REPOSITORY_REQUEST_H_
|
||||
@@ -9,8 +9,7 @@
|
||||
#include <Entry.h>
|
||||
#include <String.h>
|
||||
|
||||
|
||||
class BEntry;
|
||||
#include <package/RepositoryHeader.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -28,7 +27,7 @@ public:
|
||||
status_t SetTo(const BEntry& entry);
|
||||
status_t InitCheck() const;
|
||||
|
||||
// const RepositoryHeader* Header() const;
|
||||
const BRepositoryHeader& Header() const;
|
||||
const BEntry& Entry() const;
|
||||
bool IsUserSpecific() const;
|
||||
|
||||
@@ -38,7 +37,7 @@ private:
|
||||
status_t fInitStatus;
|
||||
|
||||
BEntry fEntry;
|
||||
// RepositoryHeader* fHeader;
|
||||
BRepositoryHeader fHeader;
|
||||
bool fIsUserSpecific;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,62 +6,46 @@
|
||||
#define _PACKAGE__REPOSITORY_CONFIG_H_
|
||||
|
||||
|
||||
#include <Archivable.h>
|
||||
#include <Entry.h>
|
||||
#include <String.h>
|
||||
|
||||
|
||||
class BEntry;
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BRepositoryConfig : public BArchivable {
|
||||
typedef BArchivable inherited;
|
||||
|
||||
class BRepositoryConfig {
|
||||
public:
|
||||
BRepositoryConfig();
|
||||
BRepositoryConfig(const BString& name,
|
||||
const BString& url,
|
||||
uint8 priority = kDefaultPriority);
|
||||
const BString& url, uint8 priority);
|
||||
BRepositoryConfig(const BEntry& entry);
|
||||
BRepositoryConfig(BMessage* data);
|
||||
virtual ~BRepositoryConfig();
|
||||
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
|
||||
status_t StoreAsConfigFile(const BEntry& entry) const;
|
||||
status_t Store(const BEntry& entry) const;
|
||||
|
||||
status_t SetTo(const BEntry& entry);
|
||||
status_t SetTo(const BMessage* data);
|
||||
status_t InitCheck() const;
|
||||
|
||||
const BString& Name() const;
|
||||
const BString& URL() const;
|
||||
const BString& BaseURL() const;
|
||||
uint8 Priority() const;
|
||||
bool IsUserSpecific() const;
|
||||
|
||||
const BEntry& Entry() const;
|
||||
|
||||
void SetName(const BString& name);
|
||||
void SetURL(const BString& url);
|
||||
void SetBaseURL(const BString& url);
|
||||
void SetPriority(uint8 priority);
|
||||
void SetIsUserSpecific(bool isUserSpecific);
|
||||
|
||||
public:
|
||||
static BRepositoryConfig* Instantiate(BMessage* data);
|
||||
|
||||
static const uint8 kDefaultPriority;
|
||||
static const char* kNameField;
|
||||
static const char* kURLField;
|
||||
static const char* kPriorityField;
|
||||
static const uint8 kUnsetPriority = 0;
|
||||
|
||||
private:
|
||||
status_t fInitStatus;
|
||||
|
||||
BString fName;
|
||||
BString fURL;
|
||||
BString fBaseURL;
|
||||
uint8 fPriority;
|
||||
bool fIsUserSpecific;
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__REPOSITORY_HEADER_H_
|
||||
#define _PACKAGE__REPOSITORY_HEADER_H_
|
||||
|
||||
|
||||
#include <Archivable.h>
|
||||
#include <String.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BRepositoryHeader : public BArchivable {
|
||||
typedef BArchivable inherited;
|
||||
|
||||
public:
|
||||
BRepositoryHeader();
|
||||
BRepositoryHeader(BMessage* data);
|
||||
virtual ~BRepositoryHeader();
|
||||
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
|
||||
status_t SetTo(const BMessage* data);
|
||||
status_t InitCheck() const;
|
||||
|
||||
const BString& Name() const;
|
||||
const BString& OriginalBaseURL() const;
|
||||
const BString& Vendor() const;
|
||||
const BString& ShortDescription() const;
|
||||
const BString& LongDescription() const;
|
||||
uint8 Priority() const;
|
||||
|
||||
void SetName(const BString& name);
|
||||
void SetOriginalBaseURL(const BString& url);
|
||||
void SetVendor(const BString& vendor);
|
||||
void SetShortDescription(const BString& description);
|
||||
void SetLongDescription(const BString& description);
|
||||
void SetPriority(uint8 priority);
|
||||
|
||||
public:
|
||||
static BRepositoryHeader* Instantiate(BMessage* data);
|
||||
|
||||
static const uint8 kDefaultPriority;
|
||||
|
||||
static const char* kNameField;
|
||||
static const char* kURLField;
|
||||
static const char* kVendorField;
|
||||
static const char* kShortDescriptionField;
|
||||
static const char* kLongDescriptionField;
|
||||
static const char* kPriorityField;
|
||||
|
||||
private:
|
||||
status_t fInitStatus;
|
||||
|
||||
BString fName;
|
||||
BString fOriginalBaseURL;
|
||||
BString fVendor;
|
||||
BString fShortDescription;
|
||||
BString fLongDescription;
|
||||
uint8 fPriority;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__REPOSITORY_HEADER_H_
|
||||
@@ -19,7 +19,7 @@ namespace BPrivate {
|
||||
|
||||
|
||||
class ActivateRepositoryCacheJob : public BJob {
|
||||
typedef BJob inherited;
|
||||
typedef BJob inherited;
|
||||
|
||||
public:
|
||||
ActivateRepositoryCacheJob(
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace BPrivate {
|
||||
|
||||
|
||||
class ActivateRepositoryConfigJob : public BJob {
|
||||
typedef BJob inherited;
|
||||
typedef BJob inherited;
|
||||
|
||||
public:
|
||||
ActivateRepositoryConfigJob(
|
||||
const BContext& context,
|
||||
const BString& title,
|
||||
const BEntry& archivedRepoConfigEntry,
|
||||
const BEntry& archivedRepoHeaderEntry,
|
||||
const BString& repositoryBaseURL,
|
||||
const BDirectory& targetDirectory);
|
||||
virtual ~ActivateRepositoryConfigJob();
|
||||
@@ -37,7 +37,7 @@ protected:
|
||||
virtual void Cleanup(status_t jobResult);
|
||||
|
||||
private:
|
||||
BEntry fArchivedRepoConfigEntry;
|
||||
BEntry fArchivedRepoHeaderEntry;
|
||||
BString fRepositoryBaseURL;
|
||||
BDirectory fTargetDirectory;
|
||||
BEntry fTargetEntry;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace BPrivate {
|
||||
|
||||
|
||||
class FetchFileJob : public BJob {
|
||||
typedef BJob inherited;
|
||||
typedef BJob inherited;
|
||||
|
||||
public:
|
||||
FetchFileJob(const BContext& context,
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2011, Oliver Tappe <[email protected]>
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__PRIVATE__REMOVE_REPOSITORY_JOB_H_
|
||||
#define _PACKAGE__PRIVATE__REMOVE_REPOSITORY_JOB_H_
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <package/Job.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class RemoveRepositoryJob : public BJob {
|
||||
typedef BJob inherited;
|
||||
|
||||
public:
|
||||
RemoveRepositoryJob(
|
||||
const BContext& context,
|
||||
const BString& title,
|
||||
const BString& repositoryName);
|
||||
virtual ~RemoveRepositoryJob();
|
||||
|
||||
protected:
|
||||
virtual status_t Execute();
|
||||
|
||||
private:
|
||||
BString fRepositoryName;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__PRIVATE__REMOVE_REPOSITORY_JOB_H_
|
||||
@@ -20,7 +20,7 @@ namespace BPrivate {
|
||||
|
||||
|
||||
class ValidateChecksumJob : public BJob {
|
||||
typedef BJob inherited;
|
||||
typedef BJob inherited;
|
||||
|
||||
public:
|
||||
ValidateChecksumJob(
|
||||
|
||||
Reference in New Issue
Block a user