Skip to content

Commit 7b5d158

Browse files
authored
Merge pull request #842 from scop/test/shadow-deprecated-dir
test: create shadow completions dir for deprecated in-tree completions
2 parents 79e9d93 + 886d5e9 commit 7b5d158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+112
-7
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ repos:
3535
files: ^test/t/.+\.py$
3636
pass_filenames: false
3737

38+
- id: update-test-deprecated-links
39+
name: update-test-deprecated-links
40+
language: script
41+
entry: test/deprecated/update-deprecated-links
42+
files: ^completions/_
43+
pass_filenames: false
44+
3845
- repo: https://github.com/psf/black
3946
rev: 22.3.0
4047
hooks:

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ completions/Makefile
1717
doc/Makefile
1818
helpers/Makefile
1919
test/Makefile
20+
test/deprecated/Makefile
21+
test/deprecated/completions/Makefile
2022
test/t/Makefile
2123
test/t/unit/Makefile
2224
])

test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBDIRS = t
1+
SUBDIRS = deprecated t
22

33
EXTRA_DIST = config \
44
fixtures \

test/config/bashrc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ export BASH_COMPLETION_USER_FILE=/dev/null
3333
# ...and avoid stuff in BASH_COMPLETION_USER_DIR and system install locations
3434
# overriding in-tree completions. Setting the user dir would otherwise suffice,
3535
# but simple xspec completions are only installed if a separate one is not
36-
# found in any completion dirs. Therefore we also point the "system" dirs to
37-
# locations that should not yield valid completions and helpers paths either.
38-
export BASH_COMPLETION_USER_DIR=$(
39-
cd "$SRCDIR/.." || exit 1
40-
pwd
41-
)
36+
# found in *any* completion dirs, and we want to use our "shadow" completion
37+
# dir with which we cause loading of our in-tree deprecated completions
38+
# instead of possibly (system-)installed upstream ones.
39+
export BASH_COMPLETION_USER_DIR="$SRCDIRABS/deprecated"
4240
# /var/empty isn't necessarily actually always empty :P
4341
export BASH_COMPLETION_COMPAT_DIR=/var/empty/bash_completion.d
4442
export BASH_COMPLETION_COMPAT_IGNORE='*'

test/deprecated/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SUBDIRS = completions
2+
3+
EXTRA_DIST = \
4+
update-deprecated-links
5+
6+
update:
7+
./update-deprecated-links
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
EXTRA_DIST = \
2+
adb \
3+
cal \
4+
chfn \
5+
chsh \
6+
dmesg \
7+
eject \
8+
hexdump \
9+
hwclock \
10+
ionice \
11+
look \
12+
mock \
13+
modules \
14+
mount \
15+
mount.linux \
16+
newgrp \
17+
nmcli \
18+
op \
19+
renice \
20+
repomanage \
21+
reptyr \
22+
rfkill \
23+
rtcwake \
24+
runuser \
25+
slackpkg \
26+
su \
27+
svn \
28+
svnadmin \
29+
svnlook \
30+
udevadm \
31+
umount \
32+
umount.linux \
33+
write \
34+
xm \
35+
yum
Lines changed: 8 additions & 0 deletions

test/deprecated/completions/adb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../completions/_adb

test/deprecated/completions/cal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../completions/_cal

test/deprecated/completions/chfn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../completions/_chfn

0 commit comments

Comments
 (0)