diff options
author | Louis Sautier <sbraz@gentoo.org> | 2023-08-10 02:43:22 +0200 |
---|---|---|
committer | Louis Sautier <sbraz@gentoo.org> | 2023-08-10 02:56:37 +0200 |
commit | 9274f3c655d55c0e1c35e2d70202b0144c8ad4ca (patch) | |
tree | b8a0a19cd99ff30420856de4fb970a361317e3a4 /app-misc | |
parent | dev-util/crash: drop 8.0.3 (diff) | |
download | gentoo-9274f3c655d55c0e1c35e2d70202b0144c8ad4ca.tar.gz gentoo-9274f3c655d55c0e1c35e2d70202b0144c8ad4ca.tar.bz2 gentoo-9274f3c655d55c0e1c35e2d70202b0144c8ad4ca.zip |
app-misc/rmlint: add 2.10.2
This new version fixes several bugs including broken tests.
It also removes the dependency of the GUI on Polkit (#828111), which,
according to https://github.com/sahib/rmlint/commit/a807253e, isn't used
for anything at the moment.
Bug: https://bugs.gentoo.org/828111
Signed-off-by: Louis Sautier <sbraz@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r-- | app-misc/rmlint/Manifest | 1 | ||||
-rw-r--r-- | app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch | 51 | ||||
-rw-r--r-- | app-misc/rmlint/rmlint-2.10.2.ebuild | 136 |
3 files changed, 188 insertions, 0 deletions
diff --git a/app-misc/rmlint/Manifest b/app-misc/rmlint/Manifest index 09581c7bdc75..ce83f677e26d 100644 --- a/app-misc/rmlint/Manifest +++ b/app-misc/rmlint/Manifest @@ -1 +1,2 @@ DIST rmlint-2.10.1.tar.gz 2494474 BLAKE2B 40219ff64d54f0e2fc66a958c6ca51520152f77f9038e9756ab601da5180502528be7b2d750c85b5991c31db96c3eb7415841084b6c90db103dc212947864034 SHA512 a1281359798816dadaf3a1e706e671dc63edf8f7d176c114a924a1e03fc9ad6fa54d10de701b09b5e364a9a815e0d11bdbef3d16fb7fec74eb85af20a106db1a +DIST rmlint-2.10.2.tar.gz 2499695 BLAKE2B 07c887f660685b5ec86c8a448d482c96cc40b129fc906d0c31c01e07617bf0167055145050c21b565cb1551ccc1ce6329593d92473c371125b2c91d31d9d601c SHA512 8f8d58892785e9012cb15f3e89480d9d04772fa3f923064520bf17afcc8948b1a24d6f8399176a1a26bd5036553c605958f3720e40cf6cba135a4f3381131180 diff --git a/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch b/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch new file mode 100644 index 000000000000..77f47b18c853 --- /dev/null +++ b/app-misc/rmlint/files/rmlint-2.10.2-fix-sorting-tests.patch @@ -0,0 +1,51 @@ +From 69d9dcb60c9e88084aba37545c77fd02fdc7df33 Mon Sep 17 00:00:00 2001 +From: Cebtenzzre <cebtenzzre@gmail.com> +Date: Wed, 9 Aug 2023 18:42:00 -0400 +Subject: [PATCH] tests: fix failures caused by certain directory names + +Fixes #630 +--- a/tests/test_options/test_sorting.py ++++ b/tests/test_options/test_sorting.py +@@ -158,15 +158,15 @@ def test_sort_by_regex(): + create_file('xxx', 'aaab') + create_file('xxx', 'b') + create_file('xxx', 'c') +- create_file('xxx', '1/c') +- create_file('xxx', 'd') ++ create_file('xxx', 'd/e') ++ create_file('xxx', 'f') + +- head, *data, footer = run_rmlint("-S 'r<1/c>x<d$>a'") ++ head, *data, footer = run_rmlint("-S 'r<d/e>x<f$>a'") + + paths = [p['path'] for p in data] + +- assert paths[0].endswith('1/c') +- assert paths[1].endswith('d') ++ assert paths[0].endswith('d/e') ++ assert paths[1].endswith('f') + assert paths[2].endswith('aaaa') + assert paths[3].endswith('aaab') + assert paths[4].endswith('b') +@@ -206,16 +206,16 @@ def test_sort_by_regex_bad_input(): + # regression test for GitHub issue #484 + @with_setup(usual_setup_func, usual_teardown_func) + def test_regex_multiple_matches(): +- paths = [ +- '1/a', '1/a2', '1/b', +- '2/a', '2/a2', '2/b', +- ] ++ paths = [os.path.join(dname, bname) ++ for dname in ['unique_1', 'unique_2'] ++ for bname in ['a', 'a2', 'b']] ++ + for path in reversed(paths): + create_file('xxx', path) + + # when multiple paths matched a regex, rmlint would not try the next criterion + # check multiple times because sort order was inconsistent before the fix + for _ in range(3): +- head, *data, foot = run_rmlint("-S 'r<1>x<a>l'") ++ head, *data, foot = run_rmlint("-S 'r<unique_1>x<a>l'") + assert len(data) == len(paths) + assert [e['path'] for e in data] == [os.path.join(TESTDIR_NAME, p) for p in paths] diff --git a/app-misc/rmlint/rmlint-2.10.2.ebuild b/app-misc/rmlint/rmlint-2.10.2.ebuild new file mode 100644 index 000000000000..93b2c479581f --- /dev/null +++ b/app-misc/rmlint/rmlint-2.10.2.ebuild @@ -0,0 +1,136 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..11} ) + +inherit gnome2-utils python-single-r1 scons-utils toolchain-funcs + +DESCRIPTION="Extremely fast tool to remove duplicates and other lint from your filesystem" +HOMEPAGE="https://rmlint.readthedocs.io/" +SRC_URI="https://github.com/sahib/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc gui nls test" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +DEPEND=" + dev-libs/glib:2 + dev-libs/json-glib + virtual/libelf:0= +" +RDEPEND=" + ${DEPEND} + gui? ( + ${PYTHON_DEPS} + gnome-base/librsvg:2[introspection] + x11-libs/gdk-pixbuf[introspection] + x11-libs/gtk+:3[introspection] + x11-libs/gtksourceview:3.0[introspection] + x11-libs/pango[introspection] + $(python_gen_cond_dep ' + dev-python/colorlog[${PYTHON_USEDEP}] + dev-python/pygobject:3[${PYTHON_USEDEP}] + ') + ) +" +BDEPEND=" + virtual/pkgconfig + doc? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/sphinx[${PYTHON_USEDEP}] + dev-python/sphinx-bootstrap-theme[${PYTHON_USEDEP}] + ') + ) + nls? ( sys-devel/gettext ) + test? ( + ${PYTHON_DEPS} + app-shells/dash + $(python_gen_cond_dep ' + dev-python/nose[${PYTHON_USEDEP}] + dev-python/parameterized[${PYTHON_USEDEP}] + dev-python/psutil[${PYTHON_USEDEP}] + dev-python/pyxattr[${PYTHON_USEDEP}] + ') + ) +" + +DOCS=(CHANGELOG.md README.rst) +PATCHES=( + # The build system tries to override several CFLAGS + "${FILESDIR}/${PN}-2.10.1-cflags.patch" + # https://github.com/sahib/rmlint/pull/520 + "${FILESDIR}/${PN}-2.10.1-scons.patch" + # Skip problematic tests + "${FILESDIR}/${PN}-2.10.1-skip-tests.patch" + # https://github.com/sahib/rmlint/pull/526 + "${FILESDIR}/${PN}-2.10.1-fix-cc.patch" + # https://github.com/sahib/rmlint/commit/69d9dcb60c9e88084aba37545c77fd02fdc7df33 + "${FILESDIR}/${P}-fix-sorting-tests.patch" +) + +src_prepare() { + default + # Force the GUI to run with the correct PYTHON_SINGLE_TARGET + sed -i "/const char \*commands/s/python3/${EPYTHON}/" \ + lib/cmdline.c || die +} + +src_configure() { + # Needed for USE=-native-symlinks + tc-export AR CC + scons_opts=( + VERBOSE=1 + $(use_with doc docs) + $(use_with gui) + $(use_with nls gettext) + ) + escons "${scons_opts[@]}" config +} + +src_compile() { + escons "${scons_opts[@]}" +} + +src_test() { + RM_TS_DIR="${T}/tests" nosetests -s -v -a '!slow' || \ + die "Tests failed" +} + +src_install() { + escons "${scons_opts[@]}" --prefix="${ED}/usr" --actual-prefix="${EPREFIX}/usr" install + + # https://github.com/sahib/rmlint/pull/525 + if use doc; then + gzip -d "${ED}/usr/share/man/man1/rmlint.1.gz" || die + fi + if use gui; then + python_optimize + fi + einstalldocs +} + +pkg_preinst() { + if use gui; then + gnome2_schemas_savelist + fi +} + +pkg_postinst() { + if use gui; then + gnome2_schemas_update + xdg_icon_cache_update + fi +} + +pkg_postrm() { + if use gui; then + gnome2_schemas_update + xdg_icon_cache_update + fi +} |