summaryrefslogtreecommitdiffstats
path: root/build_tools/bin/check_repo/alpm.c
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-01-03 21:01:10 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-01-03 21:01:10 (GMT)
commit2c504801a18ee36027ea994ad146cb4b64b63b5c (patch)
tree2005eb9e31cffe318307bad498a64b5ff25bb109 /build_tools/bin/check_repo/alpm.c
parente87d0c681b1ecebc9a641a9eeb059c8ae85c13f3 (diff)
downloadlinhes_dev-2c504801a18ee36027ea994ad146cb4b64b63b5c.zip
check_repo:
various scripts to cleanup the repo. repo_check: only reports on problems repo-cleanup.sh will removed stray or duplicate packages in the pkg repo dir. repo-cleanup.sh does not change anything pkgbuild related
Diffstat (limited to 'build_tools/bin/check_repo/alpm.c')
-rw-r--r--build_tools/bin/check_repo/alpm.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/build_tools/bin/check_repo/alpm.c b/build_tools/bin/check_repo/alpm.c
new file mode 100644
index 0000000..0b7cd2c
--- /dev/null
+++ b/build_tools/bin/check_repo/alpm.c
@@ -0,0 +1,40 @@
+#include <Python.h>
+#include <alpm.h>
+
+static PyObject *
+alpm_vercmp(PyObject *self, PyObject *args)
+{
+ const char *v1, *v2;
+ int ret;
+
+ if (!PyArg_ParseTuple(args, "ss", &v1, &v2))
+ return NULL;
+ ret = alpm_pkg_vercmp(v1, v2);
+ return Py_BuildValue("i", ret);
+}
+
+static PyMethodDef AlpmMethods[] = {
+ {"vercmp", alpm_vercmp, METH_VARARGS,
+ "Execute vercmp."},
+ {NULL, NULL, 0, NULL} /* Sentinel */
+};
+
+PyMODINIT_FUNC
+initalpm(void)
+{
+ (void) Py_InitModule("alpm", AlpmMethods);
+}
+
+int
+main(int argc, char *argv[])
+{
+ /* Pass argv[0] to the Python interpreter */
+ Py_SetProgramName(argv[0]);
+
+ /* Initialize the Python interpreter. Required. */
+ Py_Initialize();
+
+ /* Add a static module */
+ initalpm();
+ return 0;
+}