Fix #53 (xbps-install with multiple arguments shouldn't fail if one is already installed).
This commit is contained in:
parent
7cef93ce07
commit
4c14785480
@ -238,7 +238,9 @@ main(int argc, char **argv)
|
|||||||
/* Install target packages */
|
/* Install target packages */
|
||||||
for (i = optind; i < argc; i++) {
|
for (i = optind; i < argc; i++) {
|
||||||
rv = install_new_pkg(&xh, argv[i], reinstall);
|
rv = install_new_pkg(&xh, argv[i], reinstall);
|
||||||
if (rv != 0) {
|
if (optind >= 2 && rv == EEXIST) {
|
||||||
|
rv = 0;
|
||||||
|
} else if (rv != 0) {
|
||||||
xbps_pkgdb_unlock(&xh);
|
xbps_pkgdb_unlock(&xh);
|
||||||
exit(rv);
|
exit(rv);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-include ../../config.mk
|
-include ../../config.mk
|
||||||
|
|
||||||
SUBDIRS = common libxbps xbps-query xbps-rindex
|
SUBDIRS = common libxbps xbps-install xbps-query xbps-rindex
|
||||||
|
|
||||||
include ../../mk/subdir.mk
|
include ../../mk/subdir.mk
|
||||||
|
@ -3,5 +3,6 @@ syntax("kyuafile", 1)
|
|||||||
test_suite("xbps")
|
test_suite("xbps")
|
||||||
|
|
||||||
include('libxbps/Kyuafile')
|
include('libxbps/Kyuafile')
|
||||||
|
include('xbps-install/Kyuafile')
|
||||||
include('xbps-query/Kyuafile')
|
include('xbps-query/Kyuafile')
|
||||||
include('xbps-rindex/Kyuafile')
|
include('xbps-rindex/Kyuafile')
|
||||||
|
4
tests/xbps/xbps-install/Kyuafile
Normal file
4
tests/xbps/xbps-install/Kyuafile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
syntax("kyuafile", 1)
|
||||||
|
|
||||||
|
test_suite("xbps-install")
|
||||||
|
atf_test_program{name="behaviour_tests"}
|
8
tests/xbps/xbps-install/Makefile
Normal file
8
tests/xbps/xbps-install/Makefile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
TOPDIR = ../../..
|
||||||
|
-include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
TESTSHELL = behaviour_tests
|
||||||
|
TESTSSUBDIR = xbps/xbps-install
|
||||||
|
EXTRA_FILES = Kyuafile
|
||||||
|
|
||||||
|
include $(TOPDIR)/mk/test.mk
|
33
tests/xbps/xbps-install/behaviour_tests.sh
Normal file
33
tests/xbps/xbps-install/behaviour_tests.sh
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#! /usr/bin/env atf-sh
|
||||||
|
|
||||||
|
atf_test_case install_existent
|
||||||
|
|
||||||
|
install_existent_head() {
|
||||||
|
atf_set "descr" "xbps-install(8): install multiple existent pkgs (issue #53)"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_existent_body() {
|
||||||
|
mkdir -p some_repo pkg_A pkg_B
|
||||||
|
touch pkg_A/file00
|
||||||
|
touch pkg_B/file00
|
||||||
|
cd some_repo
|
||||||
|
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
|
||||||
|
atf_check_equal $? 0
|
||||||
|
xbps-rindex -a *.xbps
|
||||||
|
atf_check_equal $? 0
|
||||||
|
xbps-create -A noarch -n B-1.1_1 -s "B pkg" ../pkg_B
|
||||||
|
atf_check_equal $? 0
|
||||||
|
xbps-rindex -a *.xbps
|
||||||
|
atf_check_equal $? 0
|
||||||
|
cd ..
|
||||||
|
xbps-install -r root -C empty.conf --repository=$PWD/some_repo -y A
|
||||||
|
atf_check_equal $? 0
|
||||||
|
xbps-install -r root -C empty.conf --repository=$PWD/some_repo -yn A B
|
||||||
|
atf_check_equal $? 0
|
||||||
|
xbps-install -r root -C empty.conf --repository=$PWD/some_repo -yn B A
|
||||||
|
atf_check_equal $? 0
|
||||||
|
}
|
||||||
|
|
||||||
|
atf_init_test_cases() {
|
||||||
|
atf_add_test_case install_existent
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user