Commit 563b3559 authored by Yuri Fil's avatar Yuri Fil

Merge branch 'master' of git.eter:/people/lav/packages/etersoft-build-utils

parents ff8f8301 e320e1cd
etersoft-build-utils-1.7.4: 14 Jan 2010
- rpmbph: support for branches like 5.1 if exists, instead M51
- rpmgp: clone all branches locally
- rpmbsh: fix remote src.rpm build from rpmbph
- gpush: push to all remote repos like git.*
- loginhsh: add -o option for run as root
etersoft-build-utils-1.7.3: 13 Jan 2010
- rpmgp: add acl list printing
- gpush: push without branch if --all
- rpmbph: do not insert fix for fuzzy patch in any case
- rpmgp: add -g option for remote and locally repo clone
etersoft-build-utils-1.7.2: 09 Jan 2010
- rpmbph: realize gear repo backporting (eterbug #4766)
- myhsh: drop out backport related defines (it will be placed in the spec by rpmbph)
- gpush: push current branch definitely
- rpmbs: disable GPG_AGENT_INFO if gpg-agent is not reached
- rpmbs: fix task build on various repos
etersoft-build-utils-1.7.1: 08 Jan 2010
- myhsh: enable error if there are unpackaged files in the build, add NOSTRICT_UNPACKAGED param in config for disable new behaviour
- rpmgp: improve package checking (support non installed packages)
- hasher: fix sources.list placement: use sources.list from /etc/eterbuild if apt.conf in /etc/eterbuld too
etersoft-build-utils-1.7.0: 03 Jan 2010 etersoft-build-utils-1.7.0: 03 Jan 2010
- check_publish.sh: add check for exist git repo, list acl for package if it in git - check_publish.sh: add check for exist git repo, list acl for package if it in git
- config: add GEAR_USER - config: add GEAR_USER
......
...@@ -18,7 +18,9 @@ if is_girar_name $1 ; then ...@@ -18,7 +18,9 @@ if is_girar_name $1 ; then
shift shift
fi fi
PROJECTNAME=$(basename `pwd`) # FIXME
PROJECTNAME=$(basename `get_root_git_dir`)
echo "Create remote $PROJECTNAME repo in $GIRARHOST:" echo "Create remote $PROJECTNAME repo in $GIRARHOST:"
ssh $GIRARHOST git-init-db $PROJECTNAME.git ssh $GIRARHOST git-init-db $PROJECTNAME.git
echo "Create $GIRARHOST remote repo alias" echo "Create $GIRARHOST remote repo alias"
......
...@@ -34,19 +34,16 @@ if [ -n "$1" ] ; then ...@@ -34,19 +34,16 @@ if [ -n "$1" ] ; then
PROJECTNAME=$1 PROJECTNAME=$1
shift shift
else else
PROJECTNAME=$(basename `pwd`) PROJECTNAME=$(basename `get_root_git_dir`)
fi fi
CURRENTBRANCH=$(git branch | grep "^\*" | cut -d " " -f 2) CURRENTBRANCH=$(get_current_branch)
if [ -z "$CURRENTBRANCH" ] ; then if [ -z "$CURRENTBRANCH" ] ; then
echo "Can't detect current branch" echo "Can't detect current branch"
exit 1 exit 1
fi fi
# more correctly
CURRENTBRANCH=HEAD
#
if [ -n "$1" ] ; then if [ -n "$1" ] ; then
TARGETBRANCH=$CURRENTBRANCH:$1 TARGETBRANCH=$CURRENTBRANCH:$1
shift shift
...@@ -54,9 +51,26 @@ else ...@@ -54,9 +51,26 @@ else
TARGETBRANCH=$CURRENTBRANCH TARGETBRANCH=$CURRENTBRANCH
fi fi
echo "Push branch $TARGETBRANCH from $PROJECTNAME.git to $GIRARHOST:packages/$PROJECTNAME.git" if [ "$PUSHALL" = "--all" ] ; then
git push $PUSHALL $PUSHFORCE $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH TEXTBRANCH="all branches"
git push --tags $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH TARGETBRANCH=
else
TEXTBRANCH="branch $TARGETBRANCH"
fi
push_to_remote()
{
local GHOST=$1
echo
echo "** Push $TEXTBRANCH from $PROJECTNAME.git to $GHOST:packages/$PROJECTNAME.git"
# FIXME: push with one command
git push $PUSHALL $PUSHFORCE $GHOST:packages/$PROJECTNAME.git $TARGETBRANCH
git push --tags $GHOST:packages/$PROJECTNAME.git $TARGETBRANCH
}
for i in `( echo $GIRARHOST; get_remote_git_list ) | uniq` ; do
push_to_remote $i
done
#> $ 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
...@@ -18,7 +18,7 @@ SAVEOPT=$@ ...@@ -18,7 +18,7 @@ SAVEOPT=$@
############################# #############################
Usage="Usage: $name [-t -i -h -r] bin.rpm..." Usage="Usage: $name [-t -i -h -r -c] [-$CURRENTBRANCHNAME] bin.rpm..."
function mygetopts() function mygetopts()
{ {
name=${0##*/} name=${0##*/}
...@@ -31,17 +31,20 @@ phelp() ...@@ -31,17 +31,20 @@ phelp()
echog "Options:" echog "Options:"
echog " -i - initialize hasher" echog " -i - initialize hasher"
echog " -c - cleanup hasher" echog " -c - cleanup hasher"
echog " -o - log in as root user"
echog " -t - use test hasher dir" echog " -t - use test hasher dir"
echog " -r - remote login to hasher" echog " -r - remote login to hasher"
echog " -M?? - branch name"
} }
while getopts :chitr opt; do while getopts :chito opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
t) HASHERDIR=$HASHERDIR-test; TESTMODE=1 ;; t) HASHERDIR=$HASHERDIR-test; TESTMODE=1 ;;
i) INITIALIZE=1 ;; i) INITIALIZE=1 ;;
c) CLEANUP=1 ;; c) CLEANUP=1 ;;
r) REMOTE=1 ;; r) REMOTE=1 ;;
o) ROOTER="--rooter" ;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) 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;; # ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
?) OPTIND=$((OPTIND-1)); break; ?) OPTIND=$((OPTIND-1)); break;
...@@ -69,7 +72,7 @@ fi ...@@ -69,7 +72,7 @@ fi
# export OURAPTCONF with temp. file contains correct path to sources.list # export OURAPTCONF with temp. file contains correct path to sources.list
prepare_aptconfig prepare_aptconfig
HASHERARG="--apt-config=$OURAPTCONF --target $DEFAULTARCH" HASHERARG="$HASHERARG --apt-config=$OURAPTCONF --target $DEFAULTARCH"
mygetopts $LISTARGS mygetopts $LISTARGS
...@@ -106,7 +109,7 @@ else ...@@ -106,7 +109,7 @@ else
fi fi
$HSH-install $HASHERDIR --wait-lock $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 $SHELLHASHERARG -Y --shell $HSH-shell $HASHERDIR $SHELLHASHERARG $ROOTER -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)
......
#!/bin/bash #!/bin/bash
# 2003-2006, 2008-2009 (c) Etersoft www.etersoft.ru # 2003-2006, 2008-2010 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
# #
...@@ -78,27 +78,28 @@ fi ...@@ -78,27 +78,28 @@ fi
# export OURAPTCONF with temp. file contains correct path to sources.list # export OURAPTCONF with temp. file contains correct path to sources.list
prepare_aptconfig prepare_aptconfig
# FIXME: we override config value here?
# TODO: for add $LISTRPMARGS we need skip function for delete "our" params # TODO: for add $LISTRPMARGS we need skip function for delete "our" params
# we do not need check cases for mount points, thanks ldv@
HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --apt-config=$OURAPTCONF --target $DEFAULTARCH $HASHERARG" HASHERARG="--no-sisyphus-check=$HASHER_NOCHECK --apt-config=$OURAPTCONF --target $DEFAULTARCH $HASHERARG"
if [ "$MENV" != "SS" ] && [ "$MENV" != "DD" ]; then HASHERARG="--mountpoints=/proc,/dev/pts $HASHERARG"
HASHERARG="--build-args \"--with=build_$MENV\" --build-args \"--with=build_backport\" $HASHERARG"
BUILDARGS=""
if [ -z "$NOSTRICT_UNPACKAGED" ] ; then
BUILDARGS="$BUILDARGS --define '_unpackaged_files_terminate_build 1'"
fi fi
LISTBUILTSH="" LISTBUILTSH=""
for i in $LISTNAMES for i in $LISTNAMES
do do
# !
# --nprocs=2
# Note: hasher is already use renice for low priority
LOGFILE="$LOGDIR/`basename $i .src.rpm`$MENVARG.log" LOGFILE="$LOGDIR/`basename $i .src.rpm`$MENVARG.log"
echo "Build in hasher ($MENV) in $HASHERDIR dir" >$LOGFILE echo "Build in hasher ($MENV) in $HASHERDIR dir" >$LOGFILE
rm -f $LOGFILE.failed rm -f $LOGFILE.failed
# enable /proc support only if require it echog "Build in hasher: $i (arg: $HASHERARG --build-args \"$BUILDARGS\", distro: $MENV, hasherdir: $HASHERDIR)"
#rpm --requires -p $i | grep "/proc" && ARG="$HASHERARG --mountpoints=/proc" || ARG="$HASHERARG"
# we do not need check cases for mount points, thanks ldv@
ARG="$HASHERARG --mountpoints=/proc,/dev/pts"
echog "Build in hasher: $i (arg: $ARG, distro: $MENV, hasherdir: $HASHERDIR)"
($HSH $ARG --build-args "--define 'backport_distro ${MENV}'" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE # Note: hasher is already use renice for low priority
($HSH $HASHERARG --build-args "$BUILDARGS" -- $HASHERDIR $i 2>&1 || touch $LOGFILE.failed) | tee -a $LOGFILE
test -L $HASHERDIR/BUILD || ln -s chroot/usr/src/RPM/BUILD $HASHERDIR/ test -L $HASHERDIR/BUILD || ln -s chroot/usr/src/RPM/BUILD $HASHERDIR/
if [ -f $LOGFILE.failed ] ; then if [ -f $LOGFILE.failed ] ; then
RESULT=1 RESULT=1
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
# rpm- # rpm-
# : # :
# - - # - -
# TODO -M?
# TODO: -c
# 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
...@@ -46,13 +44,13 @@ while getopts :hciprR opt; do ...@@ -46,13 +44,13 @@ while getopts :hciprR opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
c) BUILDOPT="c" ;; c) BUILDOPT="c" ;;
i) BUILDOPT="i b" ;; i) BUILDOPT="i b" ;;
p) BUILDOPT="b" ;; p) BUILDOPT="b" ;;
r) BUILDREQ="-bc" ;; r) BUILDREQ="-bc" ;;
R) BUILDREQ="-bi" ;; R) BUILDREQ="-bi" ;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) 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;; # ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
?) OPTIND=$((OPTIND-1)); break; ?) OPTIND=$((OPTIND-1)); break;
esac esac
done done
......
#!/bin/bash #!/bin/bash
# 2003-2009 (c) Etersoft www.etersoft.ru # 2003-2010 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
# #
...@@ -16,7 +16,7 @@ load_mod repl rpm git ...@@ -16,7 +16,7 @@ load_mod repl rpm git
DISTRVERSION=`distr_vendor -v` DISTRVERSION=`distr_vendor -v`
alt_tolocal() altspec_to_local()
{ {
local TXTRELEASE local TXTRELEASE
local SPECNAME local SPECNAME
...@@ -26,17 +26,20 @@ BASERELEASE=$(get_numrelease $SPECNAME) ...@@ -26,17 +26,20 @@ BASERELEASE=$(get_numrelease $SPECNAME)
FIXPATCHFUZZ="%define _default_patch_fuzz 3" FIXPATCHFUZZ="%define _default_patch_fuzz 3"
echo "Converting spec $SPECNAME to $MDISTR..."
# Set buildreq # Set buildreq
if [ "$VENDOR" = "alt" ] ; then if [ "$VENDOR" = "alt" ] ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 0.95" BUILDREQ="BuildRequires: rpm-build-compat >= 0.95"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbsh $GIRARHOST"
# Change release according to alt policy with extensions # Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N) # General rule: alwars alt(N-1).MM.(N)
set_release $SPECNAME $(get_txtrelease $SPECNAME)$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE set_release $SPECNAME $(get_txtrelease $SPECNAME)$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE
ADDDEF="" ADDDEF=""
CLEANTEXT="" CLEANTEXT=""
# due new libtool, affected on ALT Linux # due new libtool, affected on ALT Linux
RECONFT="%undefine __libtoolize" if echo "$MDISTR" | egrep -q "M24|M30|M40|M41" ; then
RECONFT="%undefine __libtoolize"
fi
else else
# Need our compat package and disable strong patch checking # Need our compat package and disable strong patch checking
BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95 make gcc\n$FIXPATCHFUZZ" BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95 make gcc\n$FIXPATCHFUZZ"
...@@ -57,7 +60,7 @@ if [ "$VENDOR" = "mdv" ] || [ "$VENDOR" = "pclinux" ] ; then ...@@ -57,7 +60,7 @@ if [ "$VENDOR" = "mdv" ] || [ "$VENDOR" = "pclinux" ] ; then
fi fi
# Do not add BuildReq if already exist # Do not add BuildReq if already exist
cat $SPECNAME | grep rpm-build-compat &>/dev/null && BUILDREQ="$FIXPATCHFUZZ" cat $SPECNAME | grep rpm-build-compat &>/dev/null && BUILDREQ=""
FIXMKTEMP="" FIXMKTEMP=""
...@@ -240,14 +243,12 @@ fi ...@@ -240,14 +243,12 @@ fi
test -n "$TOCHANGELOG" && ENTRY=`echo -e "$ENTRY\n- $TOCHANGELOG"` test -n "$TOCHANGELOG" && ENTRY=`echo -e "$ENTRY\n- $TOCHANGELOG"`
add_changelog $SPECNAME -e "$ENTRY" add_changelog $SPECNAME -e "$ENTRY"
$BUILDCOMMAND $LISTRPMARGS $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build"
} }
############################# #############################
Usage="Usage: $name [-r -u -U -n -i -m -v] [-M??] spec..." Usage="Usage: $name [-r -u -U -n -i -m -v] [-$CURRENTBRANCHNAME] spec..."
function mygetopts() function mygetopts()
{ {
name=${0##*/} name=${0##*/}
...@@ -257,21 +258,21 @@ phelp() ...@@ -257,21 +258,21 @@ phelp()
{ {
echog "$Descr" echog "$Descr"
echog "$Usage" echog "$Usage"
echo "Use rpmbph -M40 for backport to ALT 4.0 and so on" echo "Use rpmbph -$CURRENTBRANCHNAME for backport to ALT $CURRENTBRANCHNAME and so on"
echog "Options:" echog "Options:"
echog " -r - remote build" echog " -r - remote build"
# echog " -m - send result via e-mail" # echog " -m - send result via e-mail"
echog " -u/-U - sign and upload after build" echog " -u/-U - sign and upload after build"
echog " -n - do not build in hasher" echog " -n - do not build in hasher (use first in the list)"
echog " -i - install built packages in test hasher" echog " -i - install built packages in test hasher"
echog " -v - more verbose" echog " -v - more verbose"
} }
while getopts :hniv opt; do while getopts :hniuv opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
n) BUILDCOMMAND="$ETERBUILDBIN/rpmbs --rmsource --rmspec";; n) NOBUILD=1;;
v) VERBOSE=1;; v) VERBOSE=1;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) 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;; # ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
...@@ -308,9 +309,76 @@ fi ...@@ -308,9 +309,76 @@ fi
[ -n "$VERBOSE" ] && echo "DISTRVERSION=$DISTRVERSION LISTRPMARGS=$LISTRPMARGS" [ -n "$VERBOSE" ] && echo "DISTRVERSION=$DISTRVERSION LISTRPMARGS=$LISTRPMARGS"
[ -n "$NOBUILD" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbs --rmsource --rmspec"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbsh $GIRARHOST"
if [ "$VENDOR" = "alt" ] ; then
# run inside gear repo, just create backported spec
# set SPECDIR from LISTNAMES if empty
[ -n "$SPECDIR" ] || set_specdir $LISTNAMES
if is_gear $SPECDIR ; then
[ -f "$LISTNAMES" ] || fatal "Run with one spec inside gear repo"
USEBRANCH=$MDISTR
SPEC=$LISTNAMES
BPSPEC=$SPEC.$USEBRANCH
# support for without M names
USENUMBRANCH=$(get_altdistr_version $USEBRANCH)
if [ "$USENUMBRANCH" != "$USEBRANCH" ] ; then
if is_exist_branch $USENUMBRANCH ; then
echo "Exists $USENUMBRANCH branch, will use it instead $USEBRANCH"
USEBRANCH=$USENUMBRANCH
fi
# hack about p5, M50 -> p5
if [ "$USEBRANCH" = "M50" ] && is_exist_branch p5 ; then
USENUMBRANCH=p5
echo "Exists $USENUMBRANCH branch, will use it instead $USEBRANCH"
USEBRANCH=$USENUMBRANCH
fi
fi
[ -f "$BPSPEC" ] && fatal "File $BPSPEC is already exists, check it"
CURBRANCH=$(get_current_branch)
if [ "$CURBRANCH" = "$USEBRANCH" ] ; then
fatal "Run rpmbph in sisyphus or master branch, not in backport branch $USEBRANCH"
fi
# Create branch if not exist yet
if ! is_exist_branch $USEBRANCH ; then
git branch $USEBRANCH
fi
cp -f $LISTNAMES $BPSPEC
altspec_to_local $BPSPEC
git checkout $USEBRANCH || fatal "Can't checkout branch $USEBRANCH. Use $BPSPEC manually or remove it."
git merge $CURBRANCH
mv -f $BPSPEC $SPEC
# FIXME: Ctrl-\ and q will cancelled less with return error code
if ! git diff $USEBRANCH ; then
#git checkout $SPEC $MDISTR
#git checkout $CURBRANCH
fatal "User cancelled. You are still in $USEBRANCH branch with modified spec"
fi
git add $SPEC
if ! git commit -a -m "backported to $USEBRANCH by rpmbph script as $(get_version $SPEC)-$(get_release $SPEC)" ; then
#git checkout $CURBRANCH
#fatal "Commit error. You are still in $MDISTR branch with modified and uncommitted spec"
# FIXME: git commit returns error if no commit needed
echo
fi
[ -n "$NOBUILD" ] && BUILDCOMMAND="$ETERBUILDBIN/rpmbs"
$BUILDCOMMAND $LISTRPMARGS $REMOTEBUILD $DISTRARG $SPEC || { git checkout $CURBRANCH ; fatal "Can't build" ; }
git checkout $CURBRANCH
exit $?
fi
fi
unset MENV MENVARG unset MENV MENVARG
# handle src.rpm too, LISTBUILT - result with full pathes to src.rpms # handle src.rpm and spec both, LISTBUILT - result with full pathes to src.rpms
pack_src_rpm $LISTNAMES pack_src_rpm $LISTNAMES
export RPMTOPDIR=$RPMDIR/BP export RPMTOPDIR=$RPMDIR/BP
...@@ -325,6 +393,8 @@ for i in $LISTBUILT ; do ...@@ -325,6 +393,8 @@ for i in $LISTBUILT ; do
test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found" test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
# FIXME: do not remove if not repacked # FIXME: do not remove if not repacked
#rm -f $SPKG #rm -f $SPKG
alt_tolocal $SPECNAME altspec_to_local $SPECNAME
$BUILDCOMMAND $LISTRPMARGS $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build"
done done
...@@ -85,6 +85,14 @@ check_gear_and_tag() ...@@ -85,6 +85,14 @@ check_gear_and_tag()
{ {
local GEARCTAG=gear-create-tag local GEARCTAG=gear-create-tag
# FIXME: uncomment use-agent in ~/.gnupg/gpg.conf, but with ssh access to build server I got
# gpg: problem with the agent - disabling agent use
# gpg: Invalid passphrase; please try again ...
# gpg tries to use the agent but will fallback to the regular mode
# if there is a problem connecting to the agent.
# GPG_AGENT_INFO=
# set SPECDIR from LISTNAMES if empty # set SPECDIR from LISTNAMES if empty
[ -n "$SPECDIR" ] || set_specdir $LISTNAMES [ -n "$SPECDIR" ] || set_specdir $LISTNAMES
...@@ -161,6 +169,8 @@ fi ...@@ -161,6 +169,8 @@ fi
# set SPECDIR from LISTNAMES if empty # set SPECDIR from LISTNAMES if empty
[ -n "$SPECDIR" ] || set_specdir $LISTNAMES [ -n "$SPECDIR" ] || set_specdir $LISTNAMES
set_binaryrepo $MENV
# If we build from gear repo, run task # If we build from gear repo, run task
if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
echo "Run with gear repo..." echo "Run with gear repo..."
...@@ -172,11 +182,9 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then ...@@ -172,11 +182,9 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
if [ -n "$TASKNUMBER" ] ; then if [ -n "$TASKNUMBER" ] ; then
ssh $GIRARHOST task add $TASKNUMBER repo $BASENAME $TAG ssh $GIRARHOST task add $TASKNUMBER repo $BASENAME $TAG
else else
ssh $GIRARHOST task new ssh $GIRARHOST build -b $BINARYREPO $BASENAME $TAG
ssh $GIRARHOST task add repo $BASENAME $TAG || ssh $GIRARHOST task rm
ssh $GIRARHOST task run
fi fi
echo "run task $BASENAME with tag $TAG at $GIRARHOST ($MENV) at `date "+%c"`" >>$RPMDIR/uploaded.log echo "run task $BASENAME with tag $TAG at $GIRARHOST (in $BINARYREPO) at `date "+%c"`" >>$RPMDIR/uploaded.log
exit exit
fi fi
...@@ -199,10 +207,6 @@ if [ -n "$REMOTEBUILD" ] ; then ...@@ -199,10 +207,6 @@ if [ -n "$REMOTEBUILD" ] ; then
exit 0 exit 0
fi fi
#set_incoming $MENV
set_binaryrepo $MENV
if [ -n "${DELETENOW}" ]; then if [ -n "${DELETENOW}" ]; then
echog "Removing did not realized yet" echog "Removing did not realized yet"
exit 1 exit 1
......
...@@ -85,16 +85,16 @@ set_specdir $LISTNAMES ...@@ -85,16 +85,16 @@ set_specdir $LISTNAMES
if [ -n "$REMOTEBUILD" ] ; then if [ -n "$REMOTEBUILD" ] ; then
check_key check_key
test -n "$BUILDSERVER" || fatal "Please set BUILDSERVER in config file" test -n "$BUILDSERVER" || fatal "Please set BUILDSERVER in config file"
# FIXME - get via etersoft-build-utils
test -n "$REMOTERPMDIR" || REMOTERPMDIR=`ssh $BUILDSERVER echo $HOME`/RPM test -n "$REMOTERPMDIR" || REMOTERPMDIR=`ssh $BUILDSERVER echo $HOME`/RPM
LISTSRPM="$(echo $LISTBUILT | xargs -n1 basename)"
echo echo
echog "############ Build at build server '$BUILDSERVER' (with $LISTRPMARGS options) ############" echog "############ Build at build server '$BUILDSERVER' (with $LISTRPMARGS options) ############"
echo echo
echog "==== Copying to build server =====" echog "==== Copying to build server ====="
# FIXME: do not change dir? Why LISTBUILT is not full path?
#cd $RPMTOPDIR/SRPMS
rsync -vay --partial --progress --checksum \ rsync -vay --partial --progress --checksum \
-e ssh $LISTBUILT $BUILDSERVER:$REMOTERPMDIR/SRPMS/ || fatal "Error with rsync" -e ssh $LISTBUILT $BUILDSERVER:$REMOTERPMDIR/SRPMS/ || fatal "Error with rsync"
ssh -t $BUILDSERVER "cd $REMOTERPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTBUILT" ssh -t $BUILDSERVER "cd $REMOTERPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTSRPM"
RESULT=$? RESULT=$?
date date
echo "-------------------------------" echo "-------------------------------"
......
...@@ -152,13 +152,14 @@ phelp() ...@@ -152,13 +152,14 @@ phelp()
echog "$Descr" echog "$Descr"
echog "$Usage" echog "$Usage"
echog "Options:" echog "Options:"
echog "rpmgp [-a -c -n] [system] pkgname - download src.rpm from 'system' repository to RPM/SRPMS and install it" echog "rpmgp [options] [system] pkgname - download src.rpm from 'system' repository to RPM/SRPMS and install it"
echog " name - installed package name or src.rpm" echog " name - installed package name or src.rpm"
echog " system - name of system (ALT Linux by default if -a missed too)" echog " system - name of system (ALT Linux by default if -a missed too)"
echog " -a search pkgname in all known repositories" echog " -a search pkgname in all known repositories"
echog " -b install packages needed for build (use sudo apt-get) (need spec not package name)" echog " -b install packages needed for build (use sudo apt-get) (need spec not package name)"
echog " -c check if this package exists in the ALT Linux repository" echog " -c check if this package exists in the ALT Linux repository"
echog " -d download all matched packages" echog " -d download all matched packages"
echog " -g remote clone repo to USER/packages and clone it locally"
echog " -l list packages needed for build (in local pkg system notation) (experimental)" echog " -l list packages needed for build (in local pkg system notation) (experimental)"
echog " -n do not install after download, just download in current dir" echog " -n do not install after download, just download in current dir"
echog " -r refresh package list (download it again)" echog " -r refresh package list (download it again)"
...@@ -167,13 +168,14 @@ phelp() ...@@ -167,13 +168,14 @@ phelp()
} }
TRYINST="1" TRYINST="1"
while getopts :habcdlnrs opt; do while getopts :habcdglnrs opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
a) ALLSYSTEM=1 ;; a) ALLSYSTEM=1 ;;
b) INSTALLBINARY=1 ;; b) INSTALLBINARY=1 ;;
c) CHECKONLINE=1 ;; c) CHECKONLINE=1 ;;
d) DOWNLOADALL=1 ;; d) DOWNLOADALL=1 ;;
g) CLONEGIT=1 ;;
l) LISTREQS=1 ;; l) LISTREQS=1 ;;
n) TRYINST="" ;; n) TRYINST="" ;;
r) UPDATECACHE=1 ;; r) UPDATECACHE=1 ;;
...@@ -229,9 +231,30 @@ if [ -n "$INSTALLBINARY" ] ; then ...@@ -229,9 +231,30 @@ if [ -n "$INSTALLBINARY" ] ; then
exit 0 exit 0
fi fi
# clone remote git
if [ -n "$CLONEGIT" ] ; then
PKGNAME=$1
INITLETTER=$(echo $PKGNAME | sed "s/^\(.\).*/\1/g")
# http://git.altlinux.org/srpms/N/NAME.git
echo "Remote clone from /srpms/$INITLETTER/$PKGNAME.git ..."
ssh $GIRARHOST clone /srpms/$INITLETTER/$PKGNAME.git packages/$PKGNAME.git || warning "Can't remote clone."
git clone git.alt:packages/$PKGNAME.git
if cd $PKGNAME ; then
CURRENTBRANCH=$(get_current_branch)
for i in $(git branch -a | grep "remotes/origin/.*[0-9]\$") ; do
git checkout -b $(echo $i | sed -e "s|remotes.*/||g") $i
done
git checkout $CURRENTBRANCH
cd - >/dev/null
fi
echo "See other repos at $GIRARHOST:"
list_git_package $PKGNAME
exit 0
fi
# lists packages for build # lists packages for build
if [ -n "$LISTREQS" ] ; then if [ -n "$LISTREQS" ] ; then
print_target_buildreq $1 print_target_buildreq $PKGNAME
exit 0 exit 0
fi fi
...@@ -262,6 +285,9 @@ if [ -n "$CHECKONLINE" ] ; then ...@@ -262,6 +285,9 @@ if [ -n "$CHECKONLINE" ] ; then
fi fi
fi fi
list_git_package $PKGNAME list_git_package $PKGNAME
# TODO: BINARYREPO
echo -n "ACL list for sisyphus: "
ssh $GIRARHOST acl sisyphus $PKGNAME show
RET="MISSED" RET="MISSED"
if [ -n "$SRCRPM" ] ; then if [ -n "$SRCRPM" ] ; then
......
/*
* This is the main configuration file for the APT suite of tools,
* see apt.conf(5) for details.
*/
Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty";
Dir::Etc::sourcelist "/etc/eterbuild/apt/sources.list.M42";
# Package repository URLs
#
# You can add [alt] after rpm for digital signature check
rpm file:/var/ftp/ pub/ALTLinux/4.2/branch/i586 classic
rpm file:/var/ftp/ pub/ALTLinux/4.2/branch/noarch classic
#rpm file:/var/ftp/ pub/ALTLinux/updates/4.1/i586 updates
#rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports
...@@ -73,3 +73,6 @@ ...@@ -73,3 +73,6 @@
# username on $GIRARHOST host # username on $GIRARHOST host
# GIRAR_USER=lav # GIRAR_USER=lav
# Skip error if there are unpackaged files in the build
#NOSTRICT_UNPACKAGED=1
Name: etersoft-build-utils Name: etersoft-build-utils
Version: 1.7.0 Version: 1.7.4
Release: alt1 Release: alt1
Summary: A set of build rpm utilities Summary: A set of build rpm utilities
...@@ -64,6 +64,30 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl ...@@ -64,6 +64,30 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
%config(noreplace) %_sysconfdir/eterbuild/repos %config(noreplace) %_sysconfdir/eterbuild/repos
%changelog %changelog
* Thu Jan 14 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.4-alt1
- rpmbph: support for branches like 5.1 if exists, instead M51
- rpmgp: clone all branches locally
- rpmbsh: fix remote src.rpm build from rpmbph
- gpush: push to all remote repos like git.*
- loginhsh: add -o option for run as root
* Wed Jan 13 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.3-alt1
- rpmgp: add acl list printing
- gpush: push without branch if --all
- rpmbph: do not insert fix for fuzzy patch in any case
- rpmgp: add -g option for remote and locally repo clone
* Fri Jan 08 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.2-alt1
- rpmbph: realize gear repo backporting (eterbug #4766)
- myhsh: drop out backport related defines (it will be placed in the spec by rpmbph)
- gpush: push current branch definitely
- rpmbs: fix task build on various repos
* Fri Jan 08 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.1-alt1
- myhsh: error if there are unpackaged files in the build
- rpmgp: improve package checking (support non installed packages)
- use sources.list from /etc/eterbuild if apt.conf in /etc/eterbuld too
* Sun Jan 03 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.0-alt1 * Sun Jan 03 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.0-alt1
- check_publish.sh: add check for exist git repo, list acl for package if it in git - check_publish.sh: add check for exist git repo, list acl for package if it in git
- config: add GEAR_USER - config: add GEAR_USER
......
...@@ -40,6 +40,8 @@ REMOTERPMDIR= ...@@ -40,6 +40,8 @@ REMOTERPMDIR=
HASHERDIR="$HOME/hasher" HASHERDIR="$HOME/hasher"
HASHER_NOCHECK=nvr,gpg,packager,buildtime HASHER_NOCHECK=nvr,gpg,packager,buildtime
HASHERARG="--eager-cleanup" HASHERARG="--eager-cleanup"
# for use in help as example branch/distro name
CURRENTBRANCHNAME="M51"
[ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG" [ -n "$DEBUG" ] && HASHERARG="-v $HASHERARG"
RSYNCSISYPHUS=rsync.altlinux.org::ALTLinux/Sisyphus RSYNCSISYPHUS=rsync.altlinux.org::ALTLinux/Sisyphus
......
...@@ -20,6 +20,27 @@ get_current_branch() ...@@ -20,6 +20,27 @@ get_current_branch()
git branch | grep '^\*' | sed 's/^..//' | tr -d "\n" git branch | grep '^\*' | sed 's/^..//' | tr -d "\n"
} }
get_root_git_dir()
{
# FIXME
if [ -d ../.git ] ; then
readlink -f $(pwd)/..
return
fi
pwd
}
get_remote_git_list()
{
local i
for i in $(git remote | uniq) ; do
if is_girar_name $i ; then
echo $i
fi
done
}
# Check if $1 like git.alt or git.eter, git.something # Check if $1 like git.alt or git.eter, git.something
is_girar_name() is_girar_name()
{ {
......
...@@ -30,17 +30,21 @@ print_tmp_aptconf() ...@@ -30,17 +30,21 @@ print_tmp_aptconf()
sed -e "s|\".*/sources.list|\"$OURTMPDIR/sources.list|g" sed -e "s|\".*/sources.list|\"$OURTMPDIR/sources.list|g"
} }
# printout sources.list with filtering # printout sources.list with filtering from apt.conf
# workaround about hard coded arch in sources.list # workaround about hard coded arch in sources.list
print_tmp_sourceslist() print_tmp_sourceslist()
{ {
local SLIST local SLIST
test -r "$1" || fatal "$1 is missed" test -r "$1" || fatal "$1 is missed"
# Note: /etc/apt and /etc/eterbuild/apt is supported # Note: /etc/apt and /etc/eterbuild/apt is supported
SLIST=`cat "$1" | \ if echo $1 | grep -q "^/etc" ; then
sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g" | \ SLIST=`cat "$1" | \
grep "/sources.list" | sed -e 's|.*"\(.*\)".*|\1|g'` grep "/sources.list" | sed -e 's|.*"\(.*\)".*|\1|g'`
#SLIST="$ETERBUILDETC/apt/`basename $SLIST`" else
SLIST=`cat "$1" | \
sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g" | \
grep "/sources.list" | sed -e 's|.*"\(.*\)".*|\1|g'`
fi
test -r "$SLIST" || fatal "'$SLIST' - sources.list path from $1 is missed" test -r "$SLIST" || fatal "'$SLIST' - sources.list path from $1 is missed"
cat "$SLIST" | \ cat "$SLIST" | \
sed -e "s|i586|$DEFAULTARCH|g" sed -e "s|i586|$DEFAULTARCH|g"
...@@ -54,7 +58,8 @@ prepare_aptconfig() ...@@ -54,7 +58,8 @@ prepare_aptconfig()
print_tmp_sourceslist $APTCONF >$OURSOURCES || fatal "Can't create sources.list" print_tmp_sourceslist $APTCONF >$OURSOURCES || fatal "Can't create sources.list"
if [ -n "$ETERBUILD_APTREPO" ] ; then if [ -n "$ETERBUILD_APTREPO" ] ; then
cat <<EOF >>$OURSOURCES cat <<EOF >>$OURSOURCES
# Apply repo from $ETERBUILD_APTREPO variable
# Apply repo(s) from ETERBUILD_APTREPO variable
$ETERBUILD_APTREPO $ETERBUILD_APTREPO
EOF EOF
fi fi
......
...@@ -5,3 +5,5 @@ libslang2-devel|libslang-devel ...@@ -5,3 +5,5 @@ libslang2-devel|libslang-devel
libesd-devel|esound-devel libesd-devel|esound-devel
sysvinit-utils| sysvinit-utils|
xorg-sdk|xorg-x11-devel xorg-sdk|xorg-x11-devel
libgif-devel|libungif-devel
libgif|libungif
libfreeglut|freeglut libfreeglut|freeglut
libfreeglut-devel|freeglut-devel libfreeglut-devel|freeglut-devel
libesd-devel|esound-devel libesd-devel|esound-devel
libgif-devel|libungif-devel
libgif|libungif
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod git
get_remote_git_list
#!/bin/sh
PROJECT=etersoft-build-utils
git push --all $@ git.eter:packages/$PROJECT.git
git push --all $@ git.alt:packages/$PROJECT.git
git push --tags $@ git.eter:packages/$PROJECT.git
git push --tags $@ git.alt:packages/$PROJECT.git
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