autoport: check if source is present in target arch, not source, before rebuilding

This commit is contained in:
Silvan Calarco 2014-08-21 13:13:36 +02:00
parent 52f9b3e9e0
commit ea098185e1

View File

@ -4,7 +4,7 @@
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=0.9.16
VERSION=0.9.17
BASE_ARCH=i586
BASE_REPOSITORY=devel
@ -148,24 +148,22 @@ function get_pkg_buildinfo() {
# }
# . $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
if [ "${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
unset pkg_name pkg_arch pkg_version pkg_release \
pkg_group pkg_license pkg_size pkg_buildtime pkg_altrep pkg_repository
@ -186,7 +184,7 @@ _EOF
function find_source_by_provide() {
local pkg=`echo $2 | sed "s|(|\\\\\[|g;s|)|\\\\\]|g;s|:|_|g"`
grep "^$pkg:" $DATADIR/$1/sources-$BASE_ARCH | \
grep "^$pkg:" $DATADIR/$1/sources-{$BASE_ARCH,$TARGET_ARCH} | \
awk '{ $1=""; print $0 }' | \
sed "s|[[:space:]]_| |g"
}
@ -213,9 +211,16 @@ function find_requirements() {
> $tf
sort -u $tf1 | while read line; do
REQ=`find_source_by_provide $PORT_REPOSITORY ${line}`
[ "$REQ" ] && \
echo "${REQ}" >> $tf || \
if [ "$REQ" ]; then
get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH $REQ
if [ "$pkg_name" ]; then
echo -n "$line(notrebuilding) "
else
echo "${REQ}" >> $tf
fi
else
echo -n "$line(unresolved) "
fi
done
> $tf1
cat $tf | sort -u 2>/dev/null | while read line; do
@ -240,6 +245,8 @@ fetch_repfiles() {
echo "Warning: unable to fetch ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
curl -f -L -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"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_ARCH -o $DATADIR/$PORT_REPOSITORY/sources-$TARGET_ARCH ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_ARCH"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$TARGET_ARCH.sh ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
for u in ${AUTOPORT_UNSTAGE_ARCHS}; do