src/_pakfire/_pakfiremodule.c \
src/_pakfire/archive.c \
src/_pakfire/archive.h \
- src/_pakfire/capabilities.c \
- src/_pakfire/capabilities.h \
src/_pakfire/constants.h \
src/_pakfire/errors.h \
src/_pakfire/key.c \
_pakfire_la_CFLAGS = \
$(AM_CFLAGS) \
$(PYTHON_DEVEL_CFLAGS) \
- $(CAP_CFLAGS) \
-Wno-cast-function-type
_pakfire_la_LDFLAGS = \
_pakfire_la_LIBADD = \
$(PYTHON_DEVEL_LIBS) \
- $(PAKFIRE_LIBS) \
- $(CAP_LIBS)
+ $(PAKFIRE_LIBS)
# ------------------------------------------------------------------------------
DL_LIBS="$LIBS"
AC_SUBST(DL_LIBS)
-# libcap
-AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
-
-LIBS=
-AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
-CAP_LIBS="$LIBS"
-AC_SUBST(CAP_LIBS)
-
# libsolv
AC_CHECK_HEADERS([solv/solvversion.h], [], [AC_MSG_ERROR([*** libsolv headers not found])])
#include <pakfire/util.h>
#include "archive.h"
-#include "capabilities.h"
#include "constants.h"
#include "errors.h"
#include "key.h"
static PyMethodDef pakfireModuleMethods[] = {
{"performance_index", (PyCFunction)performance_index, METH_VARARGS, NULL},
- {"get_capabilities", (PyCFunction)get_capabilities, METH_VARARGS, NULL},
{"native_arch", (PyCFunction)_pakfire_native_arch, METH_NOARGS, NULL },
{"arch_supported_by_host", (PyCFunction)_pakfire_arch_supported_by_host, METH_VARARGS, NULL },
{"mount", (PyCFunction)_pakfire_mount, METH_VARARGS|METH_KEYWORDS, NULL },
+++ /dev/null
-/*#############################################################################
-# #
-# Pakfire - The IPFire package management system #
-# Copyright (C) 2011 Pakfire development team #
-# #
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation, either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-# #
-#############################################################################*/
-
-#include <Python.h>
-
-#include <errno.h>
-#include <sys/capability.h>
-
-#include "constants.h"
-
-PyObject *
-get_capabilities(PyObject *self, PyObject *args) {
- const char *filename;
- cap_t cap_d;
- char exception[STRING_SIZE];
-
- if (!PyArg_ParseTuple(args, "s", &filename)) {
- /* XXX raise exception */
- return NULL;
- }
-
- cap_d = cap_get_file(filename);
- if (cap_d == NULL) {
- if (errno == EOPNOTSUPP) {
- /* Return nothing, if the operation is not supported. */
- Py_RETURN_NONE;
- } else if (errno != ENODATA) {
- snprintf(exception, STRING_SIZE - 1, "Failed to get capabilities of file %s (%s).",
- filename, strerror(errno));
- PyErr_SetString(PyExc_RuntimeError, exception);
- return NULL;
- }
- Py_RETURN_NONE;
- }
-
- char *result = cap_to_text(cap_d, NULL);
- cap_free(cap_d);
-
- if (!result) {
- snprintf(exception, STRING_SIZE - 1, "Failed to get capabilities of human readable format at %s (%s).",
- filename, strerror(errno));
- PyErr_SetString(PyExc_RuntimeError, exception);
- return NULL;
- }
-
- // Remove leading two characters '= '.
- int i;
- for (i = 0; i < 2; i++) {
- result++;
- }
-
- PyObject * ret = Py_BuildValue("s", result);
- cap_free(result);
-
- return ret;
-}
+++ /dev/null
-/*#############################################################################
-# #
-# Pakfire - The IPFire package management system #
-# Copyright (C) 2011 Pakfire development team #
-# #
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation, either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-# #
-#############################################################################*/
-
-#ifndef PYTHON_PAKFIRE_CAPS_H
-#define PYTHON_PAKFIRE_CAPS_H
-
-#include <Python.h>
-
-extern PyObject *get_capabilities(PyObject *self, PyObject *args);
-
-#endif /* PYTHON_PAKFIRE_CAPS_H */
if tarinfo.isreg():
attrs = []
- # Save capabilities.
- caps = util.get_capabilities(name)
- if caps:
- log.debug("Saving capabilities for %s: %s" % (name, caps))
- tarinfo.pax_headers["PAKFIRE.capabilities"] = caps
-
# Append the tar header and data to the archive.
f = tarfile.bltn_open(name, "rb")
self.addfile(tarinfo, f)
from .constants import *
from .i18n import _
-# Import binary version of capability functions
-from ._pakfire import get_capabilities
-
def cli_is_interactive():
"""
Say weather a shell is interactive or not.