- if [ -f "${PACKAGE}_${VERSION}_all.deb" ]; then
- echo "Skipping $PACKAGE, version $VERSION already built"
- continue;
+
+ # Find out what the current repostory version is. We simply take the
+ # first of the architectures in the output, since these are
+ # architecture all packages and should have the same version on all
+ # archs.
+ REPO_VERSION=`$REPO_ROOT/reprepro list "${CODENAME}" "${PACKAGE}" | head -1 | cut -d' ' -f 3`
+ if dpkg --compare-versions "${REPO_VERSION}" ge "${VERSION}"; then
+ echo "Not building version $VERSION of $PACKAGE, version $REPO_VERSION already in repository"
+ continue