summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-02-02 16:30:41 +0100
committerMichael Schroeder <mls@suse.de>2012-02-02 16:30:41 +0100
commit0589bfb58fca13311e4559bad8b0df1efbc9e3ed (patch)
tree2d32089cc30406d4cae73218049f963cbb16f2c7 /tools
parent857fe280393400d73dca3f7ca815a815ea9388e0 (diff)
downloadlibsolv-0589bfb58fca13311e4559bad8b0df1efbc9e3ed.tar.gz
libsolv-0589bfb58fca13311e4559bad8b0df1efbc9e3ed.tar.bz2
libsolv-0589bfb58fca13311e4559bad8b0df1efbc9e3ed.zip
- start support for Fedora comps format
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt7
-rw-r--r--tools/comps2solv.c38
2 files changed, 45 insertions, 0 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index e2d9a94..5afb5b2 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -55,6 +55,13 @@ TARGET_LINK_LIBRARIES (susetags2solv toolstuff libsolvext libsolv ${SYSTEM_LIBRA
SET (tools_list ${tools_list} susetags2solv)
ENDIF (ENABLE_SUSEREPO)
+IF (ENABLE_COMPS)
+ADD_EXECUTABLE (comps2solv comps2solv.c)
+TARGET_LINK_LIBRARIES (comps2solv toolstuff libsolvext libsolv ${SYSTEM_LIBRARIES})
+
+SET (tools_list ${tools_list} comps2solv)
+ENDIF (ENABLE_COMPS)
+
ADD_EXECUTABLE (installcheck installcheck.c)
TARGET_LINK_LIBRARIES (installcheck libsolvext libsolv ${SYSTEM_LIBRARIES})
diff --git a/tools/comps2solv.c b/tools/comps2solv.c
new file mode 100644
index 0000000..1e69e9b
--- /dev/null
+++ b/tools/comps2solv.c
@@ -0,0 +1,38 @@
+/*
+ * 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 <limits.h>
+#include <fcntl.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>");
+ repo_add_comps(repo, stdin, 0);
+ tool_write(repo, 0, 0);
+ pool_free(pool);
+ exit(0);
+}