2011-05-04 02:31:45 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# autoport -- batch cross-build tool based on autodist
|
2012-04-26 15:11:10 +02:00
|
|
|
# Copyright (C) 2011-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
2011-05-04 02:31:45 +02:00
|
|
|
#
|
|
|
|
# Released under the terms of the GNU GPL release 3 license
|
|
|
|
#
|
2013-05-21 12:39:01 +02:00
|
|
|
VERSION=0.9.6
|
2011-05-04 02:31:45 +02:00
|
|
|
BASE_ARCH=i586
|
|
|
|
BASE_REPOSITORY=devel
|
|
|
|
PORT_REPOSITORY=devel
|
|
|
|
|
|
|
|
. /etc/autodist/config
|
|
|
|
|
|
|
|
me=(${0##*/} $VERSION "Sat Mar 20 2011")
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo "\
|
|
|
|
${me[0]} ${me[1]}
|
2012-04-26 15:11:10 +02:00
|
|
|
"$"Copyright (C) 2011-2012 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
2011-05-04 02:31:45 +02:00
|
|
|
"$"Released under the terms of the GNU GPL v3 license"
|
|
|
|
echo "
|
|
|
|
"$"Batch port and cross-build tool based on autodist.""
|
|
|
|
|
|
|
|
"$"Usage"":
|
|
|
|
$me [-a][-f][-x arch1[,arch2],..][-r repository][-d release_repository]{--fix|job ...}
|
|
|
|
|
|
|
|
-a "$"Automatic mode (use cache)
|
|
|
|
-b "$"Batch port all packages in port repository to sync with base repository
|
|
|
|
-f "$"Force operations
|
2012-03-13 16:08:14 +01:00
|
|
|
-np "$"Don't prepare jobs passed to command line unless specfile is not found
|
|
|
|
-npa "$"Don't prepare any jobs unless specfile is not found
|
2011-05-04 02:31:45 +02:00
|
|
|
-nr "$"Don't recurse build
|
|
|
|
--fix "$"Fix .la files for cross linking and exit
|
|
|
|
-r "$"Work on given repository (default: $PORT_REPOSITORY)
|
|
|
|
-d "$"Release packages to given repository (default: $PORT_REPOSITORY)
|
|
|
|
-h "$"Show this help and exit
|
2012-11-20 00:00:51 +01:00
|
|
|
-u changelog "$"Rebuild packages with given changelog
|
2011-05-04 02:31:45 +02:00
|
|
|
-v "$"More verbose output
|
2012-11-20 00:00:51 +01:00
|
|
|
-x "$"Operate in cross build mode
|
2011-05-04 02:31:45 +02:00
|
|
|
|
|
|
|
arch "$"Target architecture
|
|
|
|
job "$"Job specification for autodist""
|
|
|
|
"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-10-18 00:57:43 +02:00
|
|
|
function autoport_log() {
|
|
|
|
local pkg=$1
|
|
|
|
local operation=$2
|
|
|
|
local result=$3
|
2013-05-04 15:40:10 +02:00
|
|
|
local loggrep=`grep "?= See" $4 | sed "s|?= See ||"`
|
|
|
|
local logfiles=""
|
2012-10-18 00:57:43 +02:00
|
|
|
|
2013-05-04 15:40:10 +02:00
|
|
|
for f in $loggrep; do
|
|
|
|
logfiles="$logfiles $f"
|
|
|
|
done
|
2012-11-20 00:00:51 +01:00
|
|
|
[ "$pkg" -a "$operation" -a "$result" -a "$BATCH_MODE" ] || return
|
2013-05-04 15:40:10 +02:00
|
|
|
echo "$pkg $operation $result $logfiles" >> $DATADIR/autoport-$PORT_REPOSITORY-current
|
2012-10-18 00:57:43 +02:00
|
|
|
}
|
2012-09-10 17:41:15 +02:00
|
|
|
|
|
|
|
# for webbuild message
|
|
|
|
function cgi_encodevar() {
|
|
|
|
local string="${1}"
|
|
|
|
local strlen=${#string}
|
|
|
|
local encoded=""
|
|
|
|
|
|
|
|
for (( pos=0 ; pos<strlen ; pos++ )); do
|
|
|
|
c=${string:$pos:1}
|
|
|
|
case "$c" in
|
|
|
|
[-_.~a-zA-Z0-9] ) o="${c}" ;;
|
|
|
|
* ) printf -v o '%%%02x' "'$c"
|
|
|
|
esac
|
|
|
|
encoded+="${o}"
|
|
|
|
done
|
|
|
|
echo "${encoded}" # You can either set a return variable (FASTER)
|
|
|
|
# REPLY="${encoded}" #+or echo the result (EASIER)... or both... :p
|
|
|
|
}
|
|
|
|
|
2013-05-19 16:50:59 +02:00
|
|
|
function get_pkg_srcinfo() {
|
|
|
|
|
|
|
|
local pkg local_distromatic pkg_line
|
|
|
|
|
|
|
|
unset src_name src_version src_buildtime src_repository src_epoch src_release
|
|
|
|
|
|
|
|
[ $1 ] && local_distromatic=$1 || exit 1
|
|
|
|
[ $2 ] && pkg=$2 || return 1
|
|
|
|
|
|
|
|
[ -e $local_distromatic/srcpkglist ] || return 2
|
|
|
|
|
|
|
|
pkg_line=`grep "^$pkg " $local_distromatic/srcpkglist`
|
|
|
|
[ "$pkg_line" ] || return 3
|
|
|
|
|
|
|
|
set -- $pkg_line
|
|
|
|
|
|
|
|
src_name=$1
|
|
|
|
src_version=$2
|
|
|
|
src_buildtime=$3
|
|
|
|
src_repository=$4
|
|
|
|
src_epoch=$5
|
|
|
|
src_release=$6
|
|
|
|
src_milestone=`echo $src_release | sed "s|[0-9.]*\(.*\)|\1|"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-05-04 02:31:45 +02:00
|
|
|
# get_pkg_buildinfo - uses distromatic generated build file for
|
|
|
|
# getting information on the repository
|
|
|
|
#
|
|
|
|
# $1: distromatic files base url for repository
|
|
|
|
# $2: architecture
|
|
|
|
# $3: pkg name
|
|
|
|
function get_pkg_buildinfo() {
|
|
|
|
|
|
|
|
local pkg i a local_arch local_distromatic
|
|
|
|
|
|
|
|
[ $1 ] && local_distromatic=$1 || exit 1
|
|
|
|
[ $2 ] && local_arch=$2 || exit 1
|
|
|
|
[ $3 ] && pkg=$3
|
|
|
|
|
|
|
|
if [ ! "$pkg" ]; then
|
|
|
|
[ -e $local_distromatic/builds-${local_arch}.sh ] && . $local_distromatic/builds-${local_arch}.sh
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
pkg_archs=();
|
|
|
|
for a in ${archs[*]}; do
|
2012-05-10 13:42:05 +02:00
|
|
|
[ "$a" = "${local_arch}" ] && continue
|
2011-05-04 02:31:45 +02:00
|
|
|
pkg_header=();
|
|
|
|
DISTROMATIC_BUILD_FILE=$local_distromatic/builds-$a.sh
|
|
|
|
[ -e $DISTROMATIC_BUILD_FILE ] && . $DISTROMATIC_BUILD_FILE
|
|
|
|
[ ${pkg_header[0]} ] && pkg_archs=(${pkg_archs[*]} $a)
|
|
|
|
done
|
|
|
|
|
|
|
|
pkg_header=();
|
|
|
|
pkg_builds=();
|
|
|
|
pkg_obsoletes=();
|
|
|
|
pkg_list=();
|
|
|
|
|
|
|
|
DISTROMATIC_BUILD_FILE=$local_distromatic/builds-${local_arch}.sh
|
|
|
|
[ -e $DISTROMATIC_BUILD_FILE ] && . $DISTROMATIC_BUILD_FILE
|
2012-05-10 13:42:05 +02:00
|
|
|
[ ${pkg_header[0]} ] && pkg_archs=(${pkg_archs[*]} ${local_arch})
|
2011-05-04 02:31:45 +02:00
|
|
|
|
|
|
|
# {
|
|
|
|
# echo "Error: missing distromatic generated file $DISTROMATIC_BUILD_FILE; aborting."
|
|
|
|
# return;
|
|
|
|
# }
|
|
|
|
# . $DISTROMATIC_BUILD_FILE
|
|
|
|
|
|
|
|
for i in ${pkg_list[*]}; do
|
|
|
|
if [ "$i" == "${pkg_header[0]}" ]; then
|
|
|
|
pkg_name=${pkg_header[0]};
|
|
|
|
# Note: pkg_arch reported in builds file is just last arch source was
|
|
|
|
# built for, so we use repository arch instead
|
|
|
|
pkg_arch=${pkg_header[1]};
|
|
|
|
[ "$pkg_arch" = "noarch" ] || pkg_arch=${local_arch}
|
|
|
|
pkg_version=${pkg_header[2]};
|
|
|
|
pkg_release=${pkg_header[3]};
|
|
|
|
pkg_group=${pkg_header[4]};
|
|
|
|
pkg_license=${pkg_header[5]};
|
|
|
|
pkg_size=${pkg_header[6]};
|
|
|
|
pkg_buildtime=${pkg_header[7]};
|
|
|
|
pkg_altrep=${pkg_header[8]};
|
|
|
|
pkg_repository=${pkg_header[9]};
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
unset pkg_name pkg_arch pkg_version pkg_release \
|
|
|
|
pkg_group pkg_license pkg_size pkg_buildtime pkg_altrep pkg_repository
|
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function write_last_file() {
|
|
|
|
[ "$AUTO_MODE" == "1" ] && LASTFILE=$DATADIR/last || LASTFILE=$DATADIR/lastmanual
|
|
|
|
cat > $LASTFILE << _EOF
|
|
|
|
JOB_CANTPREPARE=(${JOB_CANTPREPARE[*]})
|
|
|
|
JOB_MISSINGREQ=(${JOB_MISSINGREQ[*]})
|
|
|
|
JOB_SENT=(${JOB_SENT[*]})
|
|
|
|
JOB_CANTINSTAL=(${JOB_CANTINSTALL[*]})
|
|
|
|
JOB_COMPLETED=(${JOB_COMPLETED[*]})
|
|
|
|
JOB_FAILED=(${JOB_FAILED[*]})
|
|
|
|
_EOF
|
|
|
|
}
|
|
|
|
|
2012-04-26 15:11:10 +02:00
|
|
|
function find_source_by_provide() {
|
|
|
|
local pkg=`echo $2 | sed "s|(|\\\\\[|g;s|)|\\\\\]|g;s|:|_|g"`
|
|
|
|
grep "^$pkg:" $DATADIR/$1/sources-$BASE_ARCH | \
|
|
|
|
awk '{ $1=""; print $0 }' | \
|
|
|
|
sed "s|[[:space:]]_| |g"
|
|
|
|
}
|
|
|
|
|
2011-05-04 02:31:45 +02:00
|
|
|
function find_requirements() {
|
|
|
|
[ "$1" ] || return 1
|
|
|
|
local tf=`mktemp` || {
|
|
|
|
echo "Error: cannot create tempfile"
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
local tf1=`mktemp`
|
|
|
|
local OUTFILE=$1
|
|
|
|
|
|
|
|
if [ "`grep " is needed by " $OUTFILE`" ]; then
|
|
|
|
grep " is needed by " $OUTFILE | awk '{ print $1 }' | sort -u > $tf1
|
|
|
|
elif [ "`grep " matches no packages" $OUTFILE`" ]; then
|
|
|
|
grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' | sort -u > $tf1
|
|
|
|
elif [ "`grep " no package provides " $OUTFILE`" ]; then
|
|
|
|
grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" | sort -u > $tf1
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ `stat -c %s $tf1` -gt 0 ] && {
|
|
|
|
echo -n " | missing requirements: "
|
|
|
|
> $tf
|
|
|
|
cat $tf1 | while read line; do
|
2012-04-26 15:11:10 +02:00
|
|
|
REQ=`find_source_by_provide $PORT_REPOSITORY $line`
|
2011-05-04 02:31:45 +02:00
|
|
|
[ "$REQ" ] && \
|
2012-04-26 15:11:10 +02:00
|
|
|
echo "${REQ}" >> $tf || \
|
2011-05-04 02:31:45 +02:00
|
|
|
echo -n "$line(unresolved) "
|
|
|
|
done
|
|
|
|
> $tf1
|
|
|
|
cat $tf | sort -u 2>/dev/null | while read line; do
|
|
|
|
if [ "`echo " ${JOB[*]} ${JOB_MISSINGREQ[*]} ${JOB_CANTINSTALL[*]} " | grep " $line "`" ]; then
|
|
|
|
echo -n "($line) "
|
|
|
|
else
|
|
|
|
echo -n "$line "
|
|
|
|
echo -n "$line " >> $tf1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
JOB_MISSINGREQ=(${JOB_MISSINGREQ[*]} `cat $tf1`)
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
rm -f $tf $tf1
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
[ $# -gt 0 ] || { usage ; exit 1; }
|
|
|
|
|
|
|
|
BUILD_ARCH=`uname -i`
|
|
|
|
|
|
|
|
case $BUILD_ARCH in
|
|
|
|
i386|i486|i686) BUILD_ARCH=i586 ;;
|
|
|
|
arm*) BUILD_ARCH=arm ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
TARGET_ARCHS=$BUILD_ARCH
|
|
|
|
JOB_CMDLINE=()
|
|
|
|
CROSS_MODE=
|
|
|
|
|
|
|
|
for ((i=1; i<=$#; i++)); do
|
|
|
|
case ${!i} in
|
|
|
|
-a) AUTO_MODE=1 ;;
|
|
|
|
-b) BATCH_MODE=1 ;;
|
|
|
|
-f) FORCE_MODE=1 ;;
|
|
|
|
-v) VERBOSE_MODE=1 ;;
|
2012-11-20 00:00:51 +01:00
|
|
|
-u) REBUILD_MODE=1
|
|
|
|
shift
|
|
|
|
REBUILD_CHANGELOG="${!i}"
|
|
|
|
[ "$REBUILD_CHANGELOG" ] || {
|
|
|
|
echo "ERROR: changelog not given as -u option parameter; aborting."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
;;
|
2012-03-13 16:08:14 +01:00
|
|
|
-npa) DONT_PREPARE_ANY=1
|
|
|
|
DONT_PREPARE=1 ;;
|
2011-05-04 02:31:45 +02:00
|
|
|
-np) DONT_PREPARE=1 ;;
|
|
|
|
-nr) DONT_RECURSE=1 ;;
|
|
|
|
--fix) FIX_MODE=1 ;;
|
|
|
|
-r) shift
|
|
|
|
PORT_REPOSITORY="${!i}"
|
|
|
|
;;
|
|
|
|
-d) shift
|
|
|
|
DEST_REPOSITORY="${!i}"
|
|
|
|
;;
|
|
|
|
-x) shift
|
|
|
|
TARGET_ARCHS="`echo ${!i} | tr , ' '`"
|
|
|
|
CROSS_MODE=1
|
|
|
|
;;
|
|
|
|
-h|--help)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*) JOB_CMDLINE=(${JOB_CMDLINE[*]} ${!i})
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
[ "$DEST_REPOSITORY" ] || DEST_REPOSITORY=$PORT_REPOSITORY
|
|
|
|
|
|
|
|
for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|
|
|
|
|
|
|
[ "$BASE_ARCH" = "$TARGET_ARCH" -a "$PORT_REPOSITRY" = "$DEST_REPOSITORY" ] && {
|
|
|
|
echo "Error: base and target arch ($BASE_ARCH) are the same as well as port and release repositories ($PORT_REPOSITORY); skipping."
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
archs=($BASE_ARCH $TARGET_ARCH)
|
|
|
|
JOBS_SKIPPED=()
|
|
|
|
JOBS_CANTPREPARE=()
|
|
|
|
JOBS_CANTINSTALL=()
|
|
|
|
JOB_MISSINGREQ=()
|
|
|
|
JOB_COMPLETED=()
|
|
|
|
JOB_FAILED=()
|
|
|
|
|
|
|
|
DATADIR=$HOME/.autoport
|
|
|
|
DATAARCHDIR=$DATADIR/$TARGET_ARCH
|
|
|
|
DISTROMATIC_BASE_URL=${REPS_BASE_URL}/distromatic/
|
|
|
|
BASE_REPOSITORY_DISTROMATIC_URL=${DISTROMATIC_BASE_URL}$BASE_REPOSITORY
|
|
|
|
PORT_REPOSITORY_DISTROMATIC_URL=${DISTROMATIC_BASE_URL}$PORT_REPOSITORY
|
|
|
|
|
|
|
|
[ "$AUTO_MODE" -a -e $DATAARCHDIR/last ] && . $DATAARCHDIR/last
|
|
|
|
JOB=(${JOB_CMDLINE[*]} ${JOB_MISSINGREQ[*]} ${JOB_FAILED[*]})
|
|
|
|
[ "$FIX_MODE" -o "$BATCH_MODE" -o "${JOB[*]}" ] || { usage ; exit 1; }
|
|
|
|
|
|
|
|
[ -d $DATAARCHDIR ] || mkdir -p $DATAARCHDIR
|
|
|
|
[ -d $DATADIR/$BASE_REPOSITORY ] || mkdir -p $DATADIR/$BASE_REPOSITORY
|
|
|
|
[ -d $DATADIR/$PORT_REPOSITORY ] || mkdir -p $DATADIR/$PORT_REPOSITORY
|
|
|
|
|
2012-09-06 18:10:35 +02:00
|
|
|
logdate=`date +"%F@%T"`
|
|
|
|
logfile=$DATAARCHDIR/$logdate.log
|
2012-11-20 00:00:51 +01:00
|
|
|
[ -e $DATAARCHDIR/$PORT_REPOSITORY-current.log ] && mv $DATAARCHDIR/$PORT_REPOSITORY-current.log $DATAARCHDIR/$PORT_REPOSITORY-last.log
|
2011-05-04 02:31:45 +02:00
|
|
|
> $logfile
|
2012-09-10 17:41:15 +02:00
|
|
|
ln -sf $logdate.log $DATAARCHDIR/$PORT_REPOSITORY-current.log
|
2011-05-04 02:31:45 +02:00
|
|
|
|
|
|
|
BUILD_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_build}`
|
|
|
|
BUILD_CPU=`echo $BUILD_PLATFORM | cut -d- -f1`
|
|
|
|
TARGET_PLATFORM=`rpm --target $TARGET_ARCH --eval %{_target_platform}`
|
|
|
|
TARGET_CPU=`echo $TARGET_PLATFORM | cut -d- -f1`
|
|
|
|
SPECDIR=`rpm --eval %{_specdir}`
|
|
|
|
|
|
|
|
echo "Build platform is $BUILD_PLATFORM"
|
|
|
|
echo "Target platform is $TARGET_PLATFORM"
|
|
|
|
echo "Port repository is $PORT_REPOSITORY"
|
|
|
|
echo "Release repository is $DEST_REPOSITORY"
|
|
|
|
|
2013-05-19 16:50:59 +02:00
|
|
|
curl -s ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist -o $DATADIR/$PORT_REPOSITORY/srcpkglist ||
|
|
|
|
echo "Warning: unable to fetch ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
|
2011-05-04 02:31:45 +02:00
|
|
|
curl -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH -o $DATADIR/$PORT_REPOSITORY/sources-$BASE_ARCH ||
|
|
|
|
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH"
|
2013-05-19 16:50:59 +02:00
|
|
|
# rm -f $DATADIR/$PORT_REPOSITORY/sources-$BASE_ARCH
|
|
|
|
# curl -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_CPU -o $DATADIR/$PORT_REPOSITORY/sources-$TARGET_CPU ||
|
|
|
|
# echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_CPU"
|
|
|
|
rm -f $DATADIR/$PORT_REPOSITORY/sources-$TARGET_CPU
|
|
|
|
# curl -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$BASE_ARCH.sh ||
|
|
|
|
# echo "Error: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh"
|
|
|
|
rm -f $DATADIR/$PORT_REPOSITORY/builds-$BASE_ARCH.sh
|
|
|
|
|
2011-05-04 02:31:45 +02:00
|
|
|
curl -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$TARGET_ARCH.sh ||
|
|
|
|
echo "Error: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
|
|
|
|
|
|
|
|
if [ "$BATCH_MODE" ]; then
|
|
|
|
[ "${JOB[*]}" ] && {
|
|
|
|
echo "Error: no jobs allowed in batch mode; aborting."
|
|
|
|
exit 1
|
|
|
|
}
|
2013-05-19 16:50:59 +02:00
|
|
|
# curl -s $BASE_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh -o $DATADIR/$BASE_REPOSITORY/builds-$BASE_ARCH.sh ||
|
|
|
|
# echo "Error: unable to fetch $BASE_REPOSITORY_DISTROMATIC_URL/builds-$BASE_ARCH.sh"
|
|
|
|
rm -f $DATADIR/$BASE_REPOSITORY/builds-$BASE_ARCH.sh
|
|
|
|
# curl -s $BASE_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$BASE_REPOSITORY/builds-$TARGET_ARCH.sh ||
|
|
|
|
# echo "Error: unable to fetch $BASE_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
|
|
|
|
rm -f $DATADIR/$BASE_REPOSITORY/builds-$TARGET_ARCH.sh
|
|
|
|
|
|
|
|
get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH
|
2011-05-04 02:31:45 +02:00
|
|
|
port_pkg_list=${pkg_list[*]}
|
2013-05-19 16:50:59 +02:00
|
|
|
echo "Packages to port: ${needport_list[*]}"
|
|
|
|
for p in ${needport_list[*]}; do
|
|
|
|
JOB=(${JOB[*]} $p)
|
2011-05-04 02:31:45 +02:00
|
|
|
done
|
2012-12-01 23:33:14 +01:00
|
|
|
[ -e $DATADIR/autoport-$PORT_REPOSITORY-current ] && \
|
|
|
|
mv $DATADIR/autoport-$PORT_REPOSITORY-current $DATADIR/autoport-$PORT_REPOSITORY-last
|
2011-05-04 02:31:45 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
step=0
|
|
|
|
tmpfile=`mktemp`
|
|
|
|
tmpfile1=`mktemp`
|
|
|
|
|
|
|
|
[ -e $DATAARCHDIR/sentjobs ] || > $DATAARCHDIR/sentjobs
|
2012-10-18 00:57:43 +02:00
|
|
|
find $DATAARCHDIR/sentjobs -cmin 120 >/dev/null && {
|
2011-05-04 02:31:45 +02:00
|
|
|
> $DATAARCHDIR/sentjobs
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -e $DATAARCHDIR/preparedjobs ] || > $DATAARCHDIR/preparedjobs
|
2012-10-18 00:57:43 +02:00
|
|
|
find $DATAARCHDIR/preparedjobs -ctime 1 >/dev/null && {
|
2011-05-04 02:31:45 +02:00
|
|
|
> $DATAARCHDIR/preparedjobs
|
|
|
|
}
|
|
|
|
|
|
|
|
sudo autoport-fix-environment $TARGET_ARCH
|
|
|
|
|
|
|
|
[ "$FIX_MODE" ] && exit 0
|
|
|
|
|
|
|
|
[ "$FORCE_MODE" ] && FORCE_FLAG="--force"
|
|
|
|
|
|
|
|
while [ "${JOB[*]}" ]; do
|
|
|
|
step=`expr $step + 1`
|
|
|
|
[ "$BATCH_MODE" -a $step -gt $AUTOPORT_MAX_STEPS ] && {
|
|
|
|
echo "Maximum steps count reached for batch mode; exiting. See $logfile for details."
|
|
|
|
break
|
|
|
|
}
|
|
|
|
echo "=========="
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "# Step $step"
|
|
|
|
echo "> Scheduled jobs: ${JOB[*]}"
|
2011-05-04 02:31:45 +02:00
|
|
|
echo
|
|
|
|
JOB_MISSINGREQ_OLD=(${JOB_MISSINGREQ[*]})
|
|
|
|
JOB_MISSINGREQ=()
|
|
|
|
JOB_MAYBEINSTALLED_NEW=()
|
|
|
|
JOB_FAILED_OLD=(${JOB_FAILED[*]})
|
|
|
|
JOB_FAILED=()
|
2012-04-26 15:11:10 +02:00
|
|
|
JOB_CANTINSTALL_OLD=(${JOB_CANTINSTALL[*]})
|
2011-05-04 02:31:45 +02:00
|
|
|
for JOB_NUM in `seq 1 ${#JOB[*]}`; do
|
|
|
|
JOB_CURRENT=${JOB[$JOB_NUM-1]}
|
|
|
|
if [ "`grep "^${JOB_CURRENT}$" /etc/autodist/unstage 2>/dev/null`" -o \
|
|
|
|
"`grep "^${JOB_CURRENT}$" /etc/autodist/unstage.${TARGET_ARCH} 2>/dev/null`" ]; then
|
2012-05-24 16:35:34 +02:00
|
|
|
echo -n "^ $JOB_CURRENT: "
|
2011-05-04 02:31:45 +02:00
|
|
|
STAGEOPTS=
|
|
|
|
else
|
2012-05-24 17:24:33 +02:00
|
|
|
echo -n "^ $JOB_CURRENT(staging): "
|
2011-05-04 02:31:45 +02:00
|
|
|
STAGEOPTS="$AUTOPORT_STAGEVARS"
|
|
|
|
fi
|
|
|
|
if [ "$CROSS_MODE" -a "${JOB_CURRENT:0:5}" == "perl-" ]; then
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "< (SKIPPED) [unable to cross-build perl modules]"
|
2011-05-04 02:31:45 +02:00
|
|
|
JOB_SKIPPED=(${JOB_SKIPPED[*]} $JOB_CURRENT)
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
[ "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/sentjobs`" -a ! "$FORCE_MODE" ] && {
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "< (SKIPPED) [already sent]"
|
2011-05-04 02:31:45 +02:00
|
|
|
JOB_SKIPPED=(${JOB_SKIPPED[*]} $JOB_CURRENT)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if [ "${JOB_MAYBEINSTALLED_NEW[*]}" = "" -a \
|
|
|
|
"${JOB_MISSINGREQ_OLD[*]}" != "" -a \
|
|
|
|
"`echo "( ${JOB_FAILED_OLD[*]} )"| grep " $JOB_CURRENT "`" ]; then
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "< (FAILED) [nothing new since previous attempt]"
|
2011-05-04 02:31:45 +02:00
|
|
|
JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT)
|
|
|
|
continue
|
|
|
|
fi
|
2013-05-19 16:50:59 +02:00
|
|
|
get_pkg_srcinfo $DATADIR/$PORT_REPOSITORY ${JOB_CURRENT}
|
|
|
|
|
2012-03-13 16:08:14 +01:00
|
|
|
DONT_PREPARE_THIS=
|
|
|
|
for p in ${JOB_CMDLINE[*]}; do
|
|
|
|
[ "$p" = "${JOB_CURRENT}" -o "$DONT_PREPARE_ANY" ] || continue
|
|
|
|
[ -e ${SPECDIR}/${JOB_CURRENT}.spec ] && DONT_PREPARE_THIS="$DONT_PREPARE"
|
|
|
|
done
|
2011-05-04 02:31:45 +02:00
|
|
|
[ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && {
|
|
|
|
echo -n "prepare"
|
|
|
|
[ "$VERBOSE_MODE" ] && echo "
|
2012-03-13 16:08:14 +01:00
|
|
|
%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS"
|
2013-05-04 15:40:10 +02:00
|
|
|
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS &>$tmpfile
|
|
|
|
cat $tmpfile >> $logfile
|
2011-05-04 02:31:45 +02:00
|
|
|
[ $? -gt 0 ] && {
|
2012-04-26 15:11:10 +02:00
|
|
|
RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`
|
|
|
|
for j in ${RES}; do
|
|
|
|
[ "$j" != "$JOB_CURRENT" ] && RESOLVED_JOB="$RESOLVED_JOB $j"
|
|
|
|
done
|
|
|
|
if [ "$RESOLVED_JOB" ]; then
|
|
|
|
echo "(FAILED) [but scheduling $RESOLVED_JOB]"
|
|
|
|
JOB_FAILED=(${JOB_FAILED[*]} $RESOLVED_JOB)
|
|
|
|
else
|
|
|
|
echo "(FAILED) "
|
|
|
|
fi
|
2011-05-04 02:31:45 +02:00
|
|
|
JOB_CANTPREPARE=(${JOB_CANTPREPARE[*]} $JOB_CURRENT)
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} prepare failed $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
continue
|
|
|
|
} || {
|
|
|
|
echo $JOB_CURRENT >> $DATAARCHDIR/preparedjobs
|
|
|
|
echo -n "(OK) "
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} prepare ok $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
}
|
2012-11-20 00:00:51 +01:00
|
|
|
if [ "$REBUILD_MODE" = "1" ]; then
|
|
|
|
echo -n "update"
|
|
|
|
[ "$VERBOSE_MODE" ] && echo "
|
2013-05-25 22:22:17 +02:00
|
|
|
%% COMMAND: LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\""
|
|
|
|
LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\" &>$tmpfile
|
2013-05-04 15:40:10 +02:00
|
|
|
cat $tmpfile >> $logfile
|
2012-11-20 00:00:51 +01:00
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
echo "(FAILED) "
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update failed $tmpfile
|
2012-11-20 00:00:51 +01:00
|
|
|
continue
|
|
|
|
} || {
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update ok $tmpfile
|
2012-11-20 00:00:51 +01:00
|
|
|
echo -n "(OK) "
|
|
|
|
}
|
|
|
|
elif [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ]; then
|
2011-05-04 02:31:45 +02:00
|
|
|
echo -n "update"
|
|
|
|
[ "$VERBOSE_MODE" ] && echo "
|
2012-03-13 16:08:14 +01:00
|
|
|
%% COMMAND: LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\""
|
2013-05-04 15:40:10 +02:00
|
|
|
LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\" &>$tmpfile
|
|
|
|
cat $tmpfile >> $logfile
|
2011-05-04 02:31:45 +02:00
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
echo "(FAILED) "
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update failed $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
continue
|
|
|
|
} || {
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update ok $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
echo -n "(OK) "
|
|
|
|
}
|
2013-05-19 16:50:59 +02:00
|
|
|
elif [ "$REBUILD_MILESTONE" -a "$src_milestone" != "$REBUILD_MILESTONE" ]; then
|
2012-05-09 15:29:39 +02:00
|
|
|
echo -n "update"
|
2013-05-19 16:50:59 +02:00
|
|
|
[ "$src_repository" -a "$src_version" -a "$src_release" ] || {
|
2012-05-09 15:29:39 +02:00
|
|
|
echo "(FAILED) [can't get repository information for this package]"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
# FIXME: should be implemented in autodist
|
2013-05-19 16:50:59 +02:00
|
|
|
LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 ${src_version} ${src_numrelease}${REBUILD_MILESTONE} \
|
2012-05-09 15:29:39 +02:00
|
|
|
--changelog "$REBUILD_MILESTONE milestone rebuild" &>$tmpfile
|
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
if [ "$VERBOSE_MODE" ]; then
|
|
|
|
echo
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "= Failed output:"
|
|
|
|
echo "================"
|
2012-05-09 15:29:39 +02:00
|
|
|
cat $tmpfile
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "================"
|
2012-05-09 15:29:39 +02:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT)
|
|
|
|
echo "(FAILED)"
|
|
|
|
JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'`
|
|
|
|
[ "$JOB_LOG" ] || JOB_LOG=$tmpfile
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update failed $tmpfile
|
2012-05-09 15:29:39 +02:00
|
|
|
continue
|
|
|
|
} || {
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
echo -n "(OK) "
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} update ok $tmpfile
|
2012-05-09 15:29:39 +02:00
|
|
|
}
|
2011-05-04 02:31:45 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
echo -n "port"
|
2013-05-19 16:50:59 +02:00
|
|
|
if [ ! "$src_repository" -a "$DONT_PREPARE_THIS" != "1" ]; then
|
2011-05-04 02:31:45 +02:00
|
|
|
echo "(FAILED) [can't get repository information for this package]"
|
2012-10-18 00:57:43 +02:00
|
|
|
autoport_log ${JOB_CURRENT} port failed
|
2011-05-04 02:31:45 +02:00
|
|
|
continue
|
2012-09-06 18:10:35 +02:00
|
|
|
fi
|
2013-05-19 16:50:59 +02:00
|
|
|
if [ "$DONT_PREPARE_THIS" = "1" -a "$src_repository" != "$PORT_REPOSITORY" ]; then
|
|
|
|
# if both -np and -r were given send to PORT_REPOSITORY instead of src_repository
|
|
|
|
src_repository=$PORT_REPOSITORY
|
2012-09-06 18:10:35 +02:00
|
|
|
fi
|
2013-05-19 16:50:59 +02:00
|
|
|
[ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ] && src_repository="$DEST_REPOSITORY"
|
2012-05-09 15:29:39 +02:00
|
|
|
[ ! "$DONT_PREPARE_THIS" -a "$PORT_REPOSITORY" = "$DEST_REPOSITORY" -a ! "$REBUILD_MILESTONE" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force"
|
2013-05-04 15:40:10 +02:00
|
|
|
[ "$VERBOSE_MODE" ] && echo "
|
2013-05-19 16:50:59 +02:00
|
|
|
%% COMMAND: LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $src_repository --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS"
|
|
|
|
LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $src_repository --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS &>$tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
if [ "$VERBOSE_MODE" ]; then
|
|
|
|
echo
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "= Failed output:"
|
|
|
|
echo "================"
|
2011-05-04 02:31:45 +02:00
|
|
|
cat $tmpfile
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "================"
|
2011-05-04 02:31:45 +02:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT)
|
|
|
|
echo "(FAILED)"
|
|
|
|
JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'`
|
|
|
|
[ "$JOB_LOG" ] || JOB_LOG=$tmpfile
|
2012-05-10 10:37:10 +02:00
|
|
|
[ ! "$REBUILD_MILESTONE" ] && find_requirements $JOB_LOG
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} port failed $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
continue
|
|
|
|
} || {
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
JOB_SENT=(${JOB_SENT[*]} $JOB_CURRENT)
|
|
|
|
echo $JOB_CURRENT >> $DATAARCHDIR/sentjobs
|
|
|
|
echo -n "(OK) "
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} port ok $tmpfile
|
2013-04-22 12:27:28 +02:00
|
|
|
if [ "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then
|
2012-09-10 17:41:15 +02:00
|
|
|
curl -s "$WEBBUILD_URL?REQUEST=message&USER=$WEBBUILD_USER&SECRET=$WEBBUILD_SECRET&USER_EMAIL=$WEBBUILD_EMAIL&\
|
2013-05-19 16:50:59 +02:00
|
|
|
MESSAGE=`cgi_encodevar \"ported <b>$JOB_CURRENT</b> to <b>$TARGET_ARCH</b> and sent it to <b>$src_repository</b>\"`" >/dev/null
|
2012-09-10 17:41:15 +02:00
|
|
|
fi
|
2011-05-04 02:31:45 +02:00
|
|
|
}
|
|
|
|
echo -n "install"
|
2012-09-06 18:10:35 +02:00
|
|
|
LANG=C LC_ALL=C autodist -i ${JOB_CURRENT} --arch $TARGET_ARCH --force --severity 2 -- $STAGEOPTS &>$tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
# --server $DEST_REPOSITORY --repository $PORT_REPOSITORY
|
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
if [ "$VERBOSE_MODE" ]; then
|
|
|
|
echo
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "= Failed output:"
|
|
|
|
echo "================"
|
2011-05-04 02:31:45 +02:00
|
|
|
cat $tmpfile
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "================"
|
2011-05-04 02:31:45 +02:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
JOB_CANTINSTALL=(${JOB_CANTINSTALL[*]} $JOB_CURRENT)
|
|
|
|
echo $JOB_CURRENT >> $DATAARCHDIR/checkinstalljobs
|
|
|
|
echo "(FAILED)"
|
|
|
|
# sometimes script fails but package is installed; run fix_la_files anyway
|
|
|
|
sudo autoport-fix-environment $TARGET_ARCH
|
|
|
|
|
|
|
|
JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT)
|
|
|
|
JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'`
|
|
|
|
[ "$JOB_LOG" ] || JOB_LOG=$tmpfile
|
2012-09-06 18:10:35 +02:00
|
|
|
[ ! "$REBUILD_MILESTONE" ] && find_requirements $JOB_LOG
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} install failed $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
continue
|
|
|
|
} || {
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
sudo autoport-fix-environment $TARGET_ARCH
|
|
|
|
JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT)
|
|
|
|
JOB_COMPLETED=(${JOB_COMPLETED[*]} $JOB_CURRENT)
|
|
|
|
echo -n "(OK)"
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} install ok $tmpfile
|
2011-05-04 02:31:45 +02:00
|
|
|
}
|
|
|
|
echo
|
|
|
|
done
|
2012-04-26 15:11:10 +02:00
|
|
|
if [ "${JOB[*]}" == "${JOB_FAILED[*]}" -a "${JOB_MISSINGREQ[*]}" == "" ]; then
|
|
|
|
# some new build, retry cantinstall jobs
|
|
|
|
JOB_CANTINSTALL=()
|
|
|
|
for JOB_NUM in `seq 1 ${#JOB_CANTINSTALL_OLD[*]}`; do
|
|
|
|
JOB_CURRENT=${JOB_CANTINSTALL_OLD[$JOB_NUM-1]}
|
|
|
|
if [ "`grep "^${JOB_CURRENT}$" /etc/autodist/unstage 2>/dev/null`" -o \
|
|
|
|
"`grep "^${JOB_CURRENT}$" /etc/autodist/unstage.${TARGET_ARCH} 2>/dev/null`" ]; then
|
|
|
|
echo -n "$JOB_CURRENT: "
|
|
|
|
STAGEOPTS=
|
|
|
|
else
|
|
|
|
echo -n "$JOB_CURRENT(staging): "
|
|
|
|
STAGEOPTS="$AUTOPORT_STAGEVARS"
|
|
|
|
fi
|
|
|
|
echo -n "retryinstall"
|
|
|
|
LANG=C LC_ALL=C autodist -i ${JOB_CURRENT} --arch $TARGET_ARCH --force --severity 2 -- $STAGEOPTS &>>$tmpfile
|
|
|
|
# --server $DEST_REPOSITORY --repository $PORT_REPOSITORY
|
|
|
|
[ $? -gt 0 ] && {
|
|
|
|
if [ "$VERBOSE_MODE" ]; then
|
|
|
|
echo
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "= Failed output:"
|
|
|
|
echo "================"
|
2012-04-26 15:11:10 +02:00
|
|
|
cat $tmpfile
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "================"
|
2012-04-26 15:11:10 +02:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
JOB_CANTINSTALL=(${JOB_CANTINSTALL[*]} $JOB_CURRENT)
|
|
|
|
echo $JOB_CURRENT >> $DATAARCHDIR/checkinstalljobs
|
|
|
|
echo "(FAILED)"
|
|
|
|
# sometimes script fails but package is installed; run fix_la_files anyway
|
|
|
|
sudo autoport-fix-environment $TARGET_ARCH
|
|
|
|
|
|
|
|
JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT)
|
|
|
|
JOB_LOG=`grep "^?= See " $tmpfile | awk '{ print $3 }'`
|
|
|
|
[ "$JOB_LOG" ] || JOB_LOG=$tmpfile
|
|
|
|
find_requirements $JOB_LOG
|
|
|
|
continue
|
|
|
|
} || {
|
|
|
|
cat $tmpfile >> $logfile
|
|
|
|
sudo autoport-fix-environment $TARGET_ARCH
|
|
|
|
JOB_MAYBEINSTALLED_NEW=(${JOB_MAYBEINSTALLED_NEW[*]} $JOB_CURRENT)
|
|
|
|
JOB_COMPLETED=(${JOB_COMPLETED[*]} $JOB_CURRENT)
|
|
|
|
echo -n "(OK)"
|
2013-05-04 15:40:10 +02:00
|
|
|
autoport_log ${JOB_CURRENT} retryinstall ok $tmpfile
|
2012-04-26 15:11:10 +02:00
|
|
|
}
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
fi
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "| Skipped jobs: ${JOB_SKIPPED[*]}"
|
|
|
|
echo "| Unpreparable jobs: ${JOB_CANTPREPARE[*]}"
|
|
|
|
echo "| Missing requirements: ${JOB_MISSINGREQ[*]}"
|
|
|
|
echo "| Completed jobs: ${JOB_COMPLETED[*]}"
|
|
|
|
echo "| Installation error for: ${JOB_CANTINSTALL[*]}"
|
|
|
|
echo "| Failed jobs: ${JOB_FAILED[*]}"
|
2011-05-04 02:31:45 +02:00
|
|
|
write_last_file
|
|
|
|
|
2012-04-26 15:11:10 +02:00
|
|
|
[ "${JOB[*]}" == "${JOB_FAILED[*]}" -a \
|
|
|
|
"${JOB_MISSINGREQ[*]}" == "" -a \
|
|
|
|
"${JOB_CANTINSTALL_OLD[*]}" == "${JOB_CANTINSTALL[*]}" ] && {
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "! Loop detected. Finishing. See $logfile for details."
|
2011-05-04 02:31:45 +02:00
|
|
|
rm -f $tmpfile $tmpfile1
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
[ "$DONT_RECURSE" ] && break
|
|
|
|
JOB=(${JOB_MISSINGREQ[*]} ${JOB_FAILED[*]})
|
|
|
|
done
|
|
|
|
rm -f $tmpfile $tmpfile1
|
|
|
|
done
|
2012-05-24 16:35:34 +02:00
|
|
|
echo "* All jobs completed. See $logfile for details."
|
2011-05-04 02:31:45 +02:00
|
|
|
exit 0
|