summaryrefslogtreecommitdiffstats
path: root/libmount/python
Commit message (Collapse)AuthorAgeFilesLines
* docs: fix typos [codespell]Sami Kerola2019-02-181-1/+1
| | | | | Reference: https://github.com/codespell-project/codespell Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: add -Wno-cast-function-type for pythonKarel Zak2018-07-181-1/+1
| | | | | | | | | | | | | | | | | libmount/python/pylibmount.c:158:19: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type] This is generic problem in all Python C code and gcc v8. The another possible (and probably more correct) way is to add unused argument to all API functions. Unfortunately, this solution is pretty invasive. The question is if gcc is not too paranoid in this case. For more details see https://bugs.python.org/issue33012. It seems Python guys also prefer CFLAGS modification for now. Signed-off-by: Karel Zak <kzak@redhat.com>
* * break up large strings for PySys_WriteStdout()Frank Schaefer2018-07-111-13/+43
|
* libmount: fix Python get_propagationGiuseppe Scrivano2017-09-211-8/+5Star
| | | | | | | | The current implementation would return always 0, as it is the return code of mnt_fs_get_propagation. Change the implementation to raise an exception on an error and return the propagation flags otherwise. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* pylibmount: NULL terminate kwlist in Context_initZac Medico2017-06-081-1/+1
| | | | Fixes a segfault observed with python3.6.
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-204-70/+70
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: don't clean *.img filesRuediger Meier2016-12-091-2/+0Star
| | | | | | | | Don't know why this was added in d78df0ac but it can't be right that libmount/python removes these files in the toplevel builddir. Moreover I've never seen such *.img files appearing during build at all. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: Fix various typosSebastian Rasmussen2016-05-314-11/+11
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* pylibmount: include c.hKarel Zak2016-04-181-0/+1
| | | | | | | ... for sys/sysmacros.h and major() and minor() macros. Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: pylibmount, mount context is Linux onlyRuediger Meier2016-03-213-2/+10
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Revert "include sysmacros.h where used"Karel Zak2016-03-081-1/+0Star
| | | | This reverts commit 46a40c018438b7b2b25083a5e5a4a21055a0c1e9.
* include sysmacros.h where usedMike Frysinger2016-03-081-0/+1
| | | | | | | | BSD/Linux systems stick major/minor/makedev in sysmacros.h. Newer Linux libraries have been moving away from including sysmacros.h implicitly via sys/types.h, so include it directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Revert "build-sys: Order pylibmount after usrlib on install"Filipe Brandenburger2016-02-051-12/+2Star
| | | | This reverts commit e61f406913fb9356aed013da7ece34e73929cff6.
* build-sys: Order pylibmount after usrlib on installFilipe Brandenburger2016-01-261-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a failure of `make install DESTDIR=...` when trying to relink pylibmount against libmount.la. libtool will look for libmount.so under ${DESTDIR}/${libdir}, but if it is not yet present, it will assume it is a system installed library and use -lmount instead. This makes the install order significant. Automake lists the install entries in alphabetical order, and as install-pylibmountexecLTLIBRARIES < install-usrlib_execLTLIBRARIES, make will try to install pylibmount.so before libmount.so is present in the DESTDIR, which will then cause libtool to fallback to -lmount when relinking. This causes the error below: libtool: install: warning: relinking `pylibmount.la' libtool: install: (... libtool --mode=relink gcc -o pylibmount.la \ -rpath /usr/lib/python2.7/dist-packages/libmount \ libmount/python/*.lo libmount.la ... -lpython2.7 \ -inst-prefix-dir /path/to/destdir) /usr/bin/ld: cannot find -lmount collect2: error: ld returned 1 exit status libtool: install: error: relink `pylibmount.la' ... make[3]: *** [install-pylibmountexecLTLIBRARIES] Error 1 Work around this issue by using a zz_ prefix for the pylibmount exec dir, in order to install it last. This does not work if parallel make is used for the install step, but that should be a minor issue (parallel install is probably not that useful for util-linux, which is not that large a package to actually benefit from it.) The proper fix should be to introduce a make dependency of target install-pylibmountexecLTLIBRARIES on target install-usrlib_execLTLIBRARIES, but unfortunately there is no good way to accomplish that in automake without overriding it completely. This issue seems to be previously encountered in automake context, since automake includes a hack to insert such a dependency rule to install all libLTLIBRARIES before attempting to install binPROGRAMS, initially introduced in the commit below: http://git.savannah.gnu.org/cgit/automake.git/commit/?id=bd4a1d5ad1a72fa780a8b7fd6c365a5dad2e6220 Also, a related bug from Ubuntu tracker: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1442076 Tested that `make install` starts working again after this commit, even when libmount-dev is not installed on the system. Also confirmed that `make distcheck` is now functional. Confirmed that both __init__.py and the .so library are still installed in the Python directory. Tested that it still works without python-devel installed, also inspected Makefile.in which looks correct. Tested that `make install pylibmountexecdir=...` still works to override destination directory at `make install` time. Signed-off-by: Filipe Brandenburger <filbranden@google.com>
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-061-2/+2
| | | | | | | | Sometimes we use "behaviour" and "behavior" in the same text, let's use "behavior" only everywhere. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix python tests for dist and out-of-tree buildsRuediger Meier2014-06-041-0/+4
| | | | | | | | | - add python helper scripts to the dist - helper scripts are always in srcdir - python libs are in builddir - abort tests if helpers are missing Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: use automake's PYTHON primary for __init__.pyRuediger Meier2014-06-031-3/+1Star
| | | | | | | | | | Actually the initial reason for this commit was to remove execute permission from installed __init__.py. Now after discovering automake's _PYTHON suffix we slightly cleanup Makemodule.am and we will install byte compiled .pyc and .pyo files. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: libmount/python/__init__.py is always a dist fileRuediger Meier2014-03-131-2/+1Star
| | | | | | | "make dist" and "make distcheck" should work after a bare ./configure to give us a full featured tar ball. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* pylibmount: import directly from pylibmount in testsKarel Zak2014-01-143-3/+9
| | | | | | | This change does not have any impact to in a standard way installed libmount impact. It's simplification for in-tree tests. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove unncessary subdirectoryKarel Zak2014-01-142-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: correctly import from pylibmount.soDave Reisner2013-12-021-1/+1
| | | | | | | | | | | | | Without this, python is unable to find the module: $ python -c 'import libmount' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.3/site-packages/libmount/__init__.py", line 1, in <module> from pylibmount import * ImportError: No module named 'pylibmount' Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola2013-10-082-2/+4
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pylibmount: check for mnt_fs_get_tag() return value [coverity scan]Karel Zak2013-10-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: make tab parsers more robust [coverity scan]Karel Zak2013-10-011-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: one install dir for all pylibmount stuffKarel Zak2013-09-271-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add pylibmount __init__.py EXTRA_DISTKarel Zak2013-09-261-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: install to the correct python dirsKarel Zak2013-09-261-1/+3
| | | | | | | It seems we have to call AM_PATH_PYTHON() monster to get pyexec (shared libs) and python (scripts) directories. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: rewrite to be py2/py3 universalOndrej Oprala2013-09-208-116/+203
| | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: support --with-python[={2,3}]Karel Zak2013-09-201-2/+1Star
| | | | | | | | | | | | | | * we use pkg-config to get CGLAGS and LIBS, use package specific config (e.g. python-config) is non-sense. * default is to follow distribution and use pkg-config module name "python". This is probably symlink to python2.pc or python3.pc. * --with-python=2 forces to pkg-module "python2 >= 2" * --with-python=3 forces to pkg-module "python3 >= 3" Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: improve helps strings formattingKarel Zak2013-08-221-218/+214Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: add debug messagesKarel Zak2013-08-225-6/+114
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: use libmount reference countingKarel Zak2013-08-225-26/+33
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove Context_get_table()Karel Zak2013-08-211-29/+0Star
| | | | | | It's too problematic and too low-level to support it Py binding. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: cleanup cxt usageKarel Zak2013-08-212-73/+15Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove unnecessary codeKarel Zak2013-08-201-1/+0Star
| | | | | | It's enough to call mnt_free_fs() to remove fs from the table. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: coding style changes, don't touch Context() statusKarel Zak2013-08-202-54/+50Star
| | | | | | | It's better to follow libmnt_context status than allow to play any nasty games with this important variables in Python. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: use only public libmount API in tab.cKarel Zak2013-08-201-34/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: cleanup *_HELP strings formattingKarel Zak2013-08-201-136/+144
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: use mnt_fs_set_userdata() rather than ->userdataKarel Zak2013-08-201-12/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: fs.c - cleanup, remove libmount private stuffKarel Zak2013-08-201-81/+97
| | | | | | | | * remove unnecessary comments * cleanup up strings format * remove direct access to private libmount stuff Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove bindsrc from fs APIKarel Zak2013-08-201-41/+13Star
| | | | | | It's unnecessary and very low-level. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: cleanup object namesKarel Zak2013-08-196-313/+315
| | | | | | | Cxt -> Context Tab -> Table Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: coding style changes in tab.cKarel Zak2013-08-191-22/+53
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: coding style changes in fs.cKarel Zak2013-08-191-57/+72
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: coding style changes in context.cKarel Zak2013-08-191-120/+201
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: install pylibmount intoKarel Zak2013-08-191-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: add regression testsOndrej Oprala2013-08-194-0/+394
| | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: add __init__.pyOndrej Oprala2013-08-191-0/+2
| | | | | Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* pylibmount: basic codeOndrej Oprala2013-08-196-2/+3045
| | | | | | | | [kzak@redhat.com: - split to more patches - split to more .c files] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add pylibmountKarel Zak2013-08-191-0/+21
Signed-off-by: Karel Zak <kzak@redhat.com>