/
ssurepomanager.h
79 lines (71 loc) · 2.31 KB
/
ssurepomanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* @file ssurepomanager.h
* @copyright 2013 Jolla Ltd.
* @author Bernd Wachter <bwachter@lart.info>
* @date 2013
*/
#ifndef _SSUREPOMANAGER_H
#define _SSUREPOMANAGER_H
#include <QObject>
#include <QHash>
#include "ssu.h"
class SsuDeviceInfo;
class SsuRepoManager: public QObject {
Q_OBJECT
public:
SsuRepoManager();
/**
* Add a repository. Note: Repositories ending with -debuginfo receive special
* treatment. They'll get saved with the full name to make zypper and the user
* happy, but internally the -debuginfo will be stripped, and the debugSplit
* parameter set to debug instead.
*/
void add(QString repo, QString repoUrl="");
/**
* Return the path to the CA certificate to be used for the given domain,
* or default domain, if omitted
*/
static QString caCertificatePath(QString domain="");
/**
* Disable a repository
*/
void disable(QString repo);
/**
* Enable a repository, given it's not disabled by board configuration
*/
void enable(QString repo);
/**
* Remove a repository
*/
void remove(QString repo);
/**
* Collect the list of repositories from different submodules
*/
QStringList repos(bool rnd, int filter=Ssu::NoFilter);
/**
* Collect the list of repositories from different submodules.
* This form takes a reference to a custom device info instance
* to allow overrides.
*/
QStringList repos(bool rnd, SsuDeviceInfo &deviceInfo, int filter=Ssu::NoFilter);
/**
* Resolve repository specific variables, and store them in storageHash. Does
* not include adaptation specific variables, see SsuDeviceInfo::adaptationVariables
*
* Returns a list of sections in the configuration file that might contain repository
* URLs
*/
QStringList repoVariables(QHash<QString, QString> *storageHash, bool rnd=false);
/**
* Update the repository files on disk
*/
void update();
/**
* Resolve a repository url
* @return the repository URL on success, an empty string on error
*/
QString url(QString repoName, bool rndRepo=false,
QHash<QString, QString> repoParameters=QHash<QString, QString>(),
QHash<QString, QString> parametersOverride=QHash<QString, QString>());
};
#endif