Skip to content

Is pkg not setting the mtime in files? #2655

@jlduran

Description

@jlduran

I want to create a 461.pkg-metadata periodic script based on 460.pkg-checksum. This one should run pkg check -qma, to complement the pkg check -qsa ran in 460.pkg-checksum.

When the command pkg check -qma is executed, all files appear to have an mtime different than the one in the +MANIFEST file, therefore triggering a mismatch. In fact, all files have an mtime = birthtime. Is pkg not setting it?


Let's take /etc/dma/dma.conf:

# pkg check -qma 2>&1 | grep /etc/dma/dma.conf
FreeBSD-dma-16.snap20260424024359: /etc/dma/dma.conf [mtime] Fri Aug  8 13:40:18 2025 -> Fri Apr 24 02:24:13 2026

Converted:

Fri Aug 8 13:40:18 2025 = UNIX epoch 1754660418, this is the mtime in the +MANIFEST file
Fri Apr 24 02:24:13 2026 = UNIX epoch 1776997453, this is the mtime of the file (same as birthtime)

The mtime appears to match the birthtime of the file:

# stat -s /etc/dma/dma.conf
st_dev=10787618496918884320 st_ino=15724 st_mode=0100640 st_nlink=2 st_uid=0 st_gid=6 st_rdev=18446744073709551615 st_size=2150 st_atime=1777079871 st_mtime=1776997453 st_ctime=1777079870 st_birthtime=1776997453 st_blksize=4096 st_blocks=9 st_flags=2048

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions