Commit e59a65df authored by Vitaly Lipatov's avatar Vitaly Lipatov

drop RSYNCSISYPHUS var, rewrite -c handling, add support for any branch

parent bcbf3020
...@@ -10,10 +10,7 @@ ...@@ -10,10 +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 rpm repl git rpm web load_mod rpm repl git rpm web repos
# path to ALT Linux's repositories
REPOSITORY="files/SRPMS obsolete orphaned"
# loads repos file and fill SYSNAME and SYSURL arrays # loads repos file and fill SYSNAME and SYSURL arrays
load_systems_list() load_systems_list()
...@@ -264,7 +261,7 @@ if [ -n "$CLONEGIT" ] ; then ...@@ -264,7 +261,7 @@ if [ -n "$CLONEGIT" ] ; then
ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone." ssh $GIRARHOST clone $RREPO packages/$PKGNAME.git || warning "Can't remote clone."
fi fi
git clone git.alt:packages/$PKGNAME.git git clone $GIRARHOST:packages/$PKGNAME.git
if cd $PKGNAME ; then if cd $PKGNAME ; then
CURRENTBRANCH=$(get_current_branch) CURRENTBRANCH=$(get_current_branch)
# create all branches # create all branches
...@@ -294,7 +291,8 @@ if [ -n "$CHECKONLINE" ] ; then ...@@ -294,7 +291,8 @@ if [ -n "$CHECKONLINE" ] ; then
SRCRPM=$NAMESRPMIN SRCRPM=$NAMESRPMIN
PKGNAME=$(get_pkgname_from_filename $SRCRPM) PKGNAME=$(get_pkgname_from_filename $SRCRPM)
else else
if echo $PKGNAME | grep -q rpm ; then if echo $PKGNAME | grep -q "\.rpm" ; then
# possible it is rpm package name
SRCRPM=$PKGNAME SRCRPM=$PKGNAME
PKGNAME=$(get_pkgname_from_filename $SRCRPM) PKGNAME=$(get_pkgname_from_filename $SRCRPM)
else else
...@@ -310,24 +308,35 @@ if [ -n "$CHECKONLINE" ] ; then ...@@ -310,24 +308,35 @@ if [ -n "$CHECKONLINE" ] ; then
echog "There is no git repo $GITURL" echog "There is no git repo $GITURL"
fi fi
fi fi
echo "Get repositories at $GIRARHOST:"
list_git_package $PKGNAME list_git_package $PKGNAME
set_binaryrepo $MENV set_binaryrepo $MENV
echo -n "ACL list for $BINARYREPO: " echo -n "ACL list for $GIRARHOST $BINARYREPO: "
ssh $GIRARHOST acl $BINARYREPO $PKGNAME show ssh $GIRARHOST acl $BINARYREPO $PKGNAME show
RET="MISSED" RET="MISSED"
if [ -n "$SRCRPM" ] ; then if [ -n "$SRCRPM" ] ; then
for i in $REPOSITORY ; do RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
echog "Checking '$SRCRPM' in repository $i ..." echog "Checking '$PKGNAME' in '$RSYNCPATH' ..."
rsync -n --progress $RSYNCSISYPHUS/$i/$SRCRPM >/dev/null 2>&1 && { RET=$i; break; } if $RSYNC -n $RSYNCPATH/files/SRPMS/$SRCRPM 2>/dev/null | grep $PKGNAME ; then
done RET=OK
echog "Repository Filename" echo "Package $SRCRPM is the latest version from $RSYNCPATH"
printf "%-12s %30s\n" $RET $SRCRPM else
# upstream version difference, just printout list
RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
$RSYNC -n "$RSYNCPATH/files/SRPMS/$PKGNAME-[0-9]*" 2>/dev/null | grep $PKGNAME || echo "Package $PKGNAME is missed"
echo "Local package $SRCRPM differs from the latest version from $RSYNCPATH"
fi
else
SRCRPM="$PKGNAME-[0-9]*"
RSYNCPATH=$(get_rsync_path $GIRARHOST $BINARYREPO)
echog "Checking '$SRCRPM' in '$RSYNCPATH' ..."
$RSYNC -n $RSYNCPATH/files/SRPMS/$SRCRPM 2>/dev/null | grep $PKGNAME
echo "Package '$PKGNAME' is not installed locally"
fi fi
if [ "$RET" = "MISSED" ] ; then [ "$RET" = "OK" ]
exit 1 exit
fi
exit 0
fi fi
# FIXME: use mygetopts (LISTRPMARGS and so) # FIXME: use mygetopts (LISTRPMARGS and so)
...@@ -366,20 +375,4 @@ if [ -n "$ALLSYSTEM" ] ; then ...@@ -366,20 +375,4 @@ if [ -n "$ALLSYSTEM" ] ; then
exit 0 exit 0
fi fi
if [ -z "${1/*src.rpm/}" ] fatal "Support for get src.rpm from ALT rsync removed. Use rpmgp with -g option"
then
# it is src.rpm package
SRCRPM=$1
else
SRCRPM=$(querypackage $1 "" "%{SOURCERPM}\n")
fi
test -z "$SRCRPM" && fatal "Cannon find package for $1"
echog "Try to download $SRCRPM to $(pwd)"
for i in $REPOSITORY
do
echo "--------Check in $i-----------"
rsync -vay --partial --checksum --copy-links \
--delete-after --progress $RSYNCSISYPHUS/$i/$SRCRPM ./$SRCRPM && break
done
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
# Каталог для записи протоколов сборки # Каталог для записи протоколов сборки
#LOGDIR=$RPMDIR/log #LOGDIR=$RPMDIR/log
# Rsync path for get packages from Sisyphus
#RSYNCSISYPHUS=rsync.altlinux.org::ALTLinux/Sisyphus
# Базовый SSH-путь для отправки пакетов # Базовый SSH-путь для отправки пакетов
#RSYNCINCOMING=incoming:/incoming #RSYNCINCOMING=incoming:/incoming
......
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