Poudriere's pkgclean not removing all requested packages

I'm trying to remove stale packages that I've built over the years with poudriere via its pkgclean action, and though at first it appears to be successful, it does seem to miss quite a few packages:

Code:
-> poudriere pkgclean -v -j 13_4 -p latest -A
(…)
[00:00:23] Removing these 1341 stale packages will free: 3.07 GiB
[00:00:23] Proceed? [y/N] y
(…)
[00:00:26] Cleaned all packages but /usr/local/poudriere/data/packages/13_4-latest/.latest may need to be removed manually.
[00:00:26] Cleaning up
[00:00:26] Unmounting file systems
-> pwd
/usr/local/poudriere/data/packages
-> ls 13_4-latest/All/
(nothing, as expected)
-> ls -l 13_4-latest/.real_1752892758/All/*.pkg | wc -l
    1339
-> poudriere pkgclean -v -j 13_4 -p latest -A
[00:00:00] No packages exist for 13_4-latest

And so on for a quarterly ports tree I also keep.

I don't quite know why pkgclean is not cleaning out that .real_1752892758 directory nor why it's failing to recognize it when asked to clean again the same ports tree & jail combo. And of course I know I could simply clean it out manually via rm; but, more than anything, what I'd prefer is to learn if there's something I'm doing wrong with poudriere and/or pkgclean that could be causing this situation.

Thank you!
 
Those directories are older package builds. poudriere-pkgclean(8) only goes through the current package repository. If you want to get rid of these just delete them, and turn off KEEP_OLD_PACKAGES.

Code:
# Keep older package repositories. This can be used to rollback a system
# or to bisect issues by changing the repository to one of the older
# versions and reinstalling everything with `pkg upgrade -f`
# ATOMIC_PACKAGE_REPOSITORY is required for this.
# Default: no
KEEP_OLD_PACKAGES=yes

# How many old package repositories to keep with KEEP_OLD_PACKAGES
# Default: 5
KEEP_OLD_PACKAGES_COUNT=5
 
Those directories are older package builds. poudriere-pkgclean(8) only goes through the current package repository. If you want to get rid of these just delete them, and turn off KEEP_OLD_PACKAGES.

Code:
# Keep older package repositories. This can be used to rollback a system
# or to bisect issues by changing the repository to one of the older
# versions and reinstalling everything with `pkg upgrade -f`
# ATOMIC_PACKAGE_REPOSITORY is required for this.
# Default: no
KEEP_OLD_PACKAGES=yes

# How many old package repositories to keep with KEEP_OLD_PACKAGES
# Default: 5
KEEP_OLD_PACKAGES_COUNT=5
Ah, makes sense! I remember going through poudriere.conf when I first configured it and enabling KEEP_OLD_PACKAGES, thinking it'd cause poudriere-bulk(8) to create and keep somePackage-version1.pkg, somePackage-version2.pkgsomePackage-versionN.pkg, or something like that, up to KEEP_OLD_PACKAGES_COUNT instances for each built package, all within a single "package repository", rather than entirely separate package repositories.

But, then again, I was just getting started with my own poudriere builder at the time and there was so much more to learn and setup, and I guess I just forgot to check on this.

Now paying proper attention to and understanding the use of the word "repository" there (in my defense, I feel the settings should have been called KEEP_OLD_PACKAGE_REPOSITORIES & KEEP_OLD_PACKAGE_REPOSITORIES_COUNT), I guess my next question is how/when does poudriere decide to move the current/latest one to the side and create a new one, cleaning out all older ones that fall outside the KEEP_OLD_PACKAGES_COUNT count. I don't recall ever telling poudriere explicitly to do anything like that, so I guess there must be some automated criteria by which poudriere decides "it's time to archive this packages repository and start a new one from scratch". Is it, perhaps, every single time "bulk" is invoked? (which would essentially mean that, if I'm not mistaken, for poudriere a "package repository" is a one-off thing rather than a build-and-reuse thing).

Thanks for the help and explanations, most appreciated!
 
Back
Top