Commit 6a9b8686 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs code refactoring

parent 4b72ea04
...@@ -232,79 +232,90 @@ if [ -n "${DELETENOW}" ]; then ...@@ -232,79 +232,90 @@ if [ -n "${DELETENOW}" ]; then
exit 0 exit 0
fi fi
test -z "$ETERDESTSRPM" && ETERDESTSRPM=$UPLOADDIR${MENVARG/-/.}
# if just packing
if [ -z "$SIGN" ]; then
rpmbs_copying_built
exit $?
fi
# Sign src.rpm and upload it # Sign src.rpm and upload it
if [ -n "$SIGN" ]; then release_check $LISTBUILT
release_check $LISTBUILT
if [ -r "$LISTBUILT" ] ; then if [ -r "$LISTBUILT" ] ; then
check_gear_and_tag check_gear_and_tag
fi fi
echog "Will try to sign follow packages with GPG: \$LISTBUILT" echog "Will try to sign follow packages with GPG: \$LISTBUILT"
# 1. only rpm command has --addsign 2. do 3 retries # 1. only rpm command has --addsign 2. do 3 retries
rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT
RET=$? RET=$?
if [ ! "$RET" = "0" ] ; then
############################################ echog "Impossible to sign package. Check your password and try again."
echog "Changing permissions..." echog "Wait for ten seconds."
chmod 644 -- $LISTBUILT || fatal "can't chmod" sleep 10
echog -n "Checking with sisyphus_check..." exit 1
test -n "$NOCHECK" || sisyphus_check --files $LISTBUILT || fatal "sisyphus check failed" fi
echog "OK"
# rpm's find-req do not find rpmlint :) ############################################
RPMLINT=rpmlint echog "Changing permissions..."
if which $RPMLINT >/dev/null ; then chmod 644 -- $LISTBUILT || fatal "can't chmod"
echog -n "Checking with sisyphus_check..."
test -n "$NOCHECK" || sisyphus_check --files $LISTBUILT || fatal "sisyphus check failed"
echog "OK"
# rpm's find-req do not find rpmlint :)
RPMLINT=rpmlint
if which $RPMLINT >/dev/null ; then
echog -n "Checking with rpmlint..." echog -n "Checking with rpmlint..."
echo echo
$RPMLINT $LISTBUILT $RPMLINT $LISTBUILT
else else
echog "It is recommended to install rpmlint package for additional checking" echog "It is recommended to install rpmlint package for additional checking"
fi fi
test -n "$CHECKONLY" && exit 0
############################################
if [ "$RET" = "0" ] test -n "$CHECKONLY" && exit 0
then ############################################
if [ -n "${UPLOADNOW}" ] ; then
echog "Uploading to $GIRARHOST" # If upload signed package is not needed
check_key if [ -z "${UPLOADNOW}" ] ; then
# TODO: rsync foo.src.rpm git.alt: && ssh git.alt build srpm foo.src.rpm rpmbs_copying_built
# git.alt build -b 4.0 srpm foo.src.rpm exit $?
rsync -vay --partial --progress $CHECKSUM \ fi
echog "Uploading to $GIRARHOST"
check_key
# TODO: rsync foo.src.rpm git.alt: && ssh git.alt build srpm foo.src.rpm
# git.alt build -b 4.0 srpm foo.src.rpm
rsync -vay --partial --progress $CHECKSUM \
-e ssh $LISTBUILT $GIRARHOST: && \ -e ssh $LISTBUILT $GIRARHOST: && \
echo "---------------------" && \ echo "---------------------" && \
echog "All files synced" || fatal "Error during rsync" echog "All files synced" || fatal "Error during rsync"
TASKLIST="" TASKLIST=""
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
TASKLIST="$TASKLIST srpm $(basename $i)" TASKLIST="$TASKLIST srpm $(basename $i)"
done done
if [ -n "$TASKNUMBER" ] ; then if [ -n "$TASKNUMBER" ] ; then
echo "Add $TASKLIST to task $TASKNUMBER" echo "Add $TASKLIST to task $TASKNUMBER"
[ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST task add $TASKNUMBER $TASKLIST" [ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST task add $TASKNUMBER $TASKLIST"
ssh $GIRARHOST task add $TASKNUMBER $TASKLIST ssh $GIRARHOST task add $TASKNUMBER $TASKLIST
else else
echo "Create task for $TASKLIST" echo "Create task for $TASKLIST"
[ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST build -b $BINARYREPO $TASKLIST" [ -n "$VERBOSE" ] && echo "...with command ssh $GIRARHOST build -b $BINARYREPO $TASKLIST"
ssh $GIRARHOST build -b $BINARYREPO $TASKLIST ssh $GIRARHOST build -b $BINARYREPO $TASKLIST
fi fi
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
LOGFILE="$LOGDIR/`basename $i .src.rpm`$MENVARG.log" LOGFILE="$LOGDIR/`basename $i .src.rpm`$MENVARG.log"
echo >>$LOGFILE echo >>$LOGFILE
date >>$LOGFILE date >>$LOGFILE
echo "uploaded">>$LOGFILE echo "uploaded">>$LOGFILE
echo "$(basename $i) run build src.rpm at $GIRARHOST ($MENV) at `date "+%c"`" >>$RPMDIR/uploaded.log echo "$(basename $i) run build src.rpm at $GIRARHOST ($MENV) at `date "+%c"`" >>$RPMDIR/uploaded.log
done done
else
test -z "$ETERDESTSRPM" && ETERDESTSRPM=$UPLOADDIR${MENVARG/-/.}
rpmbs_copying_built
fi
echog "Removing buildroot after upload..." echog "Removing buildroot after upload..."
for i in $LISTNAMES ; do for i in $LISTNAMES ; do
if [ -z ${i/*.src.rpm/} ] ; then if [ -z ${i/*.src.rpm/} ] ; then
echo " skipping for $i" echo " skipping for $i"
continue continue
...@@ -319,15 +330,5 @@ if [ -n "$SIGN" ]; then ...@@ -319,15 +330,5 @@ if [ -n "$SIGN" ]; then
else else
echog "missed" echog "missed"
fi fi
done done
else
echog "Impossible to sign package. Check your password and try again."
echog "Wait for ten seconds."
sleep 10
exit 1
fi
else
rpmbs_copying_built
fi
...@@ -82,7 +82,7 @@ get_archive1() ...@@ -82,7 +82,7 @@ get_archive1()
echog -n "Converting to $WEXT.bz2..." echog -n "Converting to $WEXT.bz2..."
} }
TODO: use functions from tarball #TODO: use functions from tarball
get_tarbz2() get_tarbz2()
{ {
get_archive tar.bz2 get_archive tar.bz2
......
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