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