9047 Commits

Author SHA1 Message Date
Joshua Root fd1e224464 compare_pingtimes: always use time if known
A stale entry with a lower ping time should be preferred to an entry
with a higher ping time that happens to have been refreshed recently.
So don't decide on status alone if both entries have a time.
2026-04-10 02:06:01 +10:00
Joshua Root 6dde22ecb2 configure: remove automatically added -std option 2026-04-09 02:46:50 +10:00
Joshua Root c6a5195be4 configure.ac: quote brackets 2026-04-09 00:35:46 +10:00
Joshua Root 4f6cde620d regen configure with autoconf 2.73 2026-04-09 00:35:02 +10:00
Joshua Root e6387f9bcc destroot_finish: handle .la files in one pass 2026-04-08 03:30:31 +10:00
Joshua Root 737d844764 Ignore installed archive when appropriate
See: https://trac.macports.org/ticket/73659
2026-04-06 01:25:55 +10:00
Joshua Root 5c05e1eff4 Add extract.add_deps option
Controls whether dependencies for the discovered extract methods should
be added automatically.
2026-04-04 13:57:42 +11:00
Herby Gillot d82c0f7682 pextlib1.0: apply library CFLAGS only to their respective object files
CURL_CFLAGS (from curl-config --cflags) was applied globally to all
compiled files. When --with-curlprefix=/opt/local is used, this adds
-I/opt/local/include to every compilation, causing readline.c to pick
up MacPorts' GNU readline headers instead of the system headers that
configure probed against. This mismatch produces a build failure due
to differing readline symbol names (e.g. rl_username_completion_function
vs username_completion_function).

Fix by scoping CURL_CFLAGS, MD5_CFLAGS, and READLINE_CFLAGS to the
object files that actually need them, so each file only sees the
include paths appropriate to its own dependencies.

Fixes: https://trac.macports.org/ticket/57160
2026-04-03 01:23:38 +11:00
Joshua Root 884d777b62 Add zstd extract method
Closes: https://trac.macports.org/ticket/72713
2026-04-02 04:05:54 +11:00
Joshua Root 05a592cef4 disttagclean: simplify with lmap 2026-04-02 03:42:58 +11:00
Joshua Root 14fdd90f9c Handle mixed archive types in extract.only
The concept of an extract method is introduced, which is a string which
identifies the command and args to be used to extract. The method is
normally determined based on the file extension, but can be overridden
on a per distfile basis by setting extract.methods.

The built-in list of methods have names matching the second part of the
use_* options names, e.g. "bzip2". There is additionally a "gzip"
method for the case where no use_* option is set.

extract.methods should be a valid dict, with each pair of elements
being a distfile name and the method that should be used for it.
Distfiles not present in extract.methods will use a method determined
from their filename. A method that is not in the built-in list will be
assumed to be a proc defined by the Portfile, which takes the path to
a distfile as its argument. This can be used to extract arbitrary new
file formats while still taking advantage of the built-in methods for
other distfiles.

The extract.cmd, extract.pre_args and extract.post_args options are
used when extracting files that use a method matching extract.suffix.
The behaviour thus stays the same for the single distfile case and when
all distfiles in extract.only are of the same type.

Files that do not use the method matching extract.suffix, either
because of their extension or extract.methods, will use an internally
discovered command and args. A custom method can be used if the
defaults are not suitable.

Since the commands and args are now derived from the filename suffixes,
setting the use_* options now simply sets extract.suffix appropriately.
2026-04-02 03:08:27 +11:00
Joshua Root 3e46372d36 portclean: find matching sigs for .TMP archives 2026-03-31 00:23:26 +11:00
Joshua Root bf1d60aeaf Delete files for cancelled fetches on main thread 2026-03-31 00:16:14 +11:00
Joshua Root 81fb1d2acd Document port search --depends_{patch,test}
Closes: https://trac.macports.org/ticket/73758
2026-03-29 12:28:56 +11:00
Herby Gillot 0d4b57b05a portlivecheck: add livecheck.user_agent option
Add livecheck.user_agent to override the HTTP User-Agent for livecheck
requests, mirroring the existing fetch.user_agent option. Also document
both options in portfile.7, where they were previously undocumented.

Fixes: https://trac.macports.org/ticket/64369
2026-03-28 15:35:49 +11:00
Joshua Root 5da34f365c Improve livecheck.type none handling
Return early if possible, and print a debug message to make it clear
that this is why no livecheck is happening.

Closes: https://github.com/macports/macports-base/pull/375
2026-03-28 15:09:17 +11:00
aeiouaeiouaeiouaeiouaeiouaeiou acd7868b5a Update copyright year 2026-03-28 14:49:05 +11:00
Joshua Root 8c8e12d390 regen on darwintracelib1.0/tests/Makefile.in changes
Closes: https://trac.macports.org/ticket/73697
2026-03-22 09:50:51 +11:00
Herby Gillot 2424fd25f4 tests: fix rmrf helper to avoid too many open files on deep trees
The previous chdir()-based implementation held an opendir(".") DIR
handle open at every recursion level. With deeply nested trees (e.g.,
270 levels in darwintrace_readdir_at_maxpathlen), this exceeded the
default file descriptor limit (EMFILE).

Collect directory entry names into a list and close the DIR handle
before recursing, so at most one file descriptor is open at any
recursion depth.

See: https://trac.macports.org/ticket/73697
2026-03-21 16:47:18 -04:00
Joshua Root 90eefc6648 regen docs 2026-03-22 06:33:46 +11:00
Joshua Root 56528f6416 Use ui_debug for phase timing
This is only occasionally important information.
2026-03-22 06:33:32 +11:00
Herby Gillot 0cd72bfdc8 portbump: replace sed with targeted Tcl-based checksum and revision handling
Drop sed(1) entirely from portbump. Instead, read the Portfile into a
line list and use three new procs for targeted modifications:

- replace_checksums: match hash values as whole words using \y
  word-boundary anchors, so a size value like 123 cannot accidentally
  clobber a larger value such as 12345; targets only the correct lines
  even with multiple subports, conditional branches, or variant-scoped
  checksums.

- find_revision_line: two-phase strategy — first check for an inline
  revision on the subport declaration line (e.g. llvm pattern), then
  fall back to the nearest standalone revision line, excluding lines
  inside subport { } blocks when bumping the parent port.

- reset_revision: simple regsub to set revision to 0, preserving
  indentation and surrounding text.

Fixes a bug where both_checksums was reset on each distfile iteration,
causing only the last distfile's checksums to be updated in Portfiles
with multiple distfiles (e.g. git with git-manpages and git-htmldocs).

Fixes a bug where already-correct checksums were shown in the
"We will bump these:" output.

Also fixes a bug where patch mode applied file attributes to the
Portfile instead of the patch file.

Removes dead code left over from the sed-based implementation.

Adds comprehensive test suite covering real-world Portfile patterns
(git, go, llvm-16, gradle), including tests for whole-word size
matching, subport blocks with nested braces, multiple distfiles,
partial mismatch, and the no-revision-line code path.

Closes: https://trac.macports.org/ticket/65601
Closes: https://trac.macports.org/ticket/73593

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 14:49:41 -04:00
Herby Gillot f75f634ec1 tests: fix rmrf helper to handle paths exceeding PATH_MAX
The previous implementation built full paths by concatenation, which
failed with ENAMETOOLONG on macOS (PATH_MAX=1024) when cleaning up
deeply nested directories like those in darwintrace_readdir_at_maxpathlen.

Use chdir()/fchdir() to descend into directories instead, keeping all
syscall arguments to single-component relative names. All functions
used are standard POSIX available on OS X 10.5+.

This likely went unnoticed in CI because GitHub Actions runs Linux where
PATH_MAX is 4096.
2026-03-21 12:14:45 -04:00
Herby Gillot 3cc6816f84 tests: ignore rmrf test helper binary 2026-03-17 23:26:38 -04:00
Herby Gillot 48bd88581c tests: fix rmrf helper to compile on OS X 10.5+
Replace POSIX.1-2008 *at() functions (fstatat, openat, unlinkat,
fdopendir) with traditional alternatives (lstat, opendir, rmdir,
unlink). The *at() family was introduced in macOS 10.10, so the
previous implementation failed to compile on 10.9 and earlier.

See: https://trac.macports.org/ticket/60818

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 22:07:45 -04:00