Commit 7863ee48 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix option handling: fix install-in-hasher package after rpmbph

parent e285006a
#!/bin/bash
# 2003-2006, 2008-2010 (c) Etersoft www.etersoft.ru
# 2003-2006, 2008-2010, 2013 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
#
......@@ -10,10 +10,11 @@
. `dirname $0`/../share/eterbuild/functions/common
load_mod hasher check
TESTINSTALL=
WITHSTUFF="--with-stuff"
#############################
Usage="Usage: $name [-m -s -u -i -c -l] src.rpm..."
Usage="Usage: $name [-i -c -l] src.rpm..."
function mygetopts()
{
name=${0##*/}
......@@ -31,18 +32,17 @@ phelp()
}
while getopts :hmicl opt; do
while getopts :hicl opt; do
case $opt in
h) phelp; exit 0;;
i) TESTINSTALL=1;;
l) HASHERARG="$HASHERARG --lazy-cleanup";;
c) WITHSTUFF="--without-stuff";;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;;
# ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
?) OPTIND=$((OPTIND-1)); break;
?) OPTIND=$((OPTIND-1)); break;
esac
done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
......@@ -128,11 +128,11 @@ fi
print_list $LISTBUILTSH
echo
if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then
if [ "$RESULT" = "0" ] && [ -n "$TESTINSTALL" ] ; then
# test install (only for last package in list)
# some key for build hasher from scratch
echog "Find binary packages for '$(basename $LASTPACKAGE)' in $HASHERDIR/repo/$BUILDARCH/RPMS.hasher..."
BINPACKAGES=`get_binpkg_list $HASHERDIR/repo/$BUILDARCH/RPMS.hasher $LASTPACKAGE | grep -v debuginfo`
BINPACKAGES=`get_binpkg_list $HASHERDIR/repo/$BUILDARCH/RPMS.hasher $LASTPACKAGE | estrlist reg_exclude debuginfo -`
test -n "$BINPACKAGES" || fatal "Can't find binary packages for $LASTPACKAGE in `ls -l $HASHERDIR/repo/$BUILDARCH/RPMS.hasher`"
echo "List: $BINPACKAGES"
echo
......
......@@ -344,11 +344,11 @@ phelp()
}
while getopts :hnuivqb: opt; do
while getopts :hnvqb: opt; do
case $opt in
h) phelp; exit 0 ;;
n) NOBUILD=1 ;;
u) UPLOADARG="-$opt" ;;
#u) UPLOADARG="-$opt" ;;
v) VERBOSE=1 ;;
b) BINARYREPONAME=$OPTARG ;;
q) QUIET=1 ;;
......
......@@ -60,11 +60,10 @@ phelp()
echog " -n do not check with sisyphus_check before upload"
echog " -o create nosrc.rpm package"
echog " -z create src.rpm with compatible gzip compression (obsoleted)"
# echog " -U - sign package(s) and upload it to Incoming (updates)"
# echog " -d - remove package(s) from SRPMS and Incoming"
}
while getopts :hfstcuUdnop:a:b:z opt; do
while getopts :hfstcudnop:a:b:z opt; do
case $opt in
h) phelp; exit 0;;
s) SIGN=1 ;;
......@@ -73,7 +72,6 @@ while getopts :hfstcuUdnop:a:b:z opt; do
# FIXME: handle SIGN separately
c) CHECKONLY=1 ; SIGN=1 ;;
u) UPLOADNOW=1 ; SIGN=1 ;;
# U) UPLOADNOW=1 ; SIGN=1 ; UPDATES=1 ;;
a) UPLOADNOW=1 ; SIGN=1 ; TASKNUMBER=$OPTARG ;;
# see functions/alt:set_binaryrepo() for BINARYREPONAME
b) BINARYREPONAME=$OPTARG ;;
......
......@@ -67,20 +67,20 @@ mygetopts $LISTARGS
[ -n "$LISTNAMES" ] || fatal "Run with exists specs as arg"
# Skip for prev. packed src.rpm
if echo "$LISTNAMES" | grep -q spec ; then
if estrlist has spec "$LISTNAMES" ; then
# If fail, we already has correct changelog
add_changelog_helper "- new version" $LISTNAMES
fi
# We do not not pass args for myhsh here...
# FIXME: не обрабатывает два пропускаемых вместе параметра
pack_src_rpm $COMMIT $(drop_args "$LISTRPMARGS" s u U i c l f)
pack_src_rpm $COMMIT $(drop_args "$LISTRPMARGS" s u i c l f)
if echo "$LISTNAMES" | grep -q spec ; then
set_specdir $LISTNAMES
fi
docmd time $ETERBUILDBIN/myhsh $MENVARG $LISTRPMARGS $LISTBUILT
docmd time $ETERBUILDBIN/myhsh $MENVARG $(drop_args "$LISTRPMARGS" f u) $LISTBUILT
RESULT=$?
# remove generated src.rpm
for i in $LISTBUILT ; do
......
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