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

introduce get_binpkg_list and use it

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