-
- if [ ! -f "${PACKAGE}_${VERSION}_all.deb" ]; then
- echo "Building version $VERSION of $PACKAGE"
- equivs-build $i
- else
- echo "Skipping $PACKAGE, version $VERSION already built"
+
+ if [ -z "${PACKAGE}" -o -z "${VERSION}" ]; then
+ echo "Skipping non-equivs file '$BASE'"
+ continue;
+ fi
+
+ # 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