diff --git a/package/libsolv.changes b/package/libsolv.changes index 452fd54b7..154d7e975 100644 --- a/package/libsolv.changes +++ b/package/libsolv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 2 11:44:29 UTC 2024 - Dirk Müller + +- use bash(1) instead of findutils for recursing, reduces + dependencies + ------------------------------------------------------------------- Fri Jun 7 11:33:19 CEST 2024 - mls@suse.de diff --git a/package/libsolv.spec.in b/package/libsolv.spec.in index 59562b371..b7ac2a3e1 100644 --- a/package/libsolv.spec.in +++ b/package/libsolv.spec.in @@ -172,6 +172,8 @@ Summary: Utilities used by libzypp to manage .solv files Group: System/Management Provides: libsolv-tools:%{_bindir}/repo2solv Conflicts: libsolv-tools < %{version} +# needed for recursive globbing of plaindir in repo2solv +Requires: /usr/bin/bash %description tools-base This subpackage contains utilities used by libzypp to manage solv files. @@ -182,7 +184,6 @@ Group: System/Management Conflicts: satsolver-tools-obsolete Obsoletes: satsolver-tools < 0.18 Provides: satsolver-tools = 0.18 -Requires: findutils Requires: libsolv-tools-base = %{version} %description tools diff --git a/tools/repo2solv.c b/tools/repo2solv.c index b3907439c..7baf6e591 100644 --- a/tools/repo2solv.c +++ b/tools/repo2solv.c @@ -169,10 +169,10 @@ read_plaindir_repo(Repo *repo, const char *dir) close(fds[1]); } if (recursive) - execl("/usr/bin/find", "/usr/bin/find", ".", "-name", ".", "-o", "-name", ".*", "-prune", "-o", "-name", "*.delta.rpm", "-o", "-name", "*.patch.rpm", "-o", "-name", "*.rpm", "-a", "-type", "f", "-print0", (char *)0); + execl("/usr/bin/bash", "/usr/bin/bash", "-c", "shopt -s globstar nullglob; printf '%s\\0' **/*.rpm", (char *)0); else - execl("/usr/bin/find", "/usr/bin/find", ".", "-maxdepth", "1", "-name", ".", "-o", "-name", ".*", "-prune", "-o", "-name", "*.delta.rpm", "-o", "-name", "*.patch.rpm", "-o", "-name", "*.rpm", "-a", "-type", "f", "-print0", (char *)0); - perror("/usr/bin/find"); + execl("/usr/bin/bash", "/usr/bin/bash", "-c", "shopt -s nullglob; printf '%s\\0' *.rpm", (char *)0); + perror("/usr/bin/bash"); _exit(1); } close(fds[1]); @@ -196,6 +196,8 @@ read_plaindir_repo(Repo *repo, const char *dir) if (c) continue; bp = buf; + if (strstr(bp, ".patch.rpm") || strstr(bp, ".delta.rpm")) + continue; rpm = solv_dupjoin(dir, "/", bp[0] == '.' && bp[1] == '/' ? bp + 2 : bp); if ((p = repo_add_rpm(repo, rpm, REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE|REPO_NO_LOCATION|(filtered_filelist ? RPM_ADD_FILTERED_FILELIST : 0))) == 0) { @@ -219,10 +221,8 @@ read_plaindir_repo(Repo *repo, const char *dir) } if (wstatus) { - fprintf(stderr, "find: exit status %d\n", (wstatus >> 8) | (wstatus & 255) << 8); -#if 0 + fprintf(stderr, "bash: exit status %d\n", (wstatus >> 8) | (wstatus & 255) << 8); res = 1; -#endif } repo_internalize(repo); return res;