Skip to content

Commit cb1db40

Browse files
committed
verify all C files are distributed
Catch mistakes like CDRIVER-2071.
1 parent 076726f commit cb1db40

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.evergreen/config.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,29 +378,45 @@ tasks:
378378
sphinx-build --version
379379
380380
./autogen.sh --enable-html-docs --enable-man-pages && make distcheck
381-
381+
382382
# Check that docs were included, but sphinx temp files weren't.
383-
set -o xtrace
384-
set -o errexit
385383
tarfile=mongo-c-driver-*.tar.gz
386-
docs='mongo-c-driver-*/doc/html/index.html mongo-c-driver-*/doc/man/mongoc_client_t.3'
384+
docs='mongo-c-driver-*/doc/html/index.html mongo-c-driver-*/doc/man/bson_t.3'
387385
tmpfiles='mongo-c-driver-*/doc/html/.doctrees \
388386
mongo-c-driver-*/doc/html/.buildinfo \
389387
mongo-c-driver-*/doc/man/.doctrees \
390388
mongo-c-driver-*/doc/man/.buildinfo'
391389
390+
echo "Checking for built docs"
392391
for doc in $docs; do
393392
# Check this doc is in the archive.
394393
tar --wildcards -tzf $tarfile $doc
395394
done
396395
396+
echo "Checking that temp files are not included in tarball"
397397
for tmpfile in $tmpfiles; do
398398
# Check this temp file doesn't exist.
399399
if tar --wildcards -tzf $tarfile $tmpfile > /dev/null 2>&1; then
400400
echo "Found temp file in archive: $tmpfile"
401401
exit 1
402402
fi
403403
done
404+
405+
echo "Checking that all C files are included in tarball"
406+
# Check that all C files were included.
407+
TAR_CFILES=`tar --wildcards -tf mongo-c-driver-*.tar.gz 'mongo-c-driver-*/src/mongoc/*.c' | cut -d / -f 4 | sort`
408+
SRC_CFILES=`echo src/mongoc/*.c | xargs -n 1 | cut -d / -f 3 | sort`
409+
if [ "$TAR_CFILES" != "$SRC_CFILES" ]; then
410+
echo "Not all C files are in the release archive"
411+
echo $TAR_CFILES > tar_cfiles.txt
412+
echo $SRC_CFILES | diff -y - tar_cfiles.txt
413+
fi
414+
415+
end=$(date +%s)
416+
echo '"end": ' $end ', ' >> test-results.json
417+
sum=$(expr $end - $start)
418+
echo '"elapsed": ' $sum ' } ] }' >> test-results.json
419+
404420
- func: "upload docs"
405421
- func: "upload release"
406422
- func: "upload build"

0 commit comments

Comments
 (0)