aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2020-06-10 06:14:26 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2020-06-10 06:14:26 +0000
commit2895529ab08c8559a2b8b13b87ec5603f1f1176b (patch)
tree88ae458045f08ec49adb520d5865d40e4b208a00
parent44b4b4c65c3cffad31b18f11186c7578747d4931 (diff)
downloadports-2895529ab08c8559a2b8b13b87ec5603f1f1176b.tar.gz
ports-2895529ab08c8559a2b8b13b87ec5603f1f1176b.zip
MFH: r538369
sysutils/firstboot-pkgs: Bootstrap and update pkg unconditionally The background of this patch is available at: https://lists.freebsd.org/pipermail/freebsd-cloud/2020-April/000234.html Even a `pkg -N` success, the following `pkg install` may still fail because of the repository version doesn't match between client and server. Therefore, unconditionally bootstrap and update pkg at firstboot to ensure pkg and local metadata are update-to-date. Approved by: cperciva (maintainer) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24517 Approved by: ports-secteam (joneum)
Notes
Notes: svn path=/branches/2020Q2/; revision=538375
-rw-r--r--sysutils/firstboot-pkgs/Makefile2
-rw-r--r--sysutils/firstboot-pkgs/files/firstboot_pkgs.in8
2 files changed, 4 insertions, 6 deletions
diff --git a/sysutils/firstboot-pkgs/Makefile b/sysutils/firstboot-pkgs/Makefile
index 9d023485c4f7..8ec4f1b10edb 100644
--- a/sysutils/firstboot-pkgs/Makefile
+++ b/sysutils/firstboot-pkgs/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= firstboot-pkgs
-PORTVERSION= 1.5
+PORTVERSION= 1.6
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/firstboot-pkgs/files/firstboot_pkgs.in b/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
index 886ac4221dab..0834148afd49 100644
--- a/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
+++ b/sysutils/firstboot-pkgs/files/firstboot_pkgs.in
@@ -30,11 +30,9 @@ firstboot_pkgs_run()
# Count rc.d scripts
nscriptso=`ls /usr/local/etc/rc.d | wc -l`
- # Bootstrap if necessary
- if ! pkg -N 2>/dev/null; then
- env ASSUME_ALWAYS_YES=YES pkg bootstrap |
- cat
- fi
+ # Bootstrap and update pkg to ensure synchronization with the repository
+ env ASSUME_ALWAYS_YES=YES pkg bootstrap -f | cat
+ env ASSUME_ALWAYS_YES=YES pkg update -f | cat
# Install requested packages, if any
for package in ${firstboot_pkgs_list}; do