Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix regression: when reinstalling a package already installed at the latest version return 0
Baptiste Daroussin committed 10 years ago
commit ebc355c6c2cb816239284902643fd5d7a2ad3914
parent 8f046d1
4 files changed +59 -2
modified libpkg/pkg_jobs.c
@@ -1,5 +1,5 @@
/*-
-
 * Copyright (c) 2011-2012 Baptiste Daroussin <bapt@FreeBSD.org>
+
 * Copyright (c) 2011-2016 Baptiste Daroussin <bapt@FreeBSD.org>
 * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
 * Copyright (c) 2011-2012 Marin Atanasov Nikolov <dnaeon@gmail.com>
 * Copyright (c) 2013 Matthew Seaman <matthew@FreeBSD.org>
@@ -1600,7 +1600,7 @@ jobs_solve_install_upgrade(struct pkg_jobs *j)
							jp->pattern);
					return (retcode);
				}
-
				if (retcode != EPKG_OK) {
+
				if (retcode == EPKG_LOCKED) {
					return (retcode);
				}
			}
modified tests/Makefile.am
@@ -87,6 +87,7 @@ tests_scripts= \
		frontend/conflicts-multirepo.sh \
		frontend/create.sh \
		frontend/delete.sh \
+
		frontend/install.sh \
		frontend/jpeg.sh \
		frontend/lock.sh \
		frontend/messages.sh \
modified tests/frontend/Kyuafile.in
@@ -13,6 +13,7 @@ atf_test_program{name='conflicts'}
atf_test_program{name='conflicts-multirepo'}
atf_test_program{name='create'}
atf_test_program{name='delete'}
+
atf_test_program{name='install'}
atf_test_program{name='jpeg'}
atf_test_program{name='lock'}
atf_test_program{name='messages'}
added tests/frontend/install.sh
@@ -0,0 +1,55 @@
+
#! /usr/bin/env atf-sh
+

+
. $(atf_get_srcdir)/test_environment.sh
+

+
tests_init \
+
	reinstall
+

+
reinstall_body()
+
{
+
	cat << EOF > test.ucl
+
name: test
+
origin: test
+
version: 1
+
maintainer: test
+
categories: [test]
+
comment: a test
+
www: http://test
+
prefix: /usr/local
+
desc: <<EOD
+
Yet another test
+
EOD
+
EOF
+

+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg register -M test.ucl
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M test.ucl
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg repo .
+

+
	cat << EOF > repo.conf
+
local: {
+
	url: file:///$TMPDIR,
+
	enabled: true
+
}
+
EOF
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -o REPOS_DIR="${TMPDIR}" install -y test
+
}