Page MenuHomeFreeBSD

release: escape spaces in filenames with METALOG
Needs ReviewPublic

Authored by khorben on Mon, Sep 14, 5:37 PM.
Tags
None
Referenced Files
F171963682: D59670.id186701.diff
Mon, Sep 14, 11:32 PM
F171962655: D59670.diff
Mon, Sep 14, 11:18 PM
F171956310: D59670.id186701.diff
Mon, Sep 14, 10:05 PM
F171955883: D59670.diff
Mon, Sep 14, 10:00 PM
F171955800: D59670.diff
Mon, Sep 14, 10:00 PM

Details

Reviewers
andrew
Group Reviewers
pkg
releng
Summary

When generating release images, the METALOG option of pkg(8) is used to list the contents of binary packages installed in the image created. The resulting output is provided to makefs(8) as part of the mtree specfile describing the files. However, spaces in filenames are not escaped and confuse the parser.

These changes introduce an awk(1) script, escaping the part of the METALOG file before the first tag (type=) is encountered, when used by
makefs(8).

Affects and fixes amd64, arm64, and i386; tested on FreeBSD/amd64.

Sponsored by: The FreeBSD Foundation

Test Plan

Add packages such as lcms2 to the list of packages to install in release/Makefile, and run:

$ make buildworld buildkernel packages
[...]
$ (cd release && make dvdrom memstick)
[...]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Adding pkg for review, since this might really be a bug with the -o METALOG option in pkg(8).

i'm curious why we have files with spaces in on the release to begin with. where do those come from?

In D59670#1369462, @ivy wrote:

i'm curious why we have files with spaces in on the release to begin with. where do those come from?

We do not :)

But if someone creates a custom image with extra packages (like I do e.g., for the graphical installer) and these packages contain files with spaces in the filename (like lcms2, a dependency for Gtk+ 3) then we have the issue.

So this is by no means a release blocker, but it's a nice to have for more advanced uses and downstreams extending the build system.