files.req: reserve second field in *-files.req.list for owner package name

This commit is contained in:
Alexey Tourbin 2008-06-17 07:58:53 +04:00
parent c4f579077e
commit dae2eb7249
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh -efu
dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list)
cut -f1 |fgrep "$dirlist" || [ $? = 1 ]
dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list |
while read -r d pkg; do echo "${d%/}"; done)
cut -f1 |fgrep "${dirlist:?}" || [ $? = 1 ]

View File

@ -7,13 +7,19 @@ dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list |sort -ur)
FilesReq()
{
local f="$1" d=; shift
for d in $dirlist; do
local f="$1"; shift
echo "${dirlist:?}" |
while read -r d pkg; do
d=${d%/}
case "$f" in
"${RPM_BUILD_ROOT-}$d"/*)
echo "$d"
return ;;
break ;;
"${RPM_BUILD_ROOT-}$d")
[ -z "${pkg-}" -o -z "${RPM_SUBPACKAGE_NAME-}" ] ||
[ "$pkg" = "$RPM_SUBPACKAGE_NAME" ] ||
Warning "$f: directory belongs to $pkg"
break ;;
esac
done
}