Skip to content

Commit

Permalink
bash-completion: complete tar with xbps files
Browse files Browse the repository at this point in the history
Backported from upstream scop/bash-completion#688

Fix checkdepends so tests run, deselect 26 tests that fail atm,
with the goal of fixing this for next release 2.12.

Also conditionally deselect a couple of tests that fail only on CI.
  • Loading branch information
tornaria authored and paper42 committed Jan 24, 2022
1 parent c8a3914 commit 64571d4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
24 changes: 24 additions & 0 deletions srcpkgs/bash-completion/patches/complete-xbps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Complete tar with .xbps files.

Backported from upstream https://github.com/scop/bash-completion/pull/688

--- a/completions/tar
+++ b/completions/tar 2022-01-23 11:42:19.699734913 -0300
@@ -422,7 +422,7 @@

__tar_detect_ext()
{
- local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst))'
+ local tars='@(@(tar|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst)|gem|xbps)'
ext="$tars"

case "$tar_mode_arg" in
@@ -430,7 +430,7 @@
# Should never happen?
;;
?(-)*[cr]*f)
- ext='@(tar|gem|spkg)'
+ ext='@(tar|gem|spkg|xbps)'
case ${words[1]} in
*a*) ext="$tars" ;;
*z*) ext='t?(ar.)gz' ;;
51 changes: 50 additions & 1 deletion srcpkgs/bash-completion/template
Original file line number Diff line number Diff line change
@@ -1,13 +1,62 @@
# Template file for 'bash-completion'
pkgname=bash-completion
version=2.11
revision=2
revision=3
build_style=gnu-configure
make_install_args="profiledir=/etc/bash/bashrc.d"
depends="bash"
checkdepends="python3-pytest python3-pexpect"
short_desc="Programmable completion for the GNU Bash shell"
maintainer="skmpz <dem.procopiou@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://github.com/scop/bash-completion"
distfiles="https://github.com/scop/bash-completion/releases/download/${version}/bash-completion-${version}.tar.xz"
checksum=73a8894bad94dee83ab468fa09f628daffd567e8bef1a24277f1e9a0daf911ac

# Summary of tests:
# = 26 failed, 1106 passed, 457 skipped, 14 xfailed, 4 xpassed in 1126.01s (0:18:46) =

# FIXME: 26 tests listed below fail, see #35201
_test_deselect="
test_aclocal.py::TestAclocal::test_1
test_chsh.py::TestChsh::test_2
test_ether_wake.py::TestEtherWake::test_1
test_gdb.py::TestGdb::test_2
test_ifdown.py::TestIfdown::test_1
test_ifstat.py::TestIfstat::test_2
test_ifup.py::TestIfup::test_1
test_iperf.py::TestIperf::test_2
test_killall.py::TestKillall::test_1
test_nethogs.py::TestNethogs::test_1
test_perldoc.py::TestPerldoc::test_1
test_perldoc.py::TestPerldoc::test_3
test_pgrep.py::TestPgrep::test_1
test_pidof.py::TestPidof::test_1
test_pkill.py::TestPkill::test_1
test_pwdx.py::TestPwdx::test_1
test_renice.py::TestRenice::test_1
test_renice.py::TestRenice::test_2
test_reptyr.py::TestReptyr::test_1
test_service.py::TestService::test_1
test_tar.py::TestTar::test_4
test_tar.py::TestTar::test_22
unit/test_unit_ip_addresses.py::TestUnitIpAddresses::test_1
unit/test_unit_ip_addresses.py::TestUnitIpAddresses::test_2
unit/test_unit_ip_addresses.py::TestUnitIpAddresses::test_3
unit/test_unit_ip_addresses.py::TestUnitIpAddresses::test_4
"

if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
# these fail on CI because of some confusion with the homedir
_test_deselect+="
unit/test_unit_expand.py::TestUnitExpand::test_user_home
unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand
"
fi

pre_check() {
for t in $_test_deselect; do
PYTEST_ADDOPTS+=" --deselect=t/$t"
done
export PYTEST_ADDOPTS
}

0 comments on commit 64571d4

Please sign in to comment.