autoport: update with current production changes
This commit is contained in:
parent
ceea7ef522
commit
88643910fb
33
autoport
33
autoport
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# autoport -- batch cross-build tool based on autodist
|
# autoport -- batch cross-build tool based on autodist
|
||||||
# Copyright (C) 2011-2021 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# Copyright (C) 2011-2023 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
#
|
#
|
||||||
# Released under the terms of the GNU GPL release 3 license
|
# Released under the terms of the GNU GPL release 3 license
|
||||||
#
|
#
|
||||||
@ -17,7 +17,7 @@ me=(${0##*/} $VERSION "Sat Mar 20 2011")
|
|||||||
function usage() {
|
function usage() {
|
||||||
echo "\
|
echo "\
|
||||||
${me[0]} ${me[1]}
|
${me[0]} ${me[1]}
|
||||||
"$"Copyright (C) 2011-2020 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
"$"Copyright (C) 2011-2023 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
||||||
"$"Released under the terms of the GNU GPL v3 license"
|
"$"Released under the terms of the GNU GPL v3 license"
|
||||||
echo "
|
echo "
|
||||||
"$"Batch port and cross-build tool based on autodist.""
|
"$"Batch port and cross-build tool based on autodist.""
|
||||||
@ -246,12 +246,14 @@ fetch_repfiles() {
|
|||||||
curl -f -L -s ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist -o $DATADIR/$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"
|
echo "Warning: unable to fetch ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
|
||||||
for a in ${AUTODIST_ARCHS[*]}; do
|
for a in ${AUTODIST_ARCHS[*]}; do
|
||||||
|
if [ "$a" == "${TARGET_ARCH}" ]; then
|
||||||
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-${a}"
|
[ "$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} ||
|
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}"
|
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-${a}"
|
||||||
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/builds-${a}.sh"
|
[ "$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 ||
|
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"
|
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-${a}.sh"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
for u in ${AUTOPORT_UNSTAGE_ARCHS}; do
|
for u in ${AUTOPORT_UNSTAGE_ARCHS}; do
|
||||||
[ "$u" = "$TARGET_ARCH" ] && {
|
[ "$u" = "$TARGET_ARCH" ] && {
|
||||||
@ -473,6 +475,11 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
> $DATAARCHDIR/preparedjobs
|
> $DATAARCHDIR/preparedjobs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -e $DATAARCHDIR/updatedjobs ] || > $DATAARCHDIR/updatedjobs
|
||||||
|
find $DATAARCHDIR/updatedjobs -ctime 1 >/dev/null && {
|
||||||
|
> $DATAARCHDIR/updatedjobs
|
||||||
|
}
|
||||||
|
|
||||||
sudo autoport-fix-environment $TARGET_ARCH
|
sudo autoport-fix-environment $TARGET_ARCH
|
||||||
|
|
||||||
[ "$FIX_MODE" ] && exit 0
|
[ "$FIX_MODE" ] && exit 0
|
||||||
@ -544,6 +551,7 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
|
|
||||||
DONT_PREPARE_THIS=
|
DONT_PREPARE_THIS=
|
||||||
RELEASE_UPDATED=
|
RELEASE_UPDATED=
|
||||||
|
grep -q ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs && RELEASE_UPDATED=1
|
||||||
for p in ${JOB_CMDLINE[*]}; do
|
for p in ${JOB_CMDLINE[*]}; do
|
||||||
[ "$p" = "${JOB_CURRENT}" -o "$DONT_PREPARE_ANY" ] || continue
|
[ "$p" = "${JOB_CURRENT}" -o "$DONT_PREPARE_ANY" ] || continue
|
||||||
[ -e ${SPECDIR}/${JOB_CURRENT}.spec ] && DONT_PREPARE_THIS="$DONT_PREPARE"
|
[ -e ${SPECDIR}/${JOB_CURRENT}.spec ] && DONT_PREPARE_THIS="$DONT_PREPARE"
|
||||||
@ -555,8 +563,8 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
else
|
else
|
||||||
REPOSITORY_STRICT_ADD=""
|
REPOSITORY_STRICT_ADD=""
|
||||||
fi
|
fi
|
||||||
[ "$VERBOSE_MODE" ] && echo "
|
# [ "$VERBOSE_MODE" ] && echo "
|
||||||
%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS"
|
#%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS"
|
||||||
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS &>$tmpfile
|
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS &>$tmpfile
|
||||||
[ $? -gt 0 ] && {
|
[ $? -gt 0 ] && {
|
||||||
RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`
|
RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`
|
||||||
@ -592,8 +600,8 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
changelogadd="`echo ${SCRIPT_ARGS} | sed "s|--buildreq|,|g;s| ||g;s|^,||g"`"
|
changelogadd="`echo ${SCRIPT_ARGS} | sed "s|--buildreq|,|g;s| ||g;s|^,||g"`"
|
||||||
REBUILD_CHANGELOG="rebuilt by autoport with build requirements: '${changelogadd}'"
|
REBUILD_CHANGELOG="rebuilt by autoport with build requirements: '${changelogadd}'"
|
||||||
fi
|
fi
|
||||||
[ "$VERBOSE_MODE" ] && echo "
|
# [ "$VERBOSE_MODE" ] && echo "
|
||||||
%% COMMAND: LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\" --- \"$SCRIPT_ARGS\""
|
#%% COMMAND: LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\" --- \"$SCRIPT_ARGS\""
|
||||||
LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\" --- $SCRIPT_ARGS &>$tmpfile
|
LANG=C LC_ALL=C autodist -u --rebuild -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"$REBUILD_CHANGELOG\" --- $SCRIPT_ARGS &>$tmpfile
|
||||||
[ $? -gt 0 ] && {
|
[ $? -gt 0 ] && {
|
||||||
echo "(FAILED) "
|
echo "(FAILED) "
|
||||||
@ -603,11 +611,12 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
autoport_log ${JOB_CURRENT} update ok $tmpfile
|
autoport_log ${JOB_CURRENT} update ok $tmpfile
|
||||||
echo -n "(OK) "
|
echo -n "(OK) "
|
||||||
RELEASE_UPDATED=1
|
RELEASE_UPDATED=1
|
||||||
|
echo $JOB_CURRENT >> $DATAARCHDIR/updatedjobs
|
||||||
}
|
}
|
||||||
elif [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ]; then
|
elif [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ]; then
|
||||||
echo -n "update"
|
echo -n "update"
|
||||||
[ "$VERBOSE_MODE" ] && echo "
|
# [ "$VERBOSE_MODE" ] && echo "
|
||||||
%% COMMAND: LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\""
|
#%% COMMAND: LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\""
|
||||||
LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\" --- $SCRIPT_ARGS &>$tmpfile
|
LANG=C LC_ALL=C autodist -u -r ${JOB_CURRENT} --severity 2 -- $STAGEOPTS --changelog \"automatic port from $PORT_REPOSITORY\" --- $SCRIPT_ARGS &>$tmpfile
|
||||||
cat $tmpfile >> $logfile
|
cat $tmpfile >> $logfile
|
||||||
[ $? -gt 0 ] && {
|
[ $? -gt 0 ] && {
|
||||||
@ -626,8 +635,8 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
src_release_num=`echo $src_release | sed "s|\([0-9.]*\).*|\1|"`
|
src_release_num=`echo $src_release | sed "s|\([0-9.]*\).*|\1|"`
|
||||||
[ "$VERBOSE_MODE" ] && echo "
|
# [ "$VERBOSE_MODE" ] && echo "
|
||||||
%% COMMAND: LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog \"$REBUILD_MILESTONE milestone rebuild\" $src_version $src_release_num${REBUILD_MILESTONE}"
|
#%% COMMAND: LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog \"$REBUILD_MILESTONE milestone rebuild\" $src_version $src_release_num${REBUILD_MILESTONE}"
|
||||||
# FIXME: should be implemented in autodist
|
# FIXME: should be implemented in autodist
|
||||||
LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog "$REBUILD_MILESTONE milestone rebuild" $src_version $src_release_num${REBUILD_MILESTONE} &>$tmpfile
|
LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog "$REBUILD_MILESTONE milestone rebuild" $src_version $src_release_num${REBUILD_MILESTONE} &>$tmpfile
|
||||||
[ $? -gt 0 ] && {
|
[ $? -gt 0 ] && {
|
||||||
@ -665,8 +674,8 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
|||||||
SEND_REPOSITORY=$src_repository
|
SEND_REPOSITORY=$src_repository
|
||||||
fi
|
fi
|
||||||
[ ! "$DONT_PREPARE_THIS" -a ! "$RELEASE_UPDATED" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force"
|
[ ! "$DONT_PREPARE_THIS" -a ! "$RELEASE_UPDATED" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force"
|
||||||
[ "$VERBOSE_MODE" ] && echo "
|
# [ "$VERBOSE_MODE" ] && echo "
|
||||||
%% COMMAND: LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $SEND_REPOSITORY --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS"
|
#%% COMMAND: LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $SEND_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 $SEND_REPOSITORY --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS &>$tmpfile
|
LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $SEND_REPOSITORY --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS &>$tmpfile
|
||||||
[ $? -gt 0 ] && {
|
[ $? -gt 0 ] && {
|
||||||
if [ "$VERBOSE_MODE" ]; then
|
if [ "$VERBOSE_MODE" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user