blob: d9fbbc8064fa942c524b85649173208bdc5cf88c (
plain)
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
|
#include <stdlib.h>
#include <stdio.h>
#include "portage.h"
int main(int argc, char *argv[])
{
argc = argc;
argv = argv;
int ret = 0;
portageInit();
PortageSettings *ps = portageSettingsCreate();
StringList *world = portageSettingsGetWorld(ps);
stringListPrint(world);
printf("\n");
stringListFree(world);
char *ak = portageSettingsAcceptKeywords(ps);
printf("ACCEPT_KEYWORDS=%s\n", ak);
free(ak);
char *pd = portageSettingsPortdir(ps);
printf("PORTDIR=%s\n", pd);
free(pd);
char *pdo = portageSettingsPortdirOverlay(ps);
printf("PORTDIR_OVERLAY=%s\n", pdo);
free(pdo);
StringList *useflags = portageSettingsSystemUseFlags(ps);
stringListPrint(useflags);
printf("\n");
stringListFree(useflags);
portageSettingsFree(ps);
char *bp = portageGetBestEbuild("kde-base/kdelibs");
printf("kdelibs best package = %s\n", bp);
char *oname = portageGetOverlay(bp);
printf("kdelibs overlay name = %s\n", oname);
free(oname);
free(bp);
StringList *resolved = portageGetResolvedPkgs();
stringListPrint(resolved);
printf("\n");
stringListFree(resolved);
portageFinalize();
return ret;
}
|