xbps-{install,query}: added -i to ignore repos defined in xbps.d.

See the NEWS file for more information.
This commit is contained in:
Juan RP
2014-11-21 10:56:41 +01:00
parent a72a52da1d
commit 89d11e871f
10 changed files with 94 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
syntax("kyuafile", 1)
test_suite("xbps-query")
atf_test_program{name="ignore_repos_test"}
atf_test_program{name="remote_test"}

View File

@@ -1,7 +1,7 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TESTSHELL = remote_test
TESTSHELL = ignore_repos_test remote_test
TESTSSUBDIR = xbps/xbps-query
EXTRA_FILES = Kyuafile

View File

@@ -0,0 +1,54 @@
#! /usr/bin/env atf-sh
# Test that xbps-query(8) -i works as expected
atf_test_case ignore_system
ignore_system_head() {
atf_set "descr" "xbps-query(8) -i: ignore repos defined in the system directory (sharedir/xbps.d)"
}
ignore_system_body() {
mkdir -p repo pkg_A/bin
touch pkg_A/bin/file
ln -s repo repo1
cd repo
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
rm -f *.xbps
cd ..
systemdir=$(xbps-uhelper getsystemdir)
mkdir -p root/${systemdir}
echo "repository=$PWD/repo1" > root/${systemdir}/myrepo.conf
out="$(xbps-query -C empty.conf --repository=$PWD/repo -i -L|wc -l)"
atf_check_equal "$out" 1
}
atf_test_case ignore_conf
ignore_conf_head() {
atf_set "descr" "xbps-query(8) -i: ignore repos defined in the configuration directory (xbps.d)"
}
ignore_conf_body() {
mkdir -p repo pkg_A/bin
touch pkg_A/bin/file
ln -s repo repo1
cd repo
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
rm -f *.xbps
cd ..
mkdir -p root/xbps.d
echo "repository=$PWD/repo1" > root/xbps.d/myrepo.conf
out="$(xbps-query -r root -C xbps.d --repository=$PWD/repo -i -L|wc -l)"
atf_check_equal "$out" 1
}
atf_init_test_cases() {
atf_add_test_case ignore_conf
atf_add_test_case ignore_system
}