Fix #69 (No way to set globally a custom architecture)
The "architecture" configuration keyword is now available to override the native machine architecture returned by (uname(2)). The XBPS_ARCH environment variable still has preference.
This commit is contained in:
@@ -8,3 +8,5 @@ include('xbps-create/Kyuafile')
|
||||
include('xbps-install/Kyuafile')
|
||||
include('xbps-query/Kyuafile')
|
||||
include('xbps-rindex/Kyuafile')
|
||||
include('xbps-uhelper/Kyuafile')
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
-include ../../config.mk
|
||||
|
||||
SUBDIRS = common libxbps xbps-checkvers xbps-create xbps-install xbps-query xbps-rindex
|
||||
SUBDIRS = common libxbps xbps-checkvers xbps-create xbps-install xbps-query xbps-rindex xbps-uhelper
|
||||
|
||||
include ../../mk/subdir.mk
|
||||
|
4
tests/xbps/xbps-uhelper/Kyuafile
Normal file
4
tests/xbps/xbps-uhelper/Kyuafile
Normal file
@@ -0,0 +1,4 @@
|
||||
syntax("kyuafile", 1)
|
||||
|
||||
test_suite("xbps-uhelper")
|
||||
atf_test_program{name="arch_test"}
|
8
tests/xbps/xbps-uhelper/Makefile
Normal file
8
tests/xbps/xbps-uhelper/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
TOPDIR = ../../..
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
TESTSHELL = arch_test
|
||||
TESTSSUBDIR = xbps/xbps-uhelper
|
||||
EXTRA_FILES = Kyuafile
|
||||
|
||||
include $(TOPDIR)/mk/test.mk
|
39
tests/xbps/xbps-uhelper/arch_test.sh
Normal file
39
tests/xbps/xbps-uhelper/arch_test.sh
Normal file
@@ -0,0 +1,39 @@
|
||||
#! /usr/bin/env atf-sh
|
||||
# Test that xbps-uhelper arch works as expected.
|
||||
|
||||
atf_test_case native
|
||||
|
||||
native_head() {
|
||||
atf_set "descr" "xbps-uhelper arch: native test"
|
||||
}
|
||||
|
||||
native_body() {
|
||||
atf_check_equal $(xbps-uhelper arch) $(uname -m)
|
||||
}
|
||||
|
||||
atf_test_case env
|
||||
|
||||
env_head() {
|
||||
atf_set "descr" "xbps-uhelper arch: envvar override test"
|
||||
}
|
||||
env_body() {
|
||||
export XBPS_ARCH=foo
|
||||
atf_check_equal $(xbps-uhelper arch) foo
|
||||
}
|
||||
|
||||
atf_test_case conf
|
||||
|
||||
conf_head() {
|
||||
atf_set "descr" "xbps-uhelper arch: configuration override test"
|
||||
}
|
||||
conf_body() {
|
||||
mkdir -p xbps.d
|
||||
echo "architecture=x86_64-musl" > xbps.d/arch.conf
|
||||
atf_check_equal $(xbps-uhelper -C $PWD/xbps.d arch) x86_64-musl
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case native
|
||||
atf_add_test_case env
|
||||
atf_add_test_case conf
|
||||
}
|
Reference in New Issue
Block a user