FreeBSD/poudriere 8b41a68src/share/poudriere ports.sh jail.sh

jail, ports: Avoid set -e trap in quiet-mode "done" idiom

4cb78962 introduced `[ -n "${quiet}" ] && echo " done"` in the svn/git
checkout and update paths of install_from_vcs() (jail.sh) and ports.sh.
When quiet is unset the test is false, so the statement returns exit 1;
under set -e a bare call to the enclosing function/case arm would abort
the script right after that line runs, as seen with the identical
pattern in image.sh (PR #1378). None of these 8 occurrences are
currently a function's last statement, so they don't trip today, but
the pattern is fragile under refactoring. Use an if/fi block instead,
matching the idiom already used for the preceding header line, so the
statement always returns 0.

This closes #1387
DeltaFile
+12-4src/share/poudriere/ports.sh
+12-4src/share/poudriere/jail.sh
+24-82 files

FreeBSD/poudriere 9cc4067src/share/poudriere jail.sh

jail: Reject a period in the new name on rename

create_jail() rejects a period in JAILNAME since jail(8) names cannot
contain one, but rename_jail() never validated NEWJAILNAME at all, so
'poudriere jail -r' could rename a jail to a name jail(8) itself would
reject. Apply the same check used at creation.

This closes #1388
DeltaFile
+2-0src/share/poudriere/jail.sh
+2-01 files

FreeBSD/poudriere d504b2asrc/share/poudriere/include pkg.sh

pkg: Add trailing ellipsis to repository signing status messages

Each of these msg() calls is immediately followed by an unredirected
injail pkg-repo invocation whose own output streams directly to the
console right after the header, the same shape as other "action
followed by unbuffered command output" status lines that already use
a trailing "...". pkg repo has no quiet/verbose toggle in play here
(PKG_REPO_FLAGS only carries --hash/--symlink), so this is a plain
ellipsis fix, not an idiom conversion.

This closes #1381
DeltaFile
+3-3src/share/poudriere/include/pkg.sh
+3-31 files

FreeBSD/poudriere e0c11d8src/share/poudriere image.sh

image: Use quiet-aware msg idiom for pkgbase install status

install_world_from_pkgbase() always reported "Installing base
packages" / "Base packages installed" as two separate msg() lines,
regardless of PKG_QUIET. Under the default quiet pkg install
(-q, unless -v was passed), nothing prints between them, so treat it
like the other silent/slow operations with msg_n "...done". When -v
clears PKG_QUIET, pkg's own install output streams between the
header and completion, so keep the header on its own line via msg()
with a trailing "..." and skip the redundant "done", matching the
quiet-vs-verbose idiom already used for jail.sh's install_from_vcs().
DeltaFile
+8-2src/share/poudriere/image.sh
+8-21 files

FreeBSD/poudriere 809ac24src/share/poudriere ports.sh

Merge pull request #1385 from michael-o/fix-ports-name-period-check
DeltaFile
+1-1src/share/poudriere/ports.sh
+1-11 files

FreeBSD/poudriere 92ed04bsrc/share/poudriere image_zfs.sh

image: Use msg_n/done idiom for ZFS image build status messages

zfs send/recv, zpool create, and zfs create/snapshot are all silent
on success and can take a noticeable amount of time (especially for
larger images), but were reported via standalone msg() calls with no
completion signal. Switch to the msg_n "...done" idiom used elsewhere
for silent, potentially slow operations.
DeltaFile
+10-5src/share/poudriere/image_zfs.sh
+10-51 files

FreeBSD/poudriere b22f1fbsrc/share/poudriere image.sh

image: Use msg_n/done idiom for install_world tar status

install_world() reported "Installing world with tar" and "Installing
world done" as two separate msg() lines, even though both the tar
pipeline and make -s are always silent on success and the operation
(copying the full world plus delete-old) can take a while. Switch to
the msg_n "...done" idiom used elsewhere for silent, potentially slow
operations.
DeltaFile
+2-2src/share/poudriere/image.sh
+2-21 files

FreeBSD/poudriere 4257d54src/share/poudriere jail.sh

jail: Add trailing ellipsis to make/freebsd-update status messages

Each of these msg() calls is immediately followed by an unredirected
external command (make or freebsd-update) whose own real-time output
streams directly to the console right after the header, with no
paired completion message -- the command's own output, or the
err()/msg_warn() on failure, is what signals progress/completion.
Add a trailing "..." so the header reads as in-progress rather than
a standalone statement, consistent with msg_n() callers elsewhere.
DeltaFile
+8-8src/share/poudriere/jail.sh
+8-81 files

FreeBSD/poudriere 17a2953src/share/poudriere image.sh

image: Use msg_n/done idiom for miniroot creation status

mkminiroot() reported "Making miniroot" as a standalone msg() even
though the function is mostly silent and can take a noticeable
amount of time (copying files, resolving shared library deps, and
running makefs/gzip). Of its steps, only makefs writes unredirected
output to stdout; gzip -9 without -v is already silent. Redirect
makefs's output to /dev/null, matching the same treatment already
used for its sibling make_esp_file(), and switch to the msg_n
"...done" idiom used elsewhere for silent, potentially slow
operations so the whole function reports as one in-progress status
line instead of a header with no matching completion.
DeltaFile
+4-2src/share/poudriere/image.sh
+4-21 files

FreeBSD/poudriere 21d009asrc/share/poudriere common.sh

build_port: Add trailing ellipsis to shared library dependency check

The readelf/grep output for the NEEDED library list prints directly
after this status line, so it should read as in-progress like other
such messages instead of a standalone statement.
DeltaFile
+1-1src/share/poudriere/common.sh
+1-11 files

FreeBSD/poudriere d92fb7csrc/share/poudriere common.sh

Reject unsafe package names from ports metadata

PKGNAME is used to construct host-side package staging paths. A port
can supply traversal components and cause those paths to escape the
staging directory.

Validate package names when reading port metadata and before a build
worker uses one. This prevents path separators and dot traversal
components from reaching host filesystem operations.

(cherry picked from commit e90c7ba59dbb1b42b9e83029e88c570caf29d632)

Conflicts:
        src/share/poudriere/common.sh

Issue #1363
DeltaFile
+22-0src/share/poudriere/common.sh
+22-01 files

FreeBSD/poudriere eedb18a. README.md

README: point the build badge at SourceHut

Cirrus CI stopped running jobs on 2026-06-01 when Cirrus Labs joined OpenAI,
so the badge no longer renders and its link is dead.  SourceHut has been
building poudriere since 2026-05-05 via .builds/freebsd.yml.

Fixes #1331
DeltaFile
+1-1README.md
+1-11 files

FreeBSD/poudriere 499ec8b.builds freebsd.yml

CI: Fix path to the test-suite logfile
DeltaFile
+1-1.builds/freebsd.yml
+1-11 files

FreeBSD/poudriere 7c07ad7.builds freebsd.yml

CI: Archive the test log instead of cat'ing it since it is too long
DeltaFile
+3-1.builds/freebsd.yml
+3-11 files

FreeBSD/poudriere b4cb725src/share/poudriere ports.sh

ports: Fix period check in ports tree name validation

The create-time validation matched "*:*" (colon) but the error
message says "cannot contain a period (.)", citing jail(8)'s
hierarchical dot-separated naming. jail_start()'s equivalent checks
for jailname/ptname/setname (common.sh) correctly use "*.*" -- this
was the only place with the mismatched pattern, so a period in
PTNAME was silently accepted instead of being rejected as documented.
DeltaFile
+1-1src/share/poudriere/ports.sh
+1-11 files

FreeBSD/poudriere 82b0097.builds freebsd.yml

CI: Add shellcheck and remove the kyua report on failure and cat the log instead
DeltaFile
+2-1.builds/freebsd.yml
+2-11 files

FreeBSD/poudriere 4c66122.builds freebsd.yml

CI: remove kyua dep since it is now part of the base system
DeltaFile
+0-1.builds/freebsd.yml
+0-11 files

FreeBSD/poudriere f853411src/share/poudriere image.sh

image: Use msg_n/done idiom for ESP image creation status

make_esp_file() reported "Creating ESP image" and "ESP Image created"
as two separate complete lines via msg(), even though makefs's own
output is redirected to /dev/null and the operation can take a
noticeable amount of time. Use the msg_n "...done" idiom used
elsewhere for silent, potentially slow operations (e.g. jail removal)
so it reads as a single in-progress status line instead of two
disconnected facts.
DeltaFile
+2-2src/share/poudriere/image.sh
+2-21 files

FreeBSD/poudriere 8aafac8src/share/poudriere common.sh

Add missing FLAVOR to stage-qa and check-plist calls

For example, `poudriere testport -NNi devel/freebsd-gcc15 at amd64`
will correctly build the amd64 flavor, but will attempt to
stage-qa and check-plist for the aarch64 flavor because it
becomes the default flavor through alphabetic sorting.
DeltaFile
+2-2src/share/poudriere/common.sh
+2-21 files

FreeBSD/poudriere 2eb8e1asrc/share/poudriere common.sh

testport/bulk -i: Pass FLAVOR when looking up WRKDIR in interactive motd

The WRKDIR line queried `make -V WRKDIR` without FLAVOR, so a flavored
port always reported its default flavor's work directory instead of
the one actually built and installed -- e.g. audio/baresip built with
FLAVOR=nox11 showed work-default. run-depends and install-package
already pass ${flavor:+FLAVOR=${flavor}} a few lines above; do the
same here.

Reproduced on misc/py-polars-runtime (FLAVOR=64 showing work-compat)
and audio/baresip (FLAVOR=nox11 showing work-default); a port whose
single auto-generated flavor happens to match the default (e.g.
security/py-biscuit-python) masks the bug, which is likely why it
went unnoticed.

Co-Authored-By: Claude Sonnet 5 <noreply at anthropic.com>
DeltaFile
+1-1src/share/poudriere/common.sh
+1-11 files

FreeBSD/poudriere 4cb7896src/share/poudriere ports.sh jail.sh

jail, ports: Fix garbled output when checking out/updating with -v

The svn/git checkout and update paths in both ports.sh and jail.sh's
install_from_vcs() used msg_n() followed by the raw command's own
output and a glued-on " done", relying on the command producing no
output of its own. With -v that assumption is wrong: quiet mode is
disabled, so svn/git's own progress output gets appended directly
onto the unterminated header line, and " done" gets glued onto the
tool's own last output line instead of starting a new one.

Use msg() instead of msg_n() when not running quiet, so the header
gets its own line before the command's output, and drop the redundant
trailing "done" for that case since the tool's own output already
signals completion. Apply the same fix to jail.sh, which had the
identical pattern for fetching/updating jail sources, and add the
existing "!! Any changes here should be considered for ... too."
cross-reference comment to the svn cases in both files so the two
code paths stay in sync going forward.


    [3 lines not shown]
DeltaFile
+26-8src/share/poudriere/ports.sh
+26-8src/share/poudriere/jail.sh
+52-162 files

FreeBSD/poudriere 2e891d4src/poudriered poudriered.c

poudriered: retain queue while listing it

The list operation passes the global queue to send_object(), which
consumes its argument. A subsequent list request can then release the
stale queue again and terminate the daemon.

Take a temporary queue reference for the response so the global queue
remains valid.

(cherry picked from commit dbabedc99030f7d13696a8dd4382c4756c31fb9d)
DeltaFile
+1-1src/poudriered/poudriered.c
+1-11 files

FreeBSD/poudriere 8a640dbsrc/poudriered poudriered.c

Merge pull request #1369 from acts-1631/fix/poudriered-list-queue

poudriered: retain queue while listing it
DeltaFile
+1-1src/poudriered/poudriered.c
+1-11 files

FreeBSD/poudriere dbabedcsrc/poudriered poudriered.c

poudriered: retain queue while listing it

The list operation passes the global queue to send_object(), which
consumes its argument. A subsequent list request can then release the
stale queue again and terminate the daemon.

Take a temporary queue reference for the response so the global queue
remains valid.
DeltaFile
+1-1src/poudriered/poudriered.c
+1-11 files

FreeBSD/poudriere 940eb10src/share/poudriere common.sh

Merge pull request #1366 from acts-1631/fix/package-output-symlink

Constrain package-output symlinks before host import
DeltaFile
+32-4src/share/poudriere/common.sh
+32-41 files

FreeBSD/poudriere d558fcasrc/share/poudriere common.sh

Do not import symlinks from non-pkg package builds

The package phase lets the jail build user write to a host-backed
/.npkg directory. build_port() imported every file and symlink from
that directory into the host package repository. An absolute symlink
changes meaning at this boundary: it points inside the jail while
mounted but at the host after import.

Only the pkg bootstrap variants need package-manager compatibility
links. Process those links before their targets and reject any that
resolve outside staging. Import only regular files for other ports,
preventing their build output from introducing host-resolved symlinks
into the repository.
DeltaFile
+32-4src/share/poudriere/common.sh
+32-41 files

FreeBSD/poudriere 8f99bacsrc/poudriered poudriered.c

Reject untrusted poudriered log paths

Poudriered allowed any client-authorized command to specify a log
path. The root daemon created its parent directories and opened the
path with O_TRUNC.

Reject log fields on client requests. Preserve configured schedule
logs, use a root-owned /var/log fallback, and refuse to follow final
symlinks when opening logs.

(cherry picked from commit 01d5de2876a23701e41957826cd8115702c41684)
DeltaFile
+15-7src/poudriered/poudriered.c
+15-71 files

FreeBSD/poudriere ef94a32src/poudriered poudriered.c

Merge pull request #1365 from acts-1631/fix/poudriered-log-confinement

Reject client-supplied poudriered log paths
DeltaFile
+15-7src/poudriered/poudriered.c
+15-71 files

FreeBSD/poudriere 9f20e06src/share/poudriere/html build.html

build.html: update "Failed Ports" title bar to match others

a63486e introduced a new title bar style, but failed_div seems to have have been missed. This brings failed_div into line with the others.
DeltaFile
+3-1src/share/poudriere/html/build.html
+3-11 files

FreeBSD/poudriere 121d9e8src/share/poudriere common.sh

Merge pull request #1363 from acts-1631/fix/pkgname-staging-validation

Reject unsafe PKGNAME values before package staging
DeltaFile
+22-0src/share/poudriere/common.sh
+22-01 files