From 4bb5153a8deb9fb61636557e268e1afa710f3c2a Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 22 Sep 2003 12:21:51 +0000 Subject: [PATCH] When dependence name starts with `/', + look into pkg contents binary index as well; + fix package database check. --- scripts/find-package | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/find-package b/scripts/find-package index f6ad648..74e6107 100755 --- a/scripts/find-package +++ b/scripts/find-package @@ -57,12 +57,21 @@ FindPackage() echo -E "$package" continue fi + # Check for pkg contents binary index. + elif [ -n "$RPM_PKG_CONTENTS_INDEX_BIN" ] && [ -s "$RPM_PKG_CONTENTS_INDEX_BIN" ] && [ -r "$RPM_PKG_CONTENTS_INDEX_BIN" ]; then + package="$(awk -v "f=$rep" '{if ($1 == f) {print $2; exit}}' "$RPM_PKG_CONTENTS_INDEX_BIN")" + if [ -n "$package" ]; then + echo -E "$package" + continue + fi fi # Check package database. if package="$(rpmquery --whatprovides --queryformat='%{NAME}\n' -- "$rep" |LC_COLLATE=C sort -u)"; then - echo -E "$package" - continue + if [ -n "$package" ]; then + echo -E "$package" + continue + fi fi # Not found; output raw dependence.