When attempting to update the local PortIndex from the precomputed
version for the current OS/arch, there is sometimes a preexisting
version with the correct mtime and size, but not the correct content.
With the default options, rsync fails to update it. This change
suppresses skipping based on size and time (for the index-related
files, not the tarball).
This bug has no obvious user-visible effect, since the bad PortIndex
fails the signature check and is then regenerated, costing extra
time but not malfunctioning. It's visible in the debug output.
TESTED:
Now correctly uses the downloaded index in a formerly failing case.
This currently triggers during the gtk3 build, suggesting there's a way
to close the file descriptors that isn't being caught by trace mode.
Work around this by re-establishing the connection when this happens.
Use the code that was being used to extract rsynced tarballs for the
tarball over http/ftp case as well. It looks like this also fixes the
bug that in the latter case, files no longer present in the tarball
were never deleted from the extracted location. (This appears to have
been the case since the daily tarball feature was added.)
Extract the shared boilerplate (macports init, tmp prefix setup,
mportinit, macports_worker_init) from 27 test files into a single
test_setup.tcl sourced by all unit test suites. Merge the three
divergent copies of macports_worker_init into one consolidated
superset. Fixes#73828.
Eliminate the duplicate sources.conf files in port1.0/tests/ and
package1.0/tests/ by having init_tmp_prefix derive the path from
top_srcdir, leaving a single copy in macports1.0/tests/. Fixes
#73827.
Expose the test tclsh path as macports::autoconf::test_tclsh so
tests can reference it without recomputing the path from
top_srcdir.
Replace the hardcoded /tmp/macports-tests path in the integration
test infrastructure with a unique temporary directory created via
`file tempfile`, which respects TMPDIR and avoids collisions
between parallel or repeated runs. Move macports.conf and
sources.conf content into static template files with @TEST_ROOT@
substitution so the config structure is visible on disk rather
than generated inline.
Install a ::tcltest::cleanupTestsHook in the integration test
library so the temporary directory is removed via cleanupTests
even if a test omits its trailing explicit `cleanup` call.
Fix tests/test/arch-test/test.tcl, which invoked ${bindir}/port
via `sh -c` but never had bindir defined anywhere, to run
port.tcl directly through the test interpreter.
Replace hardcoded /tmp paths in portutil.test with $pwd-relative
paths.
Fixes: https://trac.macports.org/ticket/73828
Fixes: https://trac.macports.org/ticket/73827
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>