/[smeserver]/rpms/e-smith-lib-compspec/sme10/e-smith-lib-compspec-2.6.0-bz11368-bz4661.patch
ViewVC logotype

Contents of /rpms/e-smith-lib-compspec/sme10/e-smith-lib-compspec-2.6.0-bz11368-bz4661.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Apr 6 20:22:27 2022 UTC (2 years, 7 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-lib-compspec-2_6_0-4_el7_sme, HEAD
* Wed Apr 06 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.6.0-4.sme
- fix last dot erased on completion  [SME: 11368]
- error on incorect cmd input [SME: 4661]

1 diff -Nur --no-dereference e-smith-lib-compspec-2.6.0.old/root/etc/profile.d/e-smith-lib_compspec.sh e-smith-lib-compspec-2.6.0/root/etc/profile.d/e-smith-lib_compspec.sh
2 --- e-smith-lib-compspec-2.6.0.old/root/etc/profile.d/e-smith-lib_compspec.sh 2022-04-06 16:16:21.057000000 -0400
3 +++ e-smith-lib-compspec-2.6.0/root/etc/profile.d/e-smith-lib_compspec.sh 2022-04-06 16:18:35.104000000 -0400
4 @@ -20,7 +20,7 @@
5 _esmith_expand-template ()
6 {
7 if [ ! $(which $1 2>/dev/null) ]; then return 0; fi
8 - local cur; cur=${COMP_WORDS[$COMP_CWORD]}
9 + local cur; cur=$(echo ${COMP_WORDS[$COMP_CWORD]}| sed 's/\./\\./g')
10 case $COMP_CWORD in
11 1) # need to distinguish between templates and fragments
12 COMPREPLY=( $(find /etc/e-smith/templates \
13 @@ -43,6 +43,8 @@
14 if [ ! $(which $1 2>/dev/null) ]; then return 0; fi
15 local cur; cur=${COMP_WORDS[$COMP_CWORD]}
16
17 + local Commands=$(/sbin/e-smith/db 2>&1 | grep "dbfile" | awk '{print $3}')
18 +
19 case $COMP_CWORD in
20 1) # config file
21 COMPREPLY=( $(find /home/e-smith /home/e-smith/db -maxdepth 1 -type f \
22 @@ -50,13 +52,19 @@
23 -name "$cur*" -printf "%f\n" \)) )
24 ;;
25 2) # subcommand
26 - COMPREPLY=( $(/sbin/e-smith/db 2>&1 |awk '{print $3}' \
27 + COMPREPLY=( $(/sbin/e-smith/db 2>&1 | grep "dbfile"|awk '{print $3}' \
28 |grep "^$cur" ) )
29 ;;
30 3) # key
31 local file; file=${COMP_WORDS[1]}
32 local cmd; cmd=${COMP_WORDS[2]}
33 local haskey
34 +
35 + echo "$Commands" | grep -q "^$cmd"
36 + if [ $? -eq 1 ] ; then
37 + COMPREPLY+=("Unknown command '$cmd'" ""); return 0
38 + fi
39 +
40 haskey=$(/sbin/e-smith/db 2>&1 | grep "dbfile $cmd" | awk '{print $4}')
41 if [ -n "$haskey" ]; then
42 COMPREPLY=( $(/sbin/e-smith/db $file keys |grep "^$cur") )
43 @@ -69,6 +77,12 @@
44 local i; i=$COMP_CWORD
45 local prev
46 local valtype
47 +
48 + echo "$Commands" | grep -q "^$cmd"
49 + if [ $? -eq 1 ] ; then
50 + COMPREPLY+=("Unknown command '$cmd'" ""); return 0
51 + fi
52 +
53 while [ "$valtype" == "..." ] || [ "$valtype" == "" ]; do
54 prev=${COMP_WORDS[$[i-1]]}
55 PAT='$3'

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed