blob: 5daaed88f2d52b38cb6b5fe129316d174af01438 (
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
|
/* $Id$ */
#include <stdint.h>
#ifdef HAVE_RPM_RPMLIB_H
#include <rpm/rpmlib.h>
#else
#include <rpm/rpmio.h>
#include <rpm/rpmtag.h>
#endif
#include <rpm/rpmmacro.h>
int main(int argc, char **argv)
{
rpmRC rc;
char *results;
if (argc != 3) {
fprintf(stdout, "Not enough arguments: %d\n", argc);
return 1;
}
if (rc = rpmReadConfigFiles(NULL, NULL)) {
fprintf(stderr, "Cannot load configuration\n");
return rc;
}
if (rc = rpmLoadMacroFile(rpmGlobalMacroContext, argv[1])) {
fprintf(stderr, "Cannot read %s\n", argv[1]);
return rc;
}
results = rpmExpand(argv[2], NULL);
fprintf(stdout, "%s\n", results);
return 0;
}
|