Commit a02c0596 authored by Vitaly Lipatov's avatar Vitaly Lipatov

small fixes and improve test for get binary packages for src.rpm

parent d24ad919
......@@ -129,7 +129,7 @@ echo
if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then
# test install (only for last package in list)
# some key for build hasher from scratch
echog "Find binary packages for $LASTPACKAGE ..."
echog "Find binary packages for '$(basename $LASTPACKAGE)' in $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher..."
BINPACKAGES=`get_binpkg_list $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher $LASTPACKAGE`
test -n "$BINPACKAGES" || fatal "Can't find binary packages for $LASTPACKAGE in `ls -l $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher`"
echo "List: $BINPACKAGES"
......
......@@ -157,12 +157,14 @@ test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is
}
# build binary package list (1st - repo dir, 2st - pkgname)
# algorithm: list all files in PKGDIR, print packages with our source pkg name
get_binpkg_list()
{
local PKGDIR=$1
local PKGNAME=$(basename $2)
find "$PKGDIR" ! -name '*\.src\.rpm' -name '*\.rpm' -execdir \
rpmquery -p --qf='%{sourcerpm}\t%{name}-%{version}-%{release}.%{arch}.rpm\n' "{}" \; \
| grep "^$2[[:space:]].*" | cut -f2 | xargs -n1 -I "{}" echo "$PKGDIR/{} "
| grep "^$PKGNAME[[:space:]].*" | cut -f2 | xargs -n1 -I "{}" echo "$PKGDIR/{} "
}
drop_pkg_extensions()
......
......@@ -4,4 +4,8 @@
. $ETERBUILDDIR/functions/rpm
HASHERDIR=$HASHERDIR-SS
get_binpkg_list $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher asymptote-1.43-alt1.src.rpm
for i in `ls -1 $HASHERDIR/repo/SRPMS.hasher` ; do
echo "get for $i:"
get_binpkg_list $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher $(basename $i)
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment