Commit 5e51f303 authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce get_binpkg_list and use it

parent d155dfa1
#!/bin/sh
# 2003-2006 (c) Etersoft www.etersoft.ru
# 2003-2006, 2008 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
#
# 06.02.05
# 15.04.05 add other repository support
# 20.08.05 add /proc support
# SRPM- hasher
# ( -m)
# -i hasher
. /usr/share/eterbuild/common
......@@ -25,7 +21,7 @@ phelp()
echog "$Descr"
echog "$Usage"
echog "Options:"
echog " -m - mail result log"
# echog " -m - mail result log"
echog " -s - sign package(s)"
echog " -u - sign and upload package(s) to Incoming"
echog " -i - install built packages in test hasher"
......@@ -35,7 +31,7 @@ phelp()
while getopts :hmic opt; do
case $opt in
h) phelp; exit 0;;
m) fatal "Mail is disabled for this version" ; TOMAIL=1 ;;
# m) fatal "Mail is disabled for this version" ; TOMAIL=1 ;;
i) TESTINSTALL=1;;
c) HASHERARG="--without-stuff $HASHERARG";;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;;
......@@ -126,7 +122,7 @@ do
echog "########## Build of `basename $i` is done in hasher $MENV #############"
echo
LISTBUILTSH="$LISTBUILTSH$i "
LASTPACKAGE=$i
done
echo
......@@ -136,7 +132,6 @@ if [ "$RESULT" = "1" ] ; then
else
echog "Full list of the hashered packages:"
fi
print_list $LISTBUILTSH
echo
......@@ -154,15 +149,14 @@ find "$PKGDIR" ! -name '*\.src\.rpm' -name '*\.rpm' -execdir \
if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then
# test install (only for last package in list)
# some key for build hasher from scratch
MySRPM=$LASTPACKAGE
echog "Find binary packages for $MySRPM ..."
BINPACKAGES=`get_binpkg_list $MySRPM`
echog "Find binary packages for $LASTPACKAGE ..."
BINPACKAGES=`get_binpkg_list $HASHERDIR/repo/$DEFAULTARCH/RPMS.hasher $LASTPACKAGE`
echo "List: $BINPACKAGES"
echo
loginhsh -t -i $MENVARG $BINPACKAGES || exit 1
fi
# make src.rpm is need
# make src.rpm if need
if [ "$RESULT" = "0" ] ; then
test -n "$LISTRPMARGS" && rpmbs $MENVARG $LISTRPMARGS $LISTBUILTSH
fi
......
......@@ -454,3 +454,12 @@ publish_srpm()
}
# build binary package list (1st - repo dir, 2st - pkgname
function get_binpkg_list()
{
local PKGDIR=$1
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/{} "
}
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