diff --git a/autoport b/autoport index 9da186e..d0e349d 100755 --- a/autoport +++ b/autoport @@ -290,12 +290,20 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do exit 1 } port_pkg_ver=$pkg_version + port_pkg_rel=$pkg_release get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH $p if [ "$pkg_name" ]; then + pkg_milestone=`echo $pkg_release | sed "s|[0-9.]*\(.*\)|\1|"` if [ "$pkg_version" != "$port_pkg_ver" ]; then echo "Package $pkg_name#${port_pkg_ver}($TARGET_ARCH) differs from $pkg_name#${pkg_version}($BASE_ARCH); port needed." JOB=(${JOB[*]} $p) + elif [ "$pkg_release" != "$port_pkg_rel" ]; then + echo "Package $pkg_name#${port_pkg_ver}-${port_pkg_rel}($TARGET_ARCH) differs from $pkg_name#${pkg_version}-${pkg_release}($BASE_ARCH); port needed." + JOB=(${JOB[*]} $p) + elif [ "$REBUILD_MILESTONE" -a "$pkg_milestone" != "$REBUILD_MILESTONE" ]; then + echo "Package $pkg_name($TARGET_ARCH) was not built for '$REBUILD_MILESTONE' milestone; rebuild needed." + JOB=(${JOB[*]} $p) else echo "Package $pkg_name#${port_pkg_ver}($TARGET_ARCH) is up to date." fi @@ -370,6 +378,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do JOB_FAILED=(${JOB_FAILED[*]} $JOB_CURRENT) continue fi + pkg_release= + pkg_version= + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $BASE_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ + get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $BASE_ARCH ${JOB_CURRENT} + pkg_milestone=`echo $pkg_release | sed "s|[0-9.]*\(.*\)|\1|"` + pkg_numrelease=`echo $pkg_release | sed "s|\([0-9.]*\).*|\1|"` DONT_PREPARE_THIS= for p in ${JOB_CMDLINE[*]}; do [ "$p" = "${JOB_CURRENT}" -o "$DONT_PREPARE_ANY" ] || continue @@ -408,19 +424,43 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do } || { echo -n "(OK) " } + elif [ "$REBUILD_MILESTONE" -a "$pkg_milestone" != "$REBUILD_MILESTONE" ]; then + echo -n "update" + [ "$pkg_repository" -a "$pkg_version" -a "$pkg_release" ] || { + echo "(FAILED) [can't get repository information for this package]" + continue + } + # FIXME: should be implemented in autodist + LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 ${pkg_version} ${pkg_numrelease}${REBUILD_MILESTONE} \ + --changelog "$REBUILD_MILESTONE milestone rebuild" &>$tmpfile + [ $? -gt 0 ] && { + if [ "$VERBOSE_MODE" ]; then + echo + echo "Failed output:" + echo "==============" + cat $tmpfile + echo "==============" + 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 + continue + } || { + cat $tmpfile >> $logfile + echo -n "(OK) " + } fi } echo -n "port" - get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ - get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $BASE_ARCH ${JOB_CURRENT} || \ - get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $TARGET_ARCH ${JOB_CURRENT} || \ - get_pkg_buildinfo $DATADIR/$BASE_REPOSITORY $BASE_ARCH ${JOB_CURRENT} [ "$pkg_repository" ] || { echo "(FAILED) [can't get repository information for this package]" continue } [ "$PORT_REPOSITORY" != "$DEST_REPOSITORY" ] && pkg_repository="$DEST_REPOSITORY" - [ ! "$DONT_PREPARE_THIS" -a "$PORT_REPOSITORY" = "$DEST_REPOSITORY" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force" + [ ! "$DONT_PREPARE_THIS" -a "$PORT_REPOSITORY" = "$DEST_REPOSITORY" -a ! "$REBUILD_MILESTONE" ] && NOSRPM_OPTS="--nosrpm" || NOSRPM_OPTS="--force" LANG=C LC_ALL=C autodist -b -s ${JOB_CURRENT} --arch $TARGET_ARCH --server $pkg_repository --repository $PORT_REPOSITORY --severity 2 $FORCE_FLAG -- $STAGEOPTS $NOSRPM_OPTS &>$tmpfile [ $? -gt 0 ] && { if [ "$VERBOSE_MODE" ]; then