Commit 9c68689b authored by Vitaly Lipatov's avatar Vitaly Lipatov

move build srpm, check log in separate modules

parent dc22a254
......@@ -8,7 +8,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod hasher
load_mod hasher check
WITHSTUFF="--with-stuff"
......
......@@ -11,7 +11,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod rpm
load_mod rpm check
# Start as helper
if [ "$1" = "--helper" ]; then
......
......@@ -12,7 +12,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod repl rpm git
load_mod repl rpm git buildsrpm
DISTRVERSION=`$DISTRVENDOR -v`
......
......@@ -18,7 +18,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod rpm tarball alt git web
load_mod rpm tarball alt git web buildsrpm
SIGN=
SIGNTAG=
......
......@@ -9,7 +9,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod rpm git
load_mod rpm git buildsrpm
RESULT=0
REMCOM=
......
......@@ -10,7 +10,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod rpm repl git rpm web repos
load_mod rpm repl git rpm web repos buildsrpm
# loads repos file and fill SYSNAME and SYSURL arrays
load_systems_list()
......
......@@ -13,7 +13,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod rpm tarball web
load_mod rpm tarball web buildsrpm
WEXT=""
GETSOURCE=""
......
......@@ -135,92 +135,3 @@ uni_rpmrm()
$RPMBUILD "$TWOPARAM" --rmsource --rmspec --nodeps $@
}
# LISTNAMES, options in arg
# build LISTBUILT list with src.rpm full path
pack_src_rpm()
{
local i COMMIT
if [ "$1" = "--commit" ] ; then
shift
COMMIT="--commit"
fi
ARGS=$@
[ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES ARGS=$ARGS" || :
ARGS="$ARGS --nodeps"
for i in $LISTNAMES
do
if [ -z ${i/*rpm/} ] ; then
# if rpm not spec, guess it is src.rpm
#NAMESRPMIN=$(basename $i)
if [ -f "$i" ] ; then
LISTBUILT="$LISTBUILT $(realpath $i)"
build_rpms_name_by_srpm "$i" $ARGS
else
fatal "pack_src_rpm: Can't find '$i'"
fi
else
# Получаем названия пакетов по спеку
# BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN
build_rpms_name "$i" $ARGS
if [ -n "${SIGN}" ]; then
echog "Try to packing \$NAMESRPMIN package for sign"
add_changelog $i
if [ $? = "0" ]; then
echog "Spec file \$i had not ChangeLog entry. It have added now, check it and enter your command again."
echog "Wait for ten seconds."
sleep 10
exit 1
fi
uni_rpmbuild $COMMIT $i -bs $ARGS $NODEPS --target $SYSARCH
else
echog "Just packing \$NAMESRPMIN"
uni_rpmbuild $COMMIT $i -bs $ARGS $NODEPS --target $SYSARCH || fatal "Error with rpmbuild"
fi
# Check the package really built
if [ -f "$RPMTOPDIR/SRPMS/$NAMESRPMIN" ] ; then
LISTBUILT="$LISTBUILT $RPMTOPDIR/SRPMS/$NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMTOPDIR/SRPMS'"
fi
fi
done
LISTBUILT=$(strip_spaces "$LISTBUILT")
test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist."
#LISTRPMARGS=`echo ${LISTRPMARGS} | sed -e "s/--nodeps//g"`
}
check_log()
{
local LOGFILE i RES
echo
echo "-------------------------------------------------------"
echog "Check log for..."
LOGFILE=$1
if grep -q 'ld: warning: libstdc++\.so\.5, needed by [^ ]\+, may conflict with libstdc++\.so\.6' $LOGFILE ; then
echog "Error found: libstdc++.so.5/6 conflicts. Check the log."
return 1
fi
if grep -q 'will always overflow destination buffer' $LOGFILE ; then
echog "Error found: will always overflow destination buffer. Check the log."
return 1
fi
grep 'python-strict' $LOGFILE && warning "python-strict used!!!"
NC1="command not found"
NC2="-march=athlon -mtune=athlon-xp"
#for i in ${NC1} ; do
grep -- '$NC1' $LOGFILE && warning "'$NC1' in build output (some errors in a scripts)"
grep -- '$NC2' $LOGFILE && warning "'$NC2' in build output (forbidden) "
#done
return 0
}
#!/bin/bash
# 2008, 2011 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# 1st: spec name(s) (only one if git, we will skip it)
# other parameters
uni_rpmbuildsrpm()
{
local RET=0
local COMMIT=""
local COMMANDAFTER=""
if [ "$1" = "--commit" ] ; then
shift
COMMIT="--commit"
COMMANDAFTER="git reset"
fi
local SPECNAME="$1"
local SPECDIR=`dirname $SPECNAME`
local GEAR=gear
local ONEPARAM="--quiet"
[ -n "$USE_LEGACY_COMPRESSION" ] && ONEPARAM="--define=_source_payload w9.gzdio"
local TWOPARAM="--quiet"
[ -n "$RPMTOPDIR" ] && TWOPARAM="--define=_topdir $RPMTOPDIR"
local THRPARAM="--quiet"
[ -n "$USE_VENDOR" ] && THRPARAM="--define=_vendor $USE_VENDOR"
if is_gear $SPECDIR ; then
[ -f "$SPECNAME" ] || fatal "run uni_rpmbuild with spec as 2nd parameter"
shift # skip spec name
# FIXME: use spec name as project name
GEARRULES=$(get_gear_rules "$SPECNAME")
# build package without MENV checking
if true || [ "$MENV" = "SS" ] ; then
showcmd $GEAR $COMMIT $GEARRULES --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" $@
$NICE $GEAR $COMMIT $GEARRULES --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" $@ || RET=$?
[ -z "$COMMANDAFTER" ] || docmd $COMMANDAFTER
else
fatal "Build backported src.rpm from git is unsupported now"
# build src.rpm via hasher (on ALT)
# $NICE gear-hsh --build-args="-bs" --rpmbuild -- $COMMAND "$ONEPARAM" $@
#docmd $NICE $GEAR --hasher -- myhsh --build-prog=$ETERBUILDDIR/functions/rebuild $@ || RET=$?
fi
else
mkdir -p $RPMTOPDIR/BUILD $RPMTOPDIR/SRPMS
showcmd $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" $@
$NICE $RPMBUILD "$ONEPARAM" "$TWOPARAM" "$THRPARAM" $@ || RET=$?
fi
return $RET
}
# LISTNAMES, options in arg
# build LISTBUILT list with src.rpm full path
pack_src_rpm()
{
local i COMMIT
if [ "$1" = "--commit" ] ; then
shift
COMMIT="--commit"
fi
ARGS=$@
[ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES ARGS=$ARGS" || :
ARGS="$ARGS --nodeps"
for i in $LISTNAMES
do
if [ -z ${i/*rpm/} ] ; then
# if rpm not spec, guess it is src.rpm
#NAMESRPMIN=$(basename $i)
if [ -f "$i" ] ; then
LISTBUILT="$LISTBUILT $(realpath $i)"
build_rpms_name_by_srpm "$i" $ARGS
else
fatal "pack_src_rpm: Can't find '$i'"
fi
else
# Получаем названия пакетов по спеку
# BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN
build_rpms_name "$i" $ARGS
if [ -n "${SIGN}" ]; then
echog "Try to packing \$NAMESRPMIN package for sign"
add_changelog $i
if [ $? = "0" ]; then
echog "Spec file \$i had not ChangeLog entry. It have added now, check it and enter your command again."
echog "Wait for ten seconds."
sleep 10
exit 1
fi
else
echog "Just packing \$NAMESRPMIN"
fi
uni_rpmbuildsrpm $COMMIT $i -bs $ARGS $NODEPS --target $SYSARCH || fatal "Error with rpmbuild"
# Check the package really built
if [ -f "$RPMTOPDIR/SRPMS/$NAMESRPMIN" ] ; then
LISTBUILT="$LISTBUILT $RPMTOPDIR/SRPMS/$NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMTOPDIR/SRPMS'"
fi
fi
done
LISTBUILT=$(strip_spaces "$LISTBUILT")
test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist."
}
#!/bin/bash
# 2008, 2011 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
check_log()
{
local LOGFILE i RES
echo
echo "-------------------------------------------------------"
echog "Check log for..."
LOGFILE=$1
if grep -q 'ld: warning: libstdc++\.so\.5, needed by [^ ]\+, may conflict with libstdc++\.so\.6' $LOGFILE ; then
echog "Error found: libstdc++.so.5/6 conflicts. Check the log."
return 1
fi
if grep -q 'will always overflow destination buffer' $LOGFILE ; then
echog "Error found: will always overflow destination buffer. Check the log."
return 1
fi
grep 'python-strict' $LOGFILE && warning "python-strict used!!!"
NC1="command not found"
NC2="-march=athlon -mtune=athlon-xp"
#for i in ${NC1} ; do
grep -- '$NC1' $LOGFILE && warning "'$NC1' in build output (some errors in a scripts)"
grep -- '$NC2' $LOGFILE && warning "'$NC2' in build output (forbidden) "
#done
return 0
}
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