--- /dev/null
+#!/usr/bin/env bash
+# Copyright (C) Viktor Szakats
+#
+# SPDX-License-Identifier: curl
+
+# Compare git repo files with tarball files and report a mismatch
+# after excluding exceptions.
+
+set -eu
+
+gitonly=".git*
+^.*
+^appveyor.*
+^buildconf
+^GIT-INFO.md
+^README.md
+^renovate.json
+^REUSE.toml
+^SECURITY.md
+^LICENSES/*
+^docs/examples/adddocsref.pl
+^docs/THANKS-filter
+^projects/Windows/*
+^scripts/ciconfig.pl
+^scripts/cijobs.pl
+^scripts/contributors.sh
+^scripts/contrithanks.sh
+^scripts/delta
+^scripts/installcheck.sh
+^scripts/release-notes.pl
+^scripts/singleuse.pl
+^src/tool_hugehelp.c.cvs
+^tests/CI.md"
+
+tarfiles="$(mktemp)"
+gitfiles="$(mktemp)"
+
+tar -tf "$1" \
+ | sed -E 's|^[^/]+/||g' \
+ | grep -v -E '(/|^)$' \
+ | sort > "${tarfiles}"
+
+git -C "${2:-.}" ls-files \
+ | grep -v -E "($(printf '%s' "${gitonly}" | tr $'\n' '|' | sed -e 's|\.|\\.|g' -e 's|\*|.+|g'))$" \
+ | sort > "${gitfiles}"
+
+dif="$(diff -u "${tarfiles}" "${gitfiles}" | tail -n +3 || true)"
+
+rm -rf "${tarfiles:?}" "${gitfiles:?}"
+
+echo 'Only in tarball:'
+echo "${dif}" | grep '^-' || true
+echo
+
+echo 'Missing from tarball:'
+if echo "${dif}" | grep '^+'; then
+ exit 1
+fi
- '**/*.m4'
- '**/CMakeLists.txt'
- 'lib/curl_config.h.cmake'
- - 'scripts/cmp-config.pl'
+ - '.github/scripts/cmp-config.pl'
pull_request:
branches:
- '**/*.m4'
- '**/CMakeLists.txt'
- 'lib/curl_config.h.cmake'
- - 'scripts/cmp-config.pl'
+ - '.github/scripts/cmp-config.pl'
permissions: {}
mkdir build && cd build && cmake ..
- name: compare generated curl_config.h files
- run: ./scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h
+ run: ./.github/scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h
make -C build -j5
name: 'verify out-of-tree cmake build'
- verify-cmake-test-dist:
+ missing-files:
runs-on: ubuntu-latest
timeout-minutes: 5
+ needs: maketgz-and-verify-in-tree
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- - name: 'cmake test dist'
- run: |
- cmake -B build -DENABLE_DIST_TEST=ON
+ - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
+ with:
+ name: 'release-tgz'
+
+ - name: 'detect files missing from release tarball'
+ run: .github/scripts/distfiles.sh curl-99.98.97.tar.gz
reproducible-releases:
runs-on: ubuntu-latest
# Ugly (but functional) way to include "Makefile.inc" by transforming it
# (= regenerate it).
function(transform_makefile_inc _input_file _output_file)
- file(STRINGS "${_input_file}" _makefile_inc_lines)
- set(_makefile_inc_text "")
- foreach(_line IN LISTS _makefile_inc_lines)
- if(_line MATCHES "### USE SIMPLE LIST ASSIGMENTS ABOVE THIS LINE ###")
- break()
- endif()
- set(_makefile_inc_text "${_makefile_inc_text}${_line}\n")
- endforeach()
-
+ file(READ ${_input_file} _makefile_inc_text)
string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" _makefile_inc_text ${_makefile_inc_text})
string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" _makefile_inc_text ${_makefile_inc_text})
add_subdirectory(tests)
endif()
-# Verify if all CMake include/input files are listed as distributable
-if(ENABLE_DIST_TEST)
- # Get 'CMAKE_DIST' variable
- transform_makefile_inc("Makefile.am" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.am.cmake")
- include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.am.cmake")
-
- file(GLOB_RECURSE _curl_cmake_files_found RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/CMake/*.cmake"
- "${CMAKE_CURRENT_SOURCE_DIR}/CMake/*.in")
-
- foreach(_item IN LISTS _curl_cmake_files_found)
- if(NOT _item IN_LIST CMAKE_DIST)
- message(FATAL_ERROR "Source file missing from the Makefile.am CMAKE_DIST list: ${_item}")
- endif()
- endforeach()
-endif()
-
if(NOT CURL_DISABLE_INSTALL)
install(FILES "${PROJECT_SOURCE_DIR}/scripts/mk-ca-bundle.pl"
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
-### USE SIMPLE LIST ASSIGMENTS ABOVE THIS LINE ### DO NOT DELETE
-
# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files
include lib/Makefile.inc
include src/Makefile.inc