]> git.ipfire.org Git - people/ms/pakfire.git/blame - src/libpakfire/include/pakfire/repo.h
pool: Mark repos/pool as dirty and create indices when needed
[people/ms/pakfire.git] / src / libpakfire / include / pakfire / repo.h
CommitLineData
221cc3ce
MT
1/*#############################################################################
2# #
3# Pakfire - The IPFire package management system #
4# Copyright (C) 2013 Pakfire development team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19#############################################################################*/
20
21#ifndef PAKFIRE_REPO_H
22#define PAKFIRE_REPO_H
23
16d98842 24#include <stdio.h>
5ade5e8a
MT
25#include <time.h>
26#include <unistd.h>
27
4651122b
MT
28struct pakfire_repo;
29
7c111d55 30#include <pakfire/pakfire.h>
221cc3ce 31
14fe6b07 32int pakfire_repo_create(struct pakfire_repo** repo, struct pakfire* pakfire, const char* name);
3ff6aee6 33
4651122b
MT
34struct pakfire_repo* pakfire_repo_ref(struct pakfire_repo* repo);
35struct pakfire_repo* pakfire_repo_unref(struct pakfire_repo* repo);
ac4c607b 36struct pakfire* pakfire_repo_get_pakfire(struct pakfire_repo* repo);
221cc3ce 37
4651122b 38int pakfire_repo_clear(struct pakfire_repo* repo);
7fe22178 39
4651122b
MT
40int pakfire_repo_identical(struct pakfire_repo* repo1, struct pakfire_repo* repo2);
41int pakfire_repo_cmp(struct pakfire_repo* repo1, struct pakfire_repo* repo2);
42int pakfire_repo_count(struct pakfire_repo* repo);
221cc3ce 43
4651122b 44const char* pakfire_repo_get_name(struct pakfire_repo* repo);
221cc3ce 45
4651122b
MT
46const char* pakfire_repo_get_description(struct pakfire_repo* repo);
47int pakfire_repo_set_description(struct pakfire_repo* repo, const char* description);
36641775 48
4651122b
MT
49int pakfire_repo_get_enabled(struct pakfire_repo* repo);
50void pakfire_repo_set_enabled(struct pakfire_repo* repo, int enabled);
221cc3ce 51
4651122b
MT
52int pakfire_repo_get_priority(struct pakfire_repo* repo);
53void pakfire_repo_set_priority(struct pakfire_repo* repo, int priority);
221cc3ce 54
4651122b
MT
55const char* pakfire_repo_get_baseurl(struct pakfire_repo* repo);
56int pakfire_repo_set_baseurl(struct pakfire_repo* repo, const char* baseurl);
7b576a96 57
4651122b
MT
58const char* pakfire_repo_get_keyfile(struct pakfire_repo* repo);
59int pakfire_repo_set_keyfile(struct pakfire_repo* repo, const char* keyfile);
1415a20b 60
4651122b
MT
61const char* pakfire_repo_get_mirrorlist_url(struct pakfire_repo* repo);
62int pakfire_repo_set_mirrorlist_url(struct pakfire_repo* repo, const char* url);
e6fb5c61 63
4651122b 64struct pakfire_mirrorlist* pakfire_repo_get_mirrors(struct pakfire_repo* repo);
751ed354 65
4651122b 66char* pakfire_repo_get_config(struct pakfire_repo* repo);
8e163f76 67
4651122b 68int pakfire_repo_is_installed_repo(struct pakfire_repo* repo);
221cc3ce 69
7c0facac
MT
70int pakfire_repo_read_solv(struct pakfire_repo* repo, FILE *f, int flags);
71int pakfire_repo_write_solv(struct pakfire_repo* repo, FILE *f, int flags);
221cc3ce 72
5ade5e8a 73// Cache
221cc3ce 74
397371db
MT
75enum pakfire_repo_clean_flags {
76 PAKFIRE_REPO_CLEAN_FLAGS_NONE = 0,
77 PAKFIRE_REPO_CLEAN_FLAGS_DESTROY = (1 << 0),
78};
79
4651122b 80int pakfire_repo_clean(struct pakfire_repo* repo, int flags);
b4ac59c6 81
be11aa6e
MT
82// Scan
83
4651122b 84int pakfire_repo_scan(struct pakfire_repo* repo, int flags);
be11aa6e 85
bc97792b
MT
86// Refresh
87
4651122b 88int pakfire_repo_refresh(struct pakfire_repo* repo, int force);
bc97792b 89
c54d9960
MT
90// Compose
91
0c3dce19
MT
92int pakfire_repo_compose(struct pakfire* pakfire, const char* path, int flags,
93 const char** files);
c54d9960 94
221cc3ce
MT
95#ifdef PAKFIRE_PRIVATE
96
3ff6aee6 97#include <solv/repo.h>
221cc3ce 98
7c111d55 99#include <pakfire/archive.h>
5db84e92 100#include <pakfire/config.h>
751ed354 101#include <pakfire/downloader.h>
7c111d55 102#include <pakfire/package.h>
751ed354 103
6ebd55e2
MT
104#define PAKFIRE_REPO_COMMANDLINE "@commandline"
105#define PAKFIRE_REPO_DUMMY "@dummy"
7ccac5e5
MT
106#define PAKFIRE_REPO_LOCAL "local"
107#define PAKFIRE_REPO_LOCAL_PATH "file://" PAKFIRE_PRIVATE_DIR "/local/%{distro}/%{version}"
108#define PAKFIRE_REPO_LOCAL_PRIORITY 1000
6ebd55e2 109#define PAKFIRE_REPO_SYSTEM "@system"
7ccac5e5 110
866aa605 111int pakfire_repo_name_equals(struct pakfire_repo* repo, const char* name);
a4292569 112
ac4c607b 113int pakfire_repo_import(struct pakfire* pakfire, struct pakfire_config* config);
4651122b 114const char* pakfire_repo_get_path(struct pakfire_repo* repo);
5db84e92 115
9eba3d65
MT
116void pakfire_repo_has_changed(struct pakfire_repo* repo);
117int pakfire_repo_internalize(struct pakfire_repo* repo, int flags);
4651122b 118Id pakfire_repo_add_solvable(struct pakfire_repo* repo);
7c111d55
MT
119int pakfire_repo_add_archive(struct pakfire_repo* repo,
120 struct pakfire_archive* archive, struct pakfire_package** package);
e9d9eadc 121
ac4c607b
MT
122struct pakfire_repo* pakfire_repo_create_from_repo(struct pakfire* pakfire, Repo* r);
123void pakfire_repo_free_all(struct pakfire* pakfire);
221cc3ce 124
4651122b
MT
125Repo* pakfire_repo_get_repo(struct pakfire_repo* repo);
126Repodata* pakfire_repo_get_repodata(struct pakfire_repo* repo);
221cc3ce 127
4651122b 128struct pakfire_mirrorlist* pakfire_repo_get_mirrorlist(struct pakfire_repo* repo);
4a81ff85 129
221cc3ce
MT
130#endif
131
132#endif /* PAKFIRE_REPO_H */