File: comps2solv.c

package info (click to toggle)
libsolv 0.7.35-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,804 kB
  • sloc: ansic: 73,004; python: 871; perl: 742; tcl: 730; ruby: 705; sh: 263; cpp: 204; makefile: 41
file content (40 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (4)
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
/*
 * Copyright (c) 2012, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

/*
 * comps2solv.c
 * 
 * parse Fedora Comps type xml and write out .solv file
 *
 * reads from stdin
 * writes to stdout
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "pool.h"
#include "repo.h"
#include "repo_comps.h"
#include "common_write.h"

int
main(int argc, char **argv)
{
  Pool *pool = pool_create();
  Repo *repo = repo_create(pool, "<stdin>");
  if (repo_add_comps(repo, stdin, 0))
    {
      fprintf(stderr, "comps2solv: %s\n", pool_errstr(pool));
      exit(1);
    }
  tool_write(repo, stdout);
  pool_free(pool);
  exit(0);
}