diff --git a/buildrepo.in b/buildrepo.in
index 961d245e8a19cfb7fd87848b46d198b6fdaeec97..0fb7c12193154b169900b9de5db40e743173c470 100755
--- a/buildrepo.in
+++ b/buildrepo.in
@@ -45,7 +45,7 @@ build() {
 	# to rebuild. By doing this we might save us for rebuilding 
 	# needed when running 'abuild -R'
 	for i in */APKBUILD; do
-		[ -f "$i" ] || continue
+		[ -f "$aportsdir/$repo/$i" ] || continue
 		export REPODEST="$repodir"
 		cd "$aportsdir/$repo"/${i%/*} || return 1
 		if abuild -k -q up2date 2>/dev/null; then