aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Replace linux_reflink extension moduleMike Gilbert2024-03-152-416/+0
| | | | | | | | | | Python 3.8 added support for copy_file_range in the os module, so we can just call that directly. Also, we can use the FICLONE ioctl for fast file clones on supported filesystems (btrfs). Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* Drop portage.util.libc extension moduleMike Gilbert2024-02-292-76/+0
| | | | | | | | | | This was originally added as a workaround for musl, where ctypes.util.find_library fails. Instead, we now try to load "libc.so" as a fallback and can just rely on ctypes to call tolower() and toupper(). Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* _reflink_linux_file_copy: initialize error to 0Mike Gilbert2023-08-021-0/+1
| | | | | | | | | | | | | | | Avoids a compiler warning: ``` ../src/portage_util_file_copy_reflink_linux.c: In function ‘_reflink_linux_file_copy’: ../src/portage_util_file_copy_reflink_linux.c:379:12: warning: ‘error’ may be used uninitialized [-Wmaybe-uninitialized] 379 | if (!error && ftruncate(fd_out, offset_out) < 0) | ^ ../src/portage_util_file_copy_reflink_linux.c:205:22: note: ‘error’ was declared here 205 | int eintr_retry, error, fd_in, fd_out, stat_in_acquired, stat_out_acquired; | ^~~~~ ``` Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* Migrate from setuptools to Meson and meson-pythonJames Le Cuirot2023-08-021-0/+50
| | | | | | | | | | | This makes Portage PEP 517 compliant. When building via meson-python, the man pages and logrotate config are no longer included as there seems little point. Bug: https://bugs.gentoo.org/910035 Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* src: fix comment whitespaceSam James2023-06-071-2/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* portage.util: Add C implementation of Whirlpool hashMichał Górny2022-12-291-0/+1141
| | | | | | | | | | | Add an extension module providing Whirlpool hash based on the reference C implementation. This is necessary since Python hashlib no longer provides Whirlpool by default with OpenSSL 3, and the Python implementation used by Portage is unusably slow. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/portage/pull/966 Signed-off-by: Sam James <sam@gentoo.org>
* src: use designated initialiser syntax for PyModuleDefSam James2022-11-232-23/+25
| | | | | | | It's far easier to keep track of the arguments this way. Closes: https://github.com/gentoo/portage/pull/940 Signed-off-by: Sam James <sam@gentoo.org>
* file_copy: handle zero bytes copied by copy_file_range (bug 828844)Zac Medico2021-12-111-3/+4
| | | | | | | | | When copy_file_range copied zero bytes, fall back to sendfile, so that we don't call copy_file_range in an infinite loop. Bug: https://bugs.gentoo.org/828844 Tested-by: John Helmert III <ajak@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Drop Python 2 compatibility in extension modulesMike Gilbert2020-12-242-18/+2
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* file_copy: handle EOPNOTSUPP from copy_file_range (bug 641088)Zac Medico2017-12-151-1/+1
| | | | | | NFS can set the errno to EOPNOTSUPP for copy_file_range. Bug: https://bugs.gentoo.org/641088
* file_copy: handle EOPNOTSUPP from lseek SEEK_DATA (bug 641088)Zac Medico2017-12-151-1/+1
| | | | | | NFS can set the errno to EOPNOTSUPP for lseek SEEK_DATA. Bug: https://bugs.gentoo.org/641088
* file_copy: use sendfile return value to measure bytes copied (bug 635126)Zac Medico2017-10-271-40/+59
| | | | | | | | | | | | | | | | | The sendfile *offset parameter refers to the input file offest, so it cannot be used in the same way as the copy_file_range *off_out parameter. Therefore, add sf_wrapper function which implements the *off_out behavior for sendfile. Also update cfr_wrapper so that it does not rely on the fd_in file offset, and remove corresponding fd_in lseek calls which are no longer needed. The file offset of fd_in is now completely unused, except in the plain read/write loop, where lseek is called prior to entering the loop. Bug: https://bugs.gentoo.org/635126
* file_copy: fix lseek offset after EINTR (bug 618086)Zac Medico2017-05-141-5/+8
| | | | | | | | | | | | Fix the lseek offset for the plain read/write loop to account for buffered data that has not been written to to the output file yet (due to previous interruption by EINTR). This code only affects Linux 2.6.32 and earlier (newer kernels use copy_file_range or sendfile). X-Gentoo-bug: 618086 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=618086 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* file_copy: replace loff_t with off_t for portability (bug 617778)Zac Medico2017-05-091-3/+3
| | | | | | | | | | | | The loff_t type is a GNU extension, so use the portable off_t type instead. Also, enable Large File Support macros in setup.py, for 64-bit offsets. Reported-by: Patrick Steinhardt <ps@pks.im> X-Gentoo-bug: 617778 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=617778 Acked-by: Anthony G. Basile <blueness@gentoo.org> Acked-by: Brian Dolbec <dolsen@gentoo.org>
* movefile: support in-kernel file copying on Linux (bug 607868)Zac Medico2017-03-151-0/+385
| | | | | | | | | | | | | | | | | | | Perform in-kernel file copying when possible, and also support reflinks and sparse files. If the optimized implementation fails at runtime, gracefully fallback to a plain read/write loop. Compile-time and run-time fallbacks are implemented, so that any incompatiblities will be handled gracefully. For example, if the code is compiled on a system that supports the copy_file_range syscall, but at run-time an older kernel that does not support this syscall is detected, it will be handled gracefully. There are similar fallbacks for lack of lseek SEEK_DATA and sendfile support. X-Gentoo-Bug: 607868 X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=607868 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* pym/portage/util/locale.py: add a C module to help check localeAnthony G. Basile2016-09-141-0/+68
| | | | | | | | | | | | | | | | | | | | The current method to check for a sane system locale is to use python's ctypes.util.find_library() to construct a full library path to the system libc.so and pass that path to ctypes.CDLL() so we can call toupper() and tolower() directly. However, this gets bogged down in implementation details and fails with musl. We work around this design flaw in ctypes with a small python module written in C which provides thin wrappers to toupper() and tolower(), and only fall back on the current ctypes-based check when this module is not available. This has been tested on glibc, uClibc and musl systems. X-Gentoo-bug: 571444 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=571444 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
* Remove the python-missingos module since apparently nobody has neededZac Medico2010-08-226-188/+0
| | | | it for a long time.
* Remove the bsd-chflags module since it hasn't been used for some timeZac Medico2010-08-224-198/+0
| | | | | (python as read support and we spawn binaries for any necessary modifications).
* Remove unused tbz2tool.c file. The latest stable ebuild doesn'tZac Medico2010-08-221-227/+0
| | | | build/install it.
* Add back executable bits, accidentally removed in previous commit.Zac Medico2010-03-242-0/+0
|
* Remove all svn $Id keywords.Zac Medico2010-03-249-9/+0
|
* make elog mail module always set the 'From' header for rfc2822 complianceMarius Mauch2006-06-109-9/+9
| | | | svn path=/main/trunk/; revision=3483
* removing unused sandbox dirs.Brian Harring2005-10-0620-5993/+0
| | | | svn path=/main/branches/2.0/; revision=2116
* nuking this directory, since it's no longer used.Brian Harring2005-10-0610-2907/+0
| | | | svn path=/main/branches/2.0/; revision=2115
* Remove the specific dependency on python-2.2.Jason Stubbs2005-10-011-1/+1
| | | | svn path=/main/branches/2.0/; revision=2069
* header changes, $Header: -> $Id:Brian Harring2005-08-3037-37/+37
| | | | svn path=/main/branches/2.0/; revision=1951
* Migration (without history) of the current stable line to subversion.Jason Stubbs2005-08-2841-0/+9522
svn path=/main/branches/2.0/; revision=1941