autoport: use all archs as base arch to find packages to port

This commit is contained in:
Silvan Calarco 2020-12-16 20:40:35 +01:00
parent dab56b358f
commit 7dcd16b2ca
2 changed files with 17 additions and 25 deletions

View File

@ -17,7 +17,7 @@ me=(${0##*/} $VERSION "Sat Mar 20 2011")
function usage() {
echo "\
${me[0]} ${me[1]}
"$"Copyright (C) 2011-2016 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Copyright (C) 2011-2020 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Released under the terms of the GNU GPL v3 license"
echo "
"$"Batch port and cross-build tool based on autodist.""
@ -125,7 +125,7 @@ function get_pkg_buildinfo() {
fi
pkg_archs=();
for a in ${archs[*]}; do
for a in ${AUTODIST_ARCHS[*]}; do
[ "$a" = "${local_arch}" ] && continue
pkg_header=();
DISTROMATIC_BUILD_FILE=$local_distromatic/builds-$a.sh
@ -184,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,$TARGET_ARCH} | \
grep "^$pkg:" $DATADIR/$1/sources-* | \
awk '{ $1=""; print $0 }' | \
sed "s|[[:space:]]_| |g"
}
@ -244,15 +244,14 @@ fetch_repfiles() {
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
curl -f -L -s ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist -o $DATADIR/$PORT_REPOSITORY/srcpkglist ||
echo "Warning: unable to fetch ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH"
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"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_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"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
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 a in ${AUTODIST_ARCHS[*]}; do
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-${a}"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-${a} -o $DATADIR/$PORT_REPOSITORY/sources-${a} ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-${a}"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/builds-${a}.sh"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-${a}.sh -o $DATADIR/$PORT_REPOSITORY/builds-${a}.sh ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-${a}.sh"
done
for u in ${AUTOPORT_UNSTAGE_ARCHS}; do
[ "$u" = "$TARGET_ARCH" ] && {
rm -f $DATADIR/$PORT_REPOSITORY/unstage.$TARGET_ARCH
@ -266,10 +265,10 @@ fetch_repfiles() {
[ $# -gt 0 ] || { usage ; exit 1; }
BUILD_ARCH=`uname -m`
[ "$BUILD_ARCH" ] || BUILD_ARCH=`uname -m`
case $BUILD_ARCH in
i386|i486|i686) BUILD_ARCH=i586; BASE_ARCH=x86_64 ;;
i386|i486|i686) BUILD_ARCH=i586 ;;
arm*) BUILD_ARCH=arm ;;
esac
@ -332,12 +331,6 @@ done
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=()
@ -378,8 +371,8 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
echo "Release repository is $DEST_REPOSITORY"
# old files cleanup
rm -f $DATADIR/$PORT_REPOSITORY/sources-$TARGET_CPU
rm -f $DATADIR/$PORT_REPOSITORY/builds-$BASE_ARCH.sh
rm -f $DATADIR/$PORT_REPOSITORY/sources-*
rm -f $DATADIR/$PORT_REPOSITORY/builds-*.sh
fetch_repfiles
@ -423,8 +416,7 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
exit 1
}
# old files cleanup
rm -f $DATADIR/$BASE_REPOSITORY/builds-$BASE_ARCH.sh
rm -f $DATADIR/$BASE_REPOSITORY/builds-$TARGET_ARCH.sh
rm -f $DATADIR/$BASE_REPOSITORY/builds-*.sh
get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH
port_pkg_list=${pkg_list[*]}

View File

@ -1,7 +1,7 @@
# Global configuration file for autodist
#
AUTODIST_ARCHS=(i586 x86_64 arm aarch64)
SITE_BASE_URL=http://www.openmamba.org
SITE_BASE_URL=https:/openmamba.org
REPS_BASE_URL=${SITE_BASE_URL}/pub/openmamba
LOCAL_REPS_BASE_DIR=/var/ftp/pub/openmamba
SEND_SERVER=devel-autodist