LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-07-2017, 05:09 AM   #1
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Question how is extra/bash_completion supposed to work?


installed this packages, but
/etc/bash_completion.d/
stays empty

everything is in /usr/share/bash-completion/
and git copmletition in the git doc dir?

do I need to copy all files self to /etc/bash_completion.d/ ?

could this not be something that just work on Slackware?
 
Old 01-07-2017, 05:18 AM   #2
rjj
LQ Newbie
 
Registered: Mar 2016
Location: Portugal
Distribution: Slackware64
Posts: 25

Rep: Reputation: Disabled
Hi,

I think all you need to do is
Code:
# installpkg <path_to_slackware_mount>/extra/bash-completion/bash-completion-2.2-noarch-3.txz
For Git, I followed: https://git-scm.com/book/en/v1/Git-B...ips-and-Tricks
 
Old 01-07-2017, 05:19 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by a4z View Post
installed this packages, but
/etc/bash_completion.d/
stays empty

everything is in /usr/share/bash-completion/
and git copmletition in the git doc dir?

do I need to copy all files self to /etc/bash_completion.d/ ?

could this not be something that just work on Slackware?
well, it actually just works, I'm using it: maybe you have just to logout and login again (or source /etc/profile), check /etc/profile.d/bash_completion.sh

the directory /etc/bash_completion.d/ is for the third-party completion stuff (here it contains the files acroread, libreoffice.sh and youtube-dl.bash-completion).

git is a special case as it doesn't install bash completion stuff in the usual places by default: so yes, if you prefer you can copy its git-completion.bash in /etc/bash_completion.d or ~/.config/bash_completion

Last edited by ponce; 01-07-2017 at 05:31 AM. Reason: grammar
 
1 members found this post helpful.
Old 01-07-2017, 09:16 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
This is something seen in other packages as well. Typically /usr/ locations are for upstream or distribution supplied files, and then /etc/ locations are for the user to add over override other files. One of the most common packages you see this with is X (/usr/share/X11/xorg.conf.d/ vs /etc/X11/xorg.conf.d/).
 
Old 01-07-2017, 10:47 AM   #5
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Original Poster
Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
2 observations:

1:
it does not work for me if I boot to runleven 4, the output of complete -p is totally empty kde terminal, xfce terminal, terminator,

but not if I log in on a shell via runlevel 3 or switching to a Ctr+Alt+f1 session. but this login ignores my .bashrc

shouldn't a login always run the global profile, why is my x session ignoring that?
what is the correct setup? starting each shell as login shell and sourcing .bashrc in .profile?


2:
not all software assumes that bash completion is available and puts therefore config files somewhere else.
for example git, the useful stuff is in /usr/doc/git-2.9.0/contrib/completion/

this is not good, if I would for example like to add bash completion to sbbdep, I could not assume that bash completion is active and would also have to deliver my completion files in the doc folder?
should in 2017 bash completion not be available per default?
 
Old 01-07-2017, 10:59 AM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by a4z View Post
shouldn't a login always run the global profile, why is my x session ignoring that?
it depends on how you initialize your shells but yes, a login shell should read /etc/profile (see "man bash" in the "INVOCATION" section).
Quote:
what is the correct setup?
there's not actually a "correct" setup, there are multiple choices.
Quote:
starting each shell as login shell and sourcing .bashrc in .profile?
in my terminals I do like that.

Quote:
not all software assumes that bash completion is available and puts therefore config files somewhere else.
for example git, the useful stuff is in /usr/doc/git-2.9.0/contrib/completion/

this is not good, if I would for example like to add bash completion to sbbdep, I could not assume that bash completion is active and would also have to deliver my completion files in the doc folder?
should in 2017 bash completion not be available per default?
this depends mostly on how upstream decide to do things: if the bash_completion stuff is installed by the "make install" in the usual places then it's available by default, if upstream decides to put it in a contrib directory then it's there where you most probably will find it when packaged.
if you decide that your completion file for sbbdep has to be available by default to whoever has bash_completion enabled, IMHO, the right place where "make install" has to put it is /usr/share/bash-completion/completions

Last edited by ponce; 01-07-2017 at 11:19 AM.
 
1 members found this post helpful.
Old 01-07-2017, 11:31 AM   #7
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Original Poster
Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
thanks, need to write a blog entry for that since I tend to forget from one fresh install to an other.
/etc/profiled.d stuff is invoked also in the various terminals, but all the alias stuff disappears (that's why export -f should be preferred over alias). I am unsure how often I have already learned that now :-)

but, the git situations is still less than optimal...

edit: and why . /usr/share/bash-completion/bash_completion
does this mean this will be ignored/
Code:
ls /etc/bash_completion.d/
dkms  libreoffice.sh*
installed via sbo dkms, and alienbob libreoffice

Last edited by a4z; 01-07-2017 at 11:37 AM.
 
Old 01-07-2017, 11:53 AM   #8
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
why . /usr/share/bash-completion/bash_completion
does this mean this will be ignored/
Code:
ls /etc/bash_completion.d/
dkms  libreoffice.sh*
installed via sbo dkms, and alienbob libreoffice
/etc/bash_completion.d is defined as BASH_COMPLETION_COMPAT_DIR in /usr/share/bash-completion/bash_completion so it's parsed too.
 
1 members found this post helpful.
Old 01-08-2017, 02:18 PM   #9
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Original Poster
Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
decided to source the stuff in .bashrc,
/etc/profile/d/bash_completion.sh and extra some of the aliases of coreutils-dircolors.sh
since this will make all terminal applications work out of the box, without customizing the shell command to `bash -l`
thanks for the help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash_completion from /extra only works for root moesasji Slackware 4 01-07-2016 10:13 AM
LXer: LINdependence 2008 - The way it is Supposed to work. LXer Syndicated Linux News 0 06-03-2008 11:11 AM
But that's NOT supposed to work! (replacing video-card) Bernard Swiss Linux - General 5 12-03-2007 10:50 PM
Hal, does it really work? and if so, what exactly is it supposed to achieve? vdemuth Linux - General 2 03-04-2006 07:16 AM
What are the .rpm things and how are they supposed to work?! Ben84 Linux - Newbie 4 04-18-2005 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration