Bug 22183 - invalid completions for service
Summary: invalid completions for service
Status: CLOSED WONTFIX
Alias: None
Product: Branch 4.1
Classification: Distributions
Component: bash-completion (show other bugs)
Version: unspecified
Hardware: all Linux
: P3 minor
Assignee: Nobody's working on this, feel free to take it
QA Contact: qa-4.1@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-05 17:21 MSK by Ivan Zakharyaschev
Modified: 2014-11-05 20:43 MSK (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2009-11-05 17:21:59 MSK
bash-completion-20060301-alt05
service-0.5.15-alt1

/etc/bash_completion lists /etc/xinet.d/* as "services":

# This function completes on services                                                                                                       
#                                                                                                                                           
_services()
{
        local sysvdir famdir
        [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
	famdir=/etc/xinetd.d
        COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) )

	if [ -d $famdir ]; then
                COMPREPLY=( ${COMPREPLY[@]} $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*~)) )
        fi

        COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ) )
}
 
But this leads to invalid completions to the calls of /sbin/service:

[root@localhost ~]# l /etc/xinetd.d
total 64
drwxr-xr-x 137 root root  8192 Nov  4 19:06 ../
drwx------   2 root root  4096 Jul 21 04:31 ./
-rw-r-----   1 root wheel  322 Jun 22 09:53 git
-rw-r--r--   1 root root   254 Oct 20  2008 cups-lpd
-rw-r-----   1 root root   294 Mar 28  2008 chargen-tcp
-rw-r-----   1 root root   293 Mar 28  2008 chargen-udp
-rw-r-----   1 root root   294 Mar 28  2008 daytime-tcp
-rw-r-----   1 root root   293 Mar 28  2008 daytime-udp
-rw-r-----   1 root root   294 Mar 28  2008 discard-tcp
-rw-r-----   1 root root   293 Mar 28  2008 discard-udp
-rw-r-----   1 root root   286 Mar 28  2008 echo-tcp
-rw-r-----   1 root root   285 Mar 28  2008 echo-udp
-rw-r-----   1 root root   294 Mar 28  2008 time-tcp
-rw-r-----   1 root root   293 Mar 28  2008 time-udp
[root@localhost ~]# service git 
service: git: Unrecognized service
[root@localhost ~]#
Comment 1 Michael Shigorin 2014-11-05 20:43:06 MSK
В 4.1/branch исправления не будут вноситься уже технически (заглушена очередь на сборку), поэтому прошу ошибки, актуальные для sisyphus/p7/t7, перевесить на текущие ветки или сизиф.