Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Bash completion misbehaviour, quilt customization

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
rockstorm
Posts: 21
Joined: 2014-09-27 16:51

[SOLVED] Bash completion misbehaviour, quilt customization

#1 Post by rockstorm »

I'm getting some weird behaviour from the bash completion feature. I configured quilt as is explained in the New Maintainers Guide [1], so this two lines are currently on my '~/.bashrc' file:

Code: Select all

alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
complete -F _quilt_completion -o filenames dquilt
But it does not work as expected. I get:

Code: Select all

$ dquilt [Tab]
$ dquilt bash: completion: function `_quilt_completion' not found
quilt completion works fine:

Code: Select all

$ quilt [Tab]
add        edit       grep       mail       previous   revert     top
annotate   files      -h         new        push       series     unapplied
applied    fold       header     next       refresh    setup      upgrade
delete     fork       import     patches    remove     shell      
diff       graph      init       pop        rename     snapshot
I made sure the function is actually called "_quilt_completion" by looking at the quilt completion file, '/usr/share/bash-completion/completions/quilt", has this lines:

Code: Select all

_quilt_completion()
[...]
_quilt_complete_opt="-o filenames"
complete -F _quilt_completion $_quilt_complete_opt quilt
unset -v _quilt_complete_opt
So the function exists but it is somehow not finding it. But where it gets really weird is, if I run quilt and then the alias dquilt it works as expected for both:

Code: Select all

$ quilt [Tab]
add        edit       grep       mail       previous   revert     top
annotate   files      -h         new        push       series     unapplied
applied    fold       header     next       refresh    setup      upgrade
delete     fork       import     patches    remove     shell      
diff       graph      init       pop        rename     snapshot   
$ dquilt [Tab]
add        edit       grep       mail       previous   revert     top
annotate   files      -h         new        push       series     unapplied
applied    fold       header     next       refresh    setup      upgrade
delete     fork       import     patches    remove     shell      
diff       graph      init       pop        rename     snapshot
What am I missing? Please help, you don't realize how useful is this autocompletion thing until it fails :P

[1]: https://www.debian.org/doc/manuals/main ... ml#quiltrc

-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages quilt depends on:
ii bsdmainutils 11.1.2+b1
ii bzip2 1.0.6-9
ii diffstat 1.62-1
ii gettext 0.19.8.1-9
ii patch 2.7.6-3
ii perl 5.28.1-3
ii sensible-utils 0.0.12

Versions of packages quilt recommends:
ii less 487-0.1+b1

Versions of packages quilt suggests:
ii exim4-daemon-light [mail-transport-agent] 4.92~RC4-3
ii graphviz 2.40.1-5+b2
pn procmail <none>

-- no debconf information
Last edited by rockstorm on 2019-02-02 09:52, edited 1 time in total.
"What we have done for ourselves alone dies with us; what we have done for others and the world remains and is immortal."
― Albert Pike

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Bash completion misbehaviour, quilt customization

#2 Post by Head_on_a_Stick »

The completion works for me in buster.

Have you created ~/.quiltrc-dpkg?
deadbang

rockstorm
Posts: 21
Joined: 2014-09-27 16:51

Re: Bash completion misbehaviour, quilt customization

#3 Post by rockstorm »

Head_on_a_Stick wrote: Have you created ~/.quiltrc-dpkg?
Hi, yes I have:

Code: Select all

$ cat .quiltrc-dpkg 
d=. ; while [ ! -d $d/debian -a $(readlink -e $d) != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
    # if in Debian packaging tree with unset $QUILT_PATCHES
    QUILT_PATCHES="debian/patches"
    QUILT_PATCH_OPTS="--reject-format=unified"
    QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
    QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
    QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
    if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi
Any ideas on how to debug this further?
"What we have done for ourselves alone dies with us; what we have done for others and the world remains and is immortal."
― Albert Pike

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Bash completion misbehaviour, quilt customization

#4 Post by Head_on_a_Stick »

Try adding

Code: Select all

_completion_loader quilt
just above the dquilt alias in ~/.bashrc
deadbang

rockstorm
Posts: 21
Joined: 2014-09-27 16:51

Re: Bash completion misbehaviour, quilt customization

#5 Post by rockstorm »

Yay! That works! Thanks a lot.

Any idea of why I need that line there? Have I misconfigured something?
"What we have done for ourselves alone dies with us; what we have done for others and the world remains and is immortal."
― Albert Pike

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Bash completion misbehaviour, quilt customization

#6 Post by Head_on_a_Stick »

rockstorm wrote:Any idea of why I need that line there?
Not a scooby[1], sorry. That answer was brought to you by startpage.com :mrgreen:

[1] Scooby-Doo: clue
deadbang

Post Reply