automaint: fixes to support any architecture build instead of base arch (i586)

This commit is contained in:
Silvan Calarco 2014-05-25 16:18:35 +02:00
parent 70548ea687
commit 0f96bedecd

View File

@ -171,34 +171,50 @@ allpkgs="`cat $tmpfile | xargs -n 1 | sort -u | xargs`"
rm -f $tmpfile
for p in ${allpkgs}; do
pkgcontinue=
needsport=
for a in `seq 1 ${#ARCHS[*]}`; do
pkgcontinue=
needsport=
for w in ${warningslist[*]}; do
[ "$p" = "$w" ] && { pkgcontinue=1; break; }
done
[ "$pkgcontinue" ] && break
[ "$pkgcontinue" ] && continue
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$SOURCE_REPOSITORY ${ARCHS[$a-1]} $p
for a in `seq 1 ${#ARCHS[*]}`; do
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$DEST_REPOSITORY ${ARCHS[$a-1]} $p
if [ "$pkg_name" ]; then
spkg_version=$pkg_version
spkg_release=$pkg_release
break
fi
done
[ "$pkg_name" ] || {
#echo "$p: looks like a new package; skipping."
echo "$p: not present in $DEST_REPOSITORY; skipping."
continue
}
[ "$VERBOSE" ] && echo "$p: old release in $DEST_REPOSITORY is $spkg_version-$spkg_release"
for o in ${needportlist[*]}; do
[ "$p" = "$o" ] && { needsport=1; break; }
done
[ "$needsport" -a ! "$PORT_REPOSITORY" ] && break
[ "$needsport" -a ! "$PORT_REPOSITORY" ] && continue
spkg_version=$pkg_version
spkg_release=$pkg_release
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$DEST_REPOSITORY ${ARCHS[$a-1]} $p
for a in `seq 1 ${#ARCHS[*]}`; do
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$SOURCE_REPOSITORY ${ARCHS[$a-1]} $p
[ "$pkg_name" ] && break
done
[ "$pkg_name" ] || {
echo "$p: not present in $SOURCE_REPOSITORY; skipping."
continue
}
[ "$VERBOSE" ] && echo "$p: new release in $SOURCE_REPOSITORY is $pkg_version-$pkg_release"
if [ "$pkg_version" = "$spkg_version" ]; then
if [ "$pkg_release" = "$spkg_release" ]; then
echo "$p: same release as upstream; skipping."
break
continue
fi
update_type="release"
else
@ -207,22 +223,34 @@ for p in ${allpkgs}; do
read -ra SVER <<< "$spkg_version"
read -ra VER <<< "$pkg_version"
IFS=$OIFS
dotdiff=`expr ${#VER[*]} - ${#SVER[*]}`
for i in `seq 1 ${#SVER[*]}`; do
[ "${SVER[i-1]}" != "${VER[i-1]}" ] && break
done
if [ "$i" = "${#SVER[*]}" ]; then
if [[ 64#${SVER[i-1]} -gt 64#89 && 64#${VER[i-1]} -lt 64#80 ]]; then
[ "$VERBOSE" ] && echo "$p: dubious beta upgrade from ${VER[i-1]} to ${SVER[i-1]}; skipping."
break
if [ "$i" = "${#SVER[*]}" -a $dotdiff -eq 0 ]; then
# e.g. SVER=0.11.3 -> VER=0.11.4
if [[ 64#${VER[i-1]} -gt 64#89 && 64#${SVER[i-1]} -lt 64#80 ]]; then
[ "$VERBOSE" ] && echo "$p: dubious beta upgrade from ${SVER[i-1]} to ${VER[i-1]}; skipping."
continue
fi
update_type="minor"
elif [ $dotdiff -lt 0 ]; then
[ "$VERBOSE" ] && echo "$p: newer version has less dots than older ${#VER[*]} < ${#SVER[*]}; skipping."
continue
elif [ "$i" != "${#SVER[*]}" ]; then
# e.g. SVER=0.11 -> VER=1.0
[ "$VERBOSE" ] && echo "$p: not a minor version update at position $i/${#SVER[*]}: ${SVER[i-1]} != ${VER[i-1]}; skipping."
continue
elif [ "${SVER[i-1]}" = "${VER[i-1]}" -a $dotdiff -ge 1 ]; then
# e.g. SVER=0.11.2 -> VER=0.11.2.3
update_type="minor"
else
[ "$VERBOSE" ] && echo "$p: dubious not-minor version update $i/${#SVER[*]}: ${SVER[i-1]} != ${VER[i-1]}; skipping."
break
echo "$p: UNEXPECTED CASE - CHECK CODE; skipping."
continue
fi
fi
if [ "$needsport" ]; then
echo "$p: importing from $SOURCE_REPOSITORY to $PORT_REPOSITORY ($spkg_version-$spkg_release -> $pkg_version-$pkg_release)"
echo "$p: importing from $SOURCE_REPOSITORY to $PORT_REPOSITORY ($pkg_version-$pkg_release -> $spkg_version-$spkg_release)"
if [ ! "$TESTMODE" ]; then
autodist-repository import $SOURCE_REPOSITORY $p -d $PORT_REPOSITORY -y >/dev/null
if [ $? -eq 0 -a "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then
@ -231,7 +259,7 @@ MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b
fi
fi
else
echo "$p: importing from $SOURCE_REPOSITORY to $DEST_REPOSITORY ($spkg_version-$spkg_release -> $pkg_version-$pkg_release; update type: $update_type)"
echo "$p: importing from $SOURCE_REPOSITORY to $DEST_REPOSITORY ($pkg_version-$pkg_release -> $spkg_version-$spkg_release; update type: $update_type)"
if [ ! "$TESTMODE" ]; then
autodist-repository import $SOURCE_REPOSITORY $p -d $DEST_REPOSITORY -y >/dev/null
if [ $? -eq 0 -a "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then
@ -240,8 +268,6 @@ MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b
fi
fi
fi
break
done
done
exit 0