Commit a4987cdd authored by Vitaly Lipatov's avatar Vitaly Lipatov

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

Conflicts: bin/rpmbs
parents d4fe0f04 aba98777
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec #test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then if [ "$1" = "-h" ] ; then
echo "ginit - initialize repo in git.alt for current project" echo "ginit - initialize repo in $GIRARHOST for current project"
echo "Use: ginit without parameters" echo "Use: ginit without parameters"
exit 1 exit 1
fi fi
PROJECTNAME=$(basename `pwd`) PROJECTNAME=$(basename `pwd`)
echo "Create remote $PROJECTNAME repo"
ssh git.alt git-init-db $PROJECTNAME.git ssh $GIRARHOST git-init-db $PROJECTNAME.git
...@@ -6,14 +6,20 @@ ...@@ -6,14 +6,20 @@
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec #test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then if [ "$1" = "-h" ] ; then
echo "gpush - publish current project repo to git.alt" echo "gpush - publish current project repo to $GIRARHOST"
echo "Use: gpush without parameters" echo "Use: gpush [project name] [target branch]"
exit 1 exit 1
fi fi
PUSHFORCE=
if [ "$1" = "-f" ] || [ "$1" = "--force" ] ; then
PUSHFORCE="--force"
fi
# use as project name # use as project name
if [ -n "$1" ] ; then if [ -n "$1" ] ; then
PROJECTNAME=$1 PROJECTNAME=$1
shift
else else
PROJECTNAME=$(basename `pwd`) PROJECTNAME=$(basename `pwd`)
fi fi
...@@ -27,9 +33,16 @@ fi ...@@ -27,9 +33,16 @@ fi
# more correctly # more correctly
CURRENTBRANCH=HEAD CURRENTBRANCH=HEAD
#
if [ -n "$1" ] ; then
TARGETBRANCH=$CURRENTBRANCH:$1
shift
else
TARGETBRANCH=
fi
git push $@ git.alt:packages/$PROJECTNAME.git $CURRENTBRANCH:master git push $@ $PUSHFORCE $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
git push --tags git.alt:packages/$PROJECTNAME.git $CURRENTBRANCH:master git push --tags $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
#> $ git commit -a; A='0.23-alt1'; git tag -s $A; \ #> $ git commit -a; A='0.23-alt1'; git tag -s $A; \
#> git tag -s -f -m 'Sisyphus release $A' sisyphus $A #> git tag -s -f -m 'Sisyphus release $A' sisyphus $A
...@@ -188,10 +188,10 @@ rm -f $SPECNAME.old ...@@ -188,10 +188,10 @@ rm -f $SPECNAME.old
if [ "$VENDOR" = "alt" ] ; then if [ "$VENDOR" = "alt" ] ; then
subst "1i#" $SPECNAME subst "1i#" $SPECNAME
# use old compress method for the src.rpm # use old compress method for the src.rpm on ALT 4.0 and 4.1
#subst "1i%define _source_payload w9.gzdio" $SPECNAME if [ "$DISTRVERSION" = "4.0" ] || [ "$DISTRVERSION" = "4.1" ] ; then
# FIXME: only for M40 and older? export USE_LEGACY_COMPRESSION=1
export USE_LEGACY_COMPRESSION=1 fi
subst "1i# This spec is backported to `distr_vendor -d` $DISTRVERSION automatically by rpmbph script. Do not edit it." $SPECNAME subst "1i# This spec is backported to `distr_vendor -d` $DISTRVERSION automatically by rpmbph script. Do not edit it." $SPECNAME
ENTRY="- backport to `distr_vendor -d` $DISTRVERSION (by rpmbph script)" ENTRY="- backport to `distr_vendor -d` $DISTRVERSION (by rpmbph script)"
......
...@@ -78,6 +78,48 @@ LISTRPMARGS=$@ ...@@ -78,6 +78,48 @@ LISTRPMARGS=$@
} }
# TODO: include in sisyphus_check
# , MENV
function release_check()
{
if [ "$MENV" = "SS" ] || [ "$MENV" = "DD" ] ; then
for i in $@ ; do
if [ -z "${i/*alt[0-9].M[0-9][0-9]*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for Sisyphus"
fi
done
return
fi
for i in $@ ; do
if [ -n "${i/*alt[0-9].$MENV*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for $MENV"
fi
done
}
# create tag according to package release
check_gear_and_tag()
{
local SPECDIR=$1
local GEARCTAG=gear-create-tag
# set SPECDIR from LISTNAMES if empty
if [ -r "$LISTNAMES" ] ; then
[ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES`
fi
if is_gear $SPECDIR ; then
# needed correct user.name/user.email for get GPG id
pushd $SPECDIR
$GEARCTAG --force
popd >/dev/null
# git push ?
fi
}
parse_cmd_pre "$@" parse_cmd_pre "$@"
# quotes brokes option handling # quotes brokes option handling
mygetopts $LISTARGS mygetopts $LISTARGS
...@@ -96,6 +138,27 @@ fi ...@@ -96,6 +138,27 @@ fi
#LISTRPMARGS= #LISTRPMARGS=
#LISTRPMARGS=${LISTRPMARGS/-m/} #LISTRPMARGS=${LISTRPMARGS/-m/}
#echo "@@ - $LISTRPMARGS - '$MENV'" #echo "@@ - $LISTRPMARGS - '$MENV'"
# set SPECDIR from LISTNAMES if empty
if [ -r "$LISTNAMES" ] ; then
[ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES`
fi
# If we build from gear repo, run task
if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
echo "Run with gear repo..."
build_rpms_name "$LISTNAMES"
release_check
check_gear_and_tag
$ETERBUILDBIN/gpush || fatal "Git push failed. Possibly you need to run ginit for create remote repo."
TAG=$VERSION-$RELEASE
ssh $GIRARHOST task new
ssh $GIRARHOST task add repo $BASENAME $TAG || ssh $GIRARHOST task rm
ssh $GIRARHOST task run
echo "run task $BASENAME with tag $TAG at $GIRARHOST ($MENV) at `date "+%c"`" >>$RPMDIR/uploaded.log
exit
fi
pack_src_rpm ${LISTRPMARGS} pack_src_rpm ${LISTRPMARGS}
#LISTARGS=${LISTARGS/-s/} #LISTARGS=${LISTARGS/-s/}
...@@ -115,30 +178,13 @@ if [ -n "$REMOTEBUILD" ] ; then ...@@ -115,30 +178,13 @@ if [ -n "$REMOTEBUILD" ] ; then
exit 0 exit 0
fi fi
# TODO: include in sisyphus_check
# , MENV
function release_check()
{
if [ "$MENV" = "SS" ] || [ "$MENV" = "DD" ] ; then
for i in $@ ; do
if [ -z "${i/*alt[0-9].M[0-9][0-9]*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for Sisyphus"
fi
done
return
fi
for i in $@ ; do
if [ -n "${i/*alt[0-9].$MENV*/}" ] ; then
#
fatal "Incorrect release in $i package: was prepared for $MENV"
fi
done
}
set_incoming $MENV #set_incoming $MENV
set_binaryrepo $MENV
if [ -n "${DELETENOW}" ]; then if [ -n "${DELETENOW}" ]; then
echog "Removing did not realized yet"
exit 1
echog "Removing from '$RSYNCINCOMING/$INCOMING/'" echog "Removing from '$RSYNCINCOMING/$INCOMING/'"
check_key check_key
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
...@@ -150,25 +196,6 @@ if [ -n "${DELETENOW}" ]; then ...@@ -150,25 +196,6 @@ if [ -n "${DELETENOW}" ]; then
exit 0 exit 0
fi fi
# create tag according to package release
check_gear_and_tag()
{
local GEARCTAG=gear-create-tag
# set SPECDIR from LISTNAMES if empty
if [ -r "$LISTNAMES" ] ; then
[ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES`
fi
if is_gear $SPECDIR ; then
# needed correct user.name/user.email for get GPG id
pushd $SPECDIR
$GEARCTAG --force
popd >/dev/null
# git push ?
fi
}
if [ -n "$SIGN" ]; then if [ -n "$SIGN" ]; then
release_check $LISTBUILT release_check $LISTBUILT
...@@ -202,19 +229,28 @@ if [ -n "$SIGN" ]; then ...@@ -202,19 +229,28 @@ if [ -n "$SIGN" ]; then
if [ "$RET" = "0" ] if [ "$RET" = "0" ]
then then
if [ -n "${UPLOADNOW}" ] ; then if [ -n "${UPLOADNOW}" ] ; then
echog "Uploading to '$RSYNCINCOMING/$INCOMING/'" echog "Uploading to $GIRARHOST"
check_key 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 \ rsync -vay --partial --progress $CHECKSUM \
-e ssh $LISTBUILT $RSYNCINCOMING/$INCOMING/ && \ -e ssh $LISTBUILT $GIRARHOST: && \
echo "---------------------" && \ echo "---------------------" && \
echog "All files synced" || fatal "Error during rsync" echog "All files synced" || fatal "Error during rsync"
TASKLIST=""
for i in $LISTBUILT ; do
TASKLIST="$TASKLIST srpm $(basename $i)"
done
echo "Create task for $TASKLIST"
ssh $GIRARHOST build -b $BINARYREPO $TASKLIST
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 "$i uploaded to Incoming/$INCOMING ($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 else
......
...@@ -141,16 +141,28 @@ function get_tbz2() ...@@ -141,16 +141,28 @@ function get_tbz2()
mv $WEXT.tbz2 $WEXT.tar.bz2 mv $WEXT.tbz2 $WEXT.tar.bz2
} }
# TODO: use external converter
function get_zip() function get_zip()
{ {
get_archive zip || return get_archive zip || return
mkdir $WEXT.zip.dir || return mkdir $WEXT.zip.dir || return
cd $WEXT.zip.dir cd $WEXT.zip.dir
unzip -q ../$WEXT.zip && tar cf ../$WEXT.tar . && bzipit ../$WEXT.tar unzip -q ../$WEXT.zip && tar cf ../$WEXT.tar . && bzipit ../$WEXT.tar || return
cd .. cd ..
rm -rf $WEXT.zip.dir rm -rf $WEXT.zip.dir
} }
# TODO: use external converter
function get_7z()
{
get_archive 7z || return
mkdir $WEXT.7z.dir || return
cd $WEXT.7z.dir
7z x ../$WEXT.7z && tar cf ../$WEXT.tar . && bzipit ../$WEXT.tar || return
cd ..
rm -rf $WEXT.7z.dir
}
function dir_name() function dir_name()
{ {
rm .listing rm .listing
...@@ -232,7 +244,7 @@ do ...@@ -232,7 +244,7 @@ do
warning "It is not tarball..." warning "It is not tarball..."
get_bzip || get_gz || get_raw || fatal "Error: Cannot retrieve $GETSOURCE" get_bzip || get_gz || get_raw || fatal "Error: Cannot retrieve $GETSOURCE"
else else
get_bzip || get_targz || get_tbz2 || get_tgz || get_zip || get_tar || dir_name || fatal "Error: Cannot retrieve $GETSOURCE" get_bzip || get_targz || get_tbz2 || get_tgz || get_7z || get_zip || get_tar || dir_name || fatal "Error: Cannot retrieve $GETSOURCE"
fi fi
echo "DONE" echo "DONE"
popd popd
......
...@@ -15,7 +15,7 @@ load_mod hasher ...@@ -15,7 +15,7 @@ load_mod hasher
make_ordinalbox() make_ordinalbox()
{ {
mkdir -p $ORDINALWORKDIR mkdir -p $ORDINALWORKDIR
echo "Build aptbox in $ORDINALWORKDIR ..." echo "Build aptbox from ordinal repo in $ORDINALWORKDIR ..."
#rm -rf $ORDINALWORKDIR #rm -rf $ORDINALWORKDIR
mkaptbox -f --apt-config=$ORDINALAPTCONF $ORDINALWORKDIR mkaptbox -f --apt-config=$ORDINALAPTCONF $ORDINALWORKDIR
} }
...@@ -23,7 +23,7 @@ make_ordinalbox() ...@@ -23,7 +23,7 @@ make_ordinalbox()
make_testingbox() make_testingbox()
{ {
mkdir -p $TESTINGWORKDIR mkdir -p $TESTINGWORKDIR
echo "Build aptbox in $TESTINGWORKDIR ..." echo "Build aptbox from testing repo in $TESTINGWORKDIR ..."
#rm -rf $TESTINGWORKDIR #rm -rf $TESTINGWORKDIR
mkaptbox -f --apt-config=$TESTINGAPTCONF $TESTINGWORKDIR mkaptbox -f --apt-config=$TESTINGAPTCONF $TESTINGWORKDIR
} }
......
...@@ -11,5 +11,6 @@ suse-edu2 http://www.opensuse-education.org/download/repos/1.0/11.0/suse/src ...@@ -11,5 +11,6 @@ suse-edu2 http://www.opensuse-education.org/download/repos/1.0/11.0/suse/src
alt-obsolete ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/obsolete alt-obsolete ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/obsolete
alt-orphaned ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/orphaned alt-orphaned ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/orphaned
pld ftp://ftp.pld-linux.org/branches/titanium/PLD/SRPMS/RPMS pld ftp://ftp.pld-linux.org/branches/titanium/PLD/SRPMS/RPMS
rpmfusion http://download1.rpmfusion.org/free/fedora/releases/10/Everything/source/SRPMS/ fedoraf http://download1.rpmfusion.org/free/fedora/releases/10/Everything/source/SRPMS/
rpmfusion http://download1.rpmfusion.org/free/fedora/development/source/SRPMS/
asp http://mirror.yandex.ru/asplinux/sources/SRPMS.14/ asp http://mirror.yandex.ru/asplinux/sources/SRPMS.14/
...@@ -25,11 +25,6 @@ set_target_type() ...@@ -25,11 +25,6 @@ set_target_type()
return 1; return 1;
} }
get_distr_version()
{
echo $1 | sed -e "s|M\([0-9]\)\([0-9]\)|\1\.\2|g" | sed -e "s|SS|Sisyphus|g" | sed -e "s|DD|Daedalus|g"
}
set_incoming() set_incoming()
{ {
INCOMING="Sisyphus" INCOMING="Sisyphus"
...@@ -43,10 +38,44 @@ set_incoming() ...@@ -43,10 +38,44 @@ set_incoming()
;; ;;
*) *)
if [ -n "$UPDATES" ] ; then if [ -n "$UPDATES" ] ; then
INCOMING="updates/`get_distr_version $1`" INCOMING="updates/`get_altdistr_version $1`"
else
INCOMING="backports/`get_altdistr_version $1`"
fi
;;
esac
}
set_binaryrepo()
{
BINARYREPO="sisyphus"
test -z "$1" && return
case "$1" in
("DD")
BINARYREPO="daedalus"
;;
("SS")
BINARYREPO="sisyphus"
;;
*)
# TODO
if [ -n "$UPDATES" ] ; then
BINARYREPO="`get_altdistr_version $1`"
else else
INCOMING="backports/`get_distr_version $1`" BINARYREPO="`get_altdistr_version $1`"
fi fi
;; ;;
esac esac
} }
# M50 -> 5.0
get_altdistr_version()
{
echo "$1" | sed -e "s|M\([0-9]\)\([0-9]\)|\1\.\2|g" | sed -e "s|SS|Sisyphus|g" | sed -e "s|DD|Daedalus|g"
}
# 5.0 -> M50
get_altdistr_mod()
{
echo "$1" | sed -e "s|\([0-9]\)\.\([0-9]\)|M\1\2|g" | sed -e "s|Sisyphus|SS|g"
}
...@@ -101,7 +101,7 @@ RPMVENDOR=`distr_vendor -n` ...@@ -101,7 +101,7 @@ RPMVENDOR=`distr_vendor -n`
if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then
[ -n "$APTCONF" ] || APTCONF=${APTCONFBASE/.SS}.$MENV [ -n "$APTCONF" ] || APTCONF=${APTCONFBASE/.SS}.$MENV
[ -n "$VERBOSE" ] && echog "Target ALT Linux system: `get_distr_version $MENV`, use \$APTCONF" [ -n "$VERBOSE" ] && echog "Target ALT Linux system: `get_altdistr_version $MENV`, use \$APTCONF"
MENVARG="-$MENV" MENVARG="-$MENV"
else else
# FIXME: echog breakes vars # FIXME: echog breakes vars
...@@ -166,14 +166,3 @@ make_temp_file() ...@@ -166,14 +166,3 @@ make_temp_file()
fi fi
} }
# M50 -> 5.0
get_altdistr_version()
{
echo "$1" | sed -e "s|M\([0-9]\)\([0-9]\)|\1\.\2|g" | sed -e "s|SS|Sisyphus|g"
}
# 5.0 -> M50
get_altdistr_mod()
{
echo "$1" | sed -e "s|\([0-9]\)\.\([0-9]\)|M\1\2|g" | sed -e "s|Sisyphus|SS|g"
}
...@@ -39,8 +39,10 @@ HASHERARG="--eager-cleanup" ...@@ -39,8 +39,10 @@ HASHERARG="--eager-cleanup"
[ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG" [ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG"
RSYNCSISYPHUS=rsync.altlinux.org::ALTLinux/Sisyphus RSYNCSISYPHUS=rsync.altlinux.org::ALTLinux/Sisyphus
# obsoleted
RSYNCINCOMING=devel:/incoming RSYNCINCOMING=devel:/incoming
#SSH_KEYFILE=~/.ssh/id_dsa #SSH_KEYFILE=~/.ssh/id_dsa
GIRARHOST=git.alt
BUILDSERVER= BUILDSERVER=
#BUILDSERVERPATH="$HASHERDIR/repo/i586/RPMS.hasher" #BUILDSERVERPATH="$HASHERDIR/repo/i586/RPMS.hasher"
......
...@@ -13,9 +13,9 @@ uni_rpmbuild() ...@@ -13,9 +13,9 @@ uni_rpmbuild()
local RET=0 local RET=0
# hack due quotes # hack due quotes
# just for fill by something # just for fill by something
local ONEPARAM="-v" local ONEPARAM="--quiet"
local TWOPARAM="-v" local TWOPARAM="--quiet"
local THRPARAM="-v" local THRPARAM="--quiet"
local SPECNAME=$1 local SPECNAME=$1
local SPECDIR=`dirname $SPECNAME` local SPECDIR=`dirname $SPECNAME`
......
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