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>
Adds a new `port prefix` command that prints MacPorts' installation prefix on
stdout, unadorned, so it can be used directly in shell scripts.
Closes: https://trac.macports.org/ticket/72961
GNU Make tries to remake any included makefile, so `include
Mk/macports.autoconf.mk` causes the top-level `Mk/macports.autoconf.mk:`
rule to fire. That rule depends on `config.status`, whose rule re-runs
`./config.status --recheck` (effectively `./configure`), and the
autoconf.mk recipe then runs `make clean` as a side effect.
The result: `make clean` and `make distclean` both trigger a configure
run before cleaning, which is wasteful and surprising.
Skip the regeneration rules entirely when the only goals on the command
line are clean or distclean. Any other goal (or the default build)
still picks up configuration changes as before.