pkg_repos.3 3.88 KB
Newer Older
Matthew Seaman's avatar
Matthew Seaman committed
1
.Dd February 8, 2015
2
3
4
.Dt PKG_REPOS 3
.Os
.Sh NAME
5
6
7
8
.Nm pkg_repos , pkg_repos_total_count , pkg_repos_activated_count ,
.Nm pkg_repo_url , pkg_repo_ident , pkg_repo_name , pkg_repo_ident_from_name ,
.Nm pkg_repo_key , pkg_repo_fingerprints ,
.Nm pkg_repo_signature_type , pkg_repo_mirror_type , pkg_repo_enabled ,
Matthew Seaman's avatar
Matthew Seaman committed
9
.Nm pkg_repo_priority , pkg_repo_find_ident , pkg_repo_find_name
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
.Nd manipulate repositories
.Sh LIBRARY
.Lb libpkg
.Sh SYNOPSIS
.In pkg.h
.Ft int
.Fn pkg_repos "struct pkg_repo **r"
.Ft int
.Fn pkg_repos_total_count "void"
.Ft int
.Fn pkg_repos_activated_count "void"
.Ft const char *
.Fn pkg_repos_url "struct pkg_repo *"
.Ft const char *
.Fn pkg_repo_ident "struct pkg_repo *"
.Ft const char *
.Fn pkg_repo_name "struct pkg_repo *"
.Ft const char *
.Fn pkg_repo_ident_from_name "const char *"
.Ft const char *
.Fn pkg_repo_key "struct pkg_repo *"
.Ft const char *
.Fn pkg_repo_fingerprints "struct pkg_repo *"
.Ft signature_t
.Fn pkg_repo_signature_type "struct pkg_repo *"
.Ft bool
.Fn pkg_repo_enabled "struct pkg_repo *"
Matthew Seaman's avatar
Matthew Seaman committed
37
38
.Ft unsigned int
.Fn pkg_repo_priority "struct pkg_repo *"
39
40
41
42
43
44
45
46
.Ft mirror_t
.Fn pkg_repo_mirror_type "struct pkg_repo *"
.Ft struct pkg_repo *
.Fn pkg_repo_find_ident "const char *ident";
.Ft struct pkg_repo *
.Fn pkg_repo_find_name "const char *name";
.Sh DESCRIPTION
.Fn pkg_repos
Mark Felder's avatar
Mark Felder committed
47
Takes the address of a pointer to the repository.
48
The pointer should be initialised to NULL before being passed to the
Mark Felder's avatar
Mark Felder committed
49
50
51
function, on each iteration the r will point to the new repository.
Returns EPKG_FATAL if an error occurred, otherwise return EPKG_OK until
the last repository is found in that case EPKG_END is returned.
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
.Pp
.Fn pkg_repos_total_count
returns the total number of defined repositories.
.Pp
.Fn pkg_repos_activated_count
returns the total number of
.Qq enabled
repositories.
.Pp
.Fn pkg_repo_url
takes a pointer to a repository as argument and returns the
.Qq url
defined for this repository.
.Pp
.Fn pkg_repo_ident
takes a pointer to a repository as argument and returns the internal
identification string of the repository.
.Pp
.Fn pkg_repo_name
takes a pointer to a repository as argument and returns the
.Qq name
of the repository.
.Pp
.Fn pkg_repo_key
takes a pointer to a repository as argument and returns the path to
Mark Felder's avatar
Mark Felder committed
77
78
the public key.
If the repository is not signed by a public key, NULL will be returned.
79
80
81
.Pp
.Fn pkg_repo_fingerprints
takes a pointer to a repository as argument and returns the path to
82
83
the fingerprints.
If the repository is not signed using the
84
85
86
87
88
89
90
91
.Qq FINGERPRINT
method, NULL will be returned.
.Pp
.Fn pkg_repo_signature_type
Take a pointer to a repository as argument and return the type of
signature it uses.
.Bl -tag -width SIG_FINGERPRINT
.It Cm SIG_NONE
Mark Felder's avatar
Mark Felder committed
92
The repository is not signed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.It Cm SIG_PUBKEY
The repository is signed using the PUBKEY method
.It Cm SIG_FINGERPRINT
The repository is signed using the FINGERPRINT method
.El
.Pp
.Fn pkg_repo_enabled
takes a pointer to a repository as argument and returns
.Cm true
if the repository is
.Qq enabled .
Otherwise, return
.Cm false .
.Pp
Matthew Seaman's avatar
Matthew Seaman committed
107
108
109
110
.Fn pkg_repo_priority
takes a pointer to a repository as argument and returns
the priority of the repository as an unsigned integer.
Packages ae chosed preferentially from the repository with the highest
111
priority value and which has that package available.
Matthew Seaman's avatar
Matthew Seaman committed
112
.Pp
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.Fn pkg_repo_mirror_type
takes a pointer to a repository as argument and returns the type of
mirroring it uses.
.Bl -tag -width NOMIRROR
.It Cm SRV
The repository is using SRV record query to get the mirrors.
.It Cm HTTP
The repository is using the HTTP query method to get the mirrors.
.It Cm NOMIRROR
The repository does not have any mirror.
.El
.Pp
.Fn pkg_repo_find_ident
Take an internal indentification string as argument and return a pointer to
127
128
a repository.
If no repository matches, NULL is returned.
129
130
131
132
.Pp
.Fn pkg_repo_find_name
Take a repository
.Qq name
133
134
as argument and return a pointer to a repository.
If no repository matches, NULL is returned.