Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
vital: adapt the upgrade test to the new behaviour
Baptiste Daroussin committed 1 year ago
commit 2883c71ff1a297ca3b023654ebb1549196402d14
parent 539f55a
2 files changed +16 -3
modified libpkg/pkg_jobs.c
@@ -2197,7 +2197,7 @@ pkg_jobs_execute(struct pkg_jobs *j)
					pkg_emit_error(
					    "Cannot delete vital package: %s!", p->name);
					pkg_emit_error(
-
					    "If you are sure you want to remove %s, ", p->name);
+
					    "If you are sure you want to remove %s", p->name);
					pkg_emit_error(
					    "unset the 'vital' flag with: pkg set -v 0 %s", p->name);
					retcode = EPKG_FATAL;
modified tests/frontend/upgrade.sh
@@ -322,7 +322,20 @@ Checking integrity... done (1 conflicting)
  - myplop-2 conflicts with mymeta-1 on ${TMPDIR}/file-pkg-1/file
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
-
Your packages are up to date.
+
The following 2 package(s) will be affected (of 0 checked):
+

+
Installed packages to be UPGRADED:
+
	myplop: 1 -> 2
+

+
Installed packages to be REMOVED:
+
	mymeta: 1
+

+
Number of packages to be removed: 1
+
Number of packages to be upgraded: 1
+
"
+
	ERROR="pkg: Cannot delete vital package: mymeta!
+
pkg: If you are sure you want to remove mymeta
+
pkg: unset the 'vital' flag with: pkg set -v 0 mymeta
"
-
	atf_check -o inline:"${OUTPUT}" pkg -o REPOS_DIR="$TMPDIR/repoconf" -r ${TMPDIR}/target -o PKG_CACHEDIR="$TMPDIR" upgrade -y
+
	atf_check -o inline:"${OUTPUT}" -e inline:"${ERROR}" -s exit:3 pkg -o REPOS_DIR="$TMPDIR/repoconf" -r ${TMPDIR}/target -o PKG_CACHEDIR="$TMPDIR" upgrade -y
}