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

Merge branch 'master' of git.alt:packages/etersoft-build-utils

parents 2df405c5 041104c6
......@@ -87,7 +87,7 @@ if [ ! -d $HASHERDIR -o "$INITIALIZE" = "1" ]; then
mkdir -p $HASHERDIR && $HSH --initroot-only $HASHERDIR || fatal "mkdir"
fi
HASHERARG="$HASHERARG --mountpoints=/proc"
SHELLHASHERARG="--mountpoints=/proc"
check_locking
......@@ -100,13 +100,12 @@ if [ -n "$TESTMODE" ] ; then
else
UTILPKG="$UTILPKG etersoft-build-utils"
fi
$HSH-install $HASHERDIR $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
$HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
echog "You are in hasher shell"
$HSH-shell $HASHERDIR -Y --shell
$HSH-shell $HASHERDIR $SHELLHASHERARG -Y --shell
if [ -n "$TESTMODE" ] ; then
echo "Remove package for test preun scripts"
$HSH-run --rooter $HASHERDIR -- rpm -e $(drop_pkg_extensions $LISTNAMES)
echo "Cleanup hasher..."
$HSH --cleanup-only $HASHERDIR
fi
# $HASHERARG
......@@ -151,39 +151,40 @@ if [ -n "${DELETENOW}" ]; then
exit 0
fi
check_gear()
# create tag according to package release
check_gear_and_tag()
{
local SPECDIR=$1
local GEARCTAG=gear-create-tag
# create tag according to package release
# workaround about spaces in LISTNAMES
if [ -r "$(echo $LISTNAMES)" ] ; then
#echo wait SPECDIR from rpmbsh
#echo 1 $SPECDIR
# set SPECDIR from LISTNAMES if empty
if [ -r "$LISTNAMES" ] ; then
[ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES`
#echo 2 $SPECDIR
#pwd
fi
if is_gear $SPECDIR ; then
# needed corrent user.name/user.email for get GPG id
pushd $SPECDIR
$GEARCTAG --force
popd
popd >/dev/null
# git push ?
fi
}
if [ -n "$SIGN" ]; then
release_check $LISTBUILT
# workaround about spaces in LISTBUILT
if [ -r "$(echo $LISTBUILT)" ] ; then
cd $RPMDIR/SRPMS
if [ -r "$LISTBUILT" ] ; then
echo if one spec, check gear
check_gear
check_gear_and_tag $SPECDIR
fi
echog "Will try to sign follow packages with GPG: \$LISTBUILT"
cd $RPMDIR/SRPMS
# 1. only rpm command has --addsign 2. do 3 retries
rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT || rpm --addsign $LISTBUILT
RET=$?
############################################
echog "Changing permissions..."
chmod 644 -- $LISTBUILT || fatal "can't chmod"
......
......@@ -73,13 +73,8 @@ add_changelog_helper "- new version" $LISTNAMES
pack_src_rpm $(echo $LISTRPMARGS | sed -e "s|-[suUic]||g")
# Hack to pass SPECDIR to rpmbs
# workaround about spaces in LISTNAMES
if [ -r "$(echo $LISTNAMES)" ] ; then
if [ -r "$LISTNAMES" ] ; then
export SPECDIR=`dirname $LISTNAMES`
#echo 0 $SPECDIR
if [ "$SPECDIR" = "." ] ; then
SPECDIR=$(pwd)
fi
fi
if [ -n "$REMOTEBUILD" ] ; then
......
......@@ -173,23 +173,25 @@ function print_error()
parse_cmd_pre "$@"
mygetopts $LISTARGS
test -z "$VERBOSE" || echo "'$LISTNAMES' @ '$LISTARGS'"
test -z "$VERBOSE" || echo "'$LISTNAMES' @ '$LISTRPMARGS'"
if [ -n "$LISTARGS" ] ; then
if [ -z "${LISTARGS/*spec/}" ] ; then
fatal "run with incorrect filename $LISTARGS"
if [ -n "$LISTRPMARGS" ] ; then
if [ -z "${LISTRPMARGS/*spec/}" ] ; then
fatal "run with incorrect filename $LISTRPMARGS"
fi
if [ ! -f "$LISTNAMES" ] ; then
fatal "set version permitted only for one file"
fi
if [ "${LISTARGS/ /}" != "$LISTARGS" ] ; then
if [ "${LISTRPMARGS/ /}" != "$LISTRPMARGS" ] ; then
fatal "you run rpmgs with more than one version"
fi
GSSETVERSION=$LISTARGS
GSSETVERSION=$LISTRPMARGS
fi
test -z "$LISTNAMES" && print_error
[ -z "$GSSETRELEASE" ] || GSSKIPADDCHANGELOG=1
for i in $LISTNAMES
do
if [ -n "${i/*spec/}" ] ; then
......@@ -201,7 +203,7 @@ do
CURVER=$(get_version $i)
set_version $i $GSSETVERSION
if [ "$CURVER" != "$GSSETVERSION" ] ; then
[ -n "$GSSETRELEASE" ] && GSSKIPADDCHANGELOG=1 || GSSETRELEASE=alt1
[ -n "$GSSETRELEASE" ] || GSSETRELEASE=alt1
set_release $i $GSSETRELEASE
echo "Set new $GSSETVERSION-$GSSETRELEASE version for $i"
else
......
#!/bin/sh
# 2003-2006 (c) Etersoft www.etersoft.ru
# 2003-2006, 2009 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
#
......@@ -18,24 +18,31 @@ if [ "$1" = "-i" ]; then
shift
fi
TOFILE=`which $1 2>/dev/null`
if [ -z "$TOFILE" ] ; then
#echo "$1 is missed in PATH"
#exit 1
TOFILE=$1
fi
if [ -L "$TOFILE" ] ; then
LINKTO=`readlink "$TOFILE"`
if [ -L "$LINKTO" ] ; then
LINKTO1=`readlink "$LINKTO"`
echo "Note: $TOFILE is link to $LINKTO, that is link to $LINKTO1"
TOFILE="$LINKTO1"
# use and modify TOFILE recursively
real_file()
{
local LINKTO1 LINKTO
local TOFILE
# get canonical path
if [ -e "$1" ] ; then
TOFILE=$1
else
TOFILE=`which $1 2>/dev/null || echo $1`
if [ "$TOFILE" != "$1" ] ; then
echo "Note: $1 is placed as $TOFILE"
fi
fi
# get value of symbolic link
if [ -L "$TOFILE" ] ; then
LINKTO=`readlink "$TOFILE"`
echo "Note: $TOFILE is link to $LINKTO"
TOFILE="$LINKTO"
real_file "$LINKTO"
fi
fi
FULLFILEPATH=`readlink -f $TOFILE`
}
real_file "$1"
rpm -qf $ARG "$TOFILE"
rpm -qf $ARG "$FULLFILEPATH"
......@@ -10,6 +10,7 @@
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod spec
REMOTE=
if [ "$1" = "-r" ] ; then
......@@ -21,6 +22,8 @@ SPEC=$1
VER=$2
# need for rpmgs
GSSETRELEASE=$3
test -n "$GSSETRELEASE" || GSSETRELEASE=alt1
export GSSETRELEASE
if [ "$1" = "-h" ]; then
echo "rpmrb spec [vermajor][.verminor] [rel] - update spec to vermajor.verminor version, build %rel release"
......@@ -29,9 +32,8 @@ fi
test -e "$SPEC" || fatal "use with spec"
test -n "$REL" || REL=alt1
rpmgs $SPEC $VER || fatal "Error with get source"
add_changelog_helper "- new version $VER (with rpmrb script)" $SPEC || echog "Changelog entry already exists"
add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists"
rpmbsh $REMOTE -i $SPEC || fatal "Error with build in hasher"
rpmbs -u $SPEC || fatal "Error with upload"
......@@ -134,7 +134,7 @@ for i in "$@"
do
# , , .
if [ -f "$i" ]; then
LISTNAMES="$LISTNAMES $i"
LISTNAMES="$LISTNAMES $(readlink -f $i)"
else
set_target_type ${i/-/} || LISTARGS="$LISTARGS $i"
fi
......
......@@ -145,11 +145,13 @@ do
fi
fi
if [ -f $RPMDIR/SRPMS/$NAMESRPMIN ] ; then
LISTBUILT="$LISTBUILT$NAMESRPMIN "
LISTBUILT="$LISTBUILT $NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMDIR/SRPMS'"
fi
done
# remove extra space before list
LISTBUILT=$(echo "$LISTBUILT" | sed -e "s|^ ||")
test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist."
#LISTRPMARGS=`echo ${LISTRPMARGS} | sed -e "s/--nodeps//g"`
}
......
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