git: ef6b3c58883d - releng/13.5 - release: Chase location of pkg repo databases

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Sun, 09 Feb 2025 21:19:05 UTC
The branch releng/13.5 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=ef6b3c58883d5746084d0a5f7013d9851f232f73

commit ef6b3c58883d5746084d0a5f7013d9851f232f73
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2025-02-04 00:10:47 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-02-09 21:18:40 +0000

    release: Chase location of pkg repo databases
    
    pkg used to store copies of upstream repository databases in
    /var/db/pkg/repo-*.sqlite.  About a year ago this was moved to
    /var/db/pkg/repos/*/, resulting in FreeBSD cloud images no longer
    having those (unhelpful since they'll be long out of date before
    the cloud images are launched) databases removed.
    
    Remove the correct location, and hope that future pkg updates don't
    break the base system again.
    
    Sponsored by:   Amazon
    Approved by:    re (cperciva)
    
    (cherry picked from commit 078e8b34b13d6d0663661542eeac9007806fccdc)
    (cherry picked from commit 8984d070d6669669754ba1f66c7acd6d7dca1d2a)
---
 release/tools/ec2.conf     | 2 +-
 release/tools/vagrant.conf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index 86706e21513c..2776331d9905 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -45,7 +45,7 @@ vm_extra_pre_umount() {
 	chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
 		/usr/sbin/pkg delete -f -y pkg
 	umount ${DESTDIR}/dev
-	rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
+	rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD
 
 	# The size of the EC2 root disk can be configured at instance launch
 	# time; expand our filesystem to fill the disk.
diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf
index 5a4aa7d3ba79..2735ad2974cb 100644
--- a/release/tools/vagrant.conf
+++ b/release/tools/vagrant.conf
@@ -20,7 +20,7 @@ vagrant_common () {
 	# them from the image allows it to boot faster.
 	env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} clean -y -a
 	env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
-	rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
+	rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD
 
 	# Vagrant instances use DHCP to get their network configuration.
 	echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf