Skip to content

Commit

Permalink
[libsolv] Fix repo2solv with BusyBox. Fixes JB#44370
Browse files Browse the repository at this point in the history
Busybox got quite confused by "." as arg0.
  • Loading branch information
pvuorela committed Jan 21, 2019
1 parent e842db8 commit 38cb240
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions rpm/0001-Fix-repo2solv-to-work-with-Busybox-find-tool.patch
@@ -0,0 +1,30 @@
From d2783eab98a0363436c521a679b39070aa7a8a2c Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Mon, 21 Jan 2019 16:45:04 +0200
Subject: [PATCH] Fix repo2solv to work with Busybox find tool

Got quite confused by "." as arg0. Added a new instance as first
real parameter as I could assume that being the original intention.
---
tools/repo2solv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/repo2solv.c b/tools/repo2solv.c
index e055e408..fb60884b 100644
--- a/tools/repo2solv.c
+++ b/tools/repo2solv.c
@@ -169,9 +169,9 @@ read_plaindir_repo(Repo *repo, const char *dir)
close(fds[1]);
}
if (recursive)
- execl("/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/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);
else
- execl("/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);
+ 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");
_exit(1);
}
--
2.20.1

3 changes: 3 additions & 0 deletions rpm/libsolv.spec
Expand Up @@ -19,6 +19,8 @@ BuildRequires: swig
BuildRequires: cmake
BuildRequires: libxml2-devel

Patch1: 0001-Fix-repo2solv-to-work-with-Busybox-find-tool.patch

%description
A new approach to package dependency solving.

Expand Down Expand Up @@ -86,6 +88,7 @@ A new approach to package dependency solving.

%prep
%setup -q -n %{name}-%{version}/upstream
%patch1 -p1

%build
%cmake . \
Expand Down

0 comments on commit 38cb240

Please sign in to comment.