Debian Bug report logs - #430501
/etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION

Package: bash-completion; Maintainer for bash-completion is Gabriel F. T. Gomes <gabriel@debian.org>; Source for bash-completion is src:bash-completion (PTS, buildd, popcon).

Reported by: Josh Triplett <josh@joshtriplett.org>

Date: Mon, 25 Jun 2007 14:02:19 UTC

Severity: wishlist

Done: David Paleino <dapal@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, josh@freedesktop.org, Matthias Klose <doko@debian.org>:
Bug#430501; Package bash. (full text, mbox, link).


Acknowledgement sent to Josh Triplett <josh@freedesktop.org>:
New Bug report received and forwarded. Copy sent to josh@freedesktop.org, Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Josh Triplett <josh@freedesktop.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Sun, 24 Jun 2007 23:58:31 -0700
Package: bash
Version: 3.1dfsg-8
Severity: wishlist
File: /etc/skel/.bashrc

bash_completion defines a variable $BASH_COMPLETION.  I use the following on
my ~/.bashrc, used on many systems, some of which enable bash_completion by
default in the system bash initialization files and some of which do not:

if [ -z "$BASH_COMPLETION" ] && [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

This includes /etc/bash_completion only if available and not already included.

- Josh Triplett

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-rc1 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files                    4.0.0      Debian base system miscellaneous f
ii  debianutils                   2.21       Miscellaneous utilities specific t
ii  libc6                         2.5-11     GNU C Library: Shared libraries
ii  libncurses5                   5.6-3      Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information



Bug reassigned from package `bash' to `bash-completion'. Request was from Luk Claes <luk@debian.org> to control@bugs.debian.org. (Sun, 02 Mar 2008 15:25:12 GMT) (full text, mbox, link).


Bug reassigned from package `bash-completion' to `bash'. Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Fri, 16 May 2008 22:27:05 GMT) (full text, mbox, link).


Changed Bug submitter from Josh Triplett <josh@freedesktop.org> to Josh Triplett <josh@joshtriplett.org>. Request was from Josh Triplett <josh@joshtriplett.org> to control@bugs.debian.org. (Sat, 04 Jul 2009 09:52:24 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#430501; Package bash. (Sat, 10 Apr 2010 10:06:07 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Klose <doko@debian.org>:
Extra info received and forwarded to list. (Sat, 10 Apr 2010 10:06:07 GMT) (full text, mbox, link).


Message #16 received at 430501@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@debian.org>
To: 430501@bugs.debian.org, 430501-submitter@bugs.debian.org
Cc: Debian Bug Tracking System <control@bugs.debian.org>
Subject: Re: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Sat, 10 Apr 2010 12:00:17 +0200
reassign 430501 bash-completion
thanks

I think that's the wrong thing to do. Resourcing the .bashrc should include all 
parts. if bash-completion is not safe to resource, please have a guard in 
bash-completion instead.




Bug reassigned from package 'bash' to 'bash-completion'. Request was from Matthias Klose <doko@debian.org> to control@bugs.debian.org. (Sat, 10 Apr 2010 10:06:08 GMT) (full text, mbox, link).


Message sent on to Josh Triplett <josh@joshtriplett.org>:
Bug#430501. (Sat, 10 Apr 2010 10:06:10 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#430501; Package bash-completion. (Sat, 10 Apr 2010 10:18:03 GMT) (full text, mbox, link).


Acknowledgement sent to David Paleino <dapal@debian.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Sat, 10 Apr 2010 10:18:03 GMT) (full text, mbox, link).


Message #26 received at 430501@bugs.debian.org (full text, mbox, reply):

From: David Paleino <dapal@debian.org>
To: Matthias Klose <doko@debian.org>
Cc: 430501@bugs.debian.org, 430501-submitter@bugs.debian.org
Subject: Re: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Sat, 10 Apr 2010 12:12:51 +0200
[Message part 1 (text/plain, inline)]
On Saturday 10 April 2010 12:00:17, Matthias Klose wrote:
> reassign 430501 bash-completion
> thanks
> 
> I think that's the wrong thing to do. Resourcing the .bashrc should include
>  all parts. if bash-completion is not safe to resource, please have a guard
>  in bash-completion instead.

What's wrong with:

[ -f /etc/bash_completion ] && . /etc/bash_completion

?

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|----
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, inline)]

Message sent on to Josh Triplett <josh@joshtriplett.org>:
Bug#430501. (Sat, 10 Apr 2010 10:18:08 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#430501; Package bash-completion. (Sat, 10 Apr 2010 11:18:10 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Klose <doko@debian.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Sat, 10 Apr 2010 11:18:10 GMT) (full text, mbox, link).


Message #34 received at 430501@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@debian.org>
To: David Paleino <dapal@debian.org>
Cc: 430501@bugs.debian.org, 430501-submitter@bugs.debian.org
Subject: Re: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Sat, 10 Apr 2010 13:16:29 +0200
On 10.04.2010 12:12, David Paleino wrote:
> On Saturday 10 April 2010 12:00:17, Matthias Klose wrote:
>> reassign 430501 bash-completion
>> thanks
>>
>> I think that's the wrong thing to do. Resourcing the .bashrc should include
>>   all parts. if bash-completion is not safe to resource, please have a guard
>>   in bash-completion instead.
>
> What's wrong with:
>
> [ -f /etc/bash_completion ]&&  . /etc/bash_completion
>
> ?

if that does work, then nothing is wrong. what do you think is wrong?





Message sent on to Josh Triplett <josh@joshtriplett.org>:
Bug#430501. (Sat, 10 Apr 2010 11:18:12 GMT) (full text, mbox, link).


Reply sent to David Paleino <dapal@debian.org>:
You have taken responsibility. (Sat, 10 Apr 2010 11:24:08 GMT) (full text, mbox, link).


Notification sent to Josh Triplett <josh@joshtriplett.org>:
Bug acknowledged by developer. (Sat, 10 Apr 2010 11:24:08 GMT) (full text, mbox, link).


Message #42 received at 430501-done@bugs.debian.org (full text, mbox, reply):

From: David Paleino <dapal@debian.org>
To: Matthias Klose <doko@debian.org>
Cc: 430501-done@bugs.debian.org, 430501-submitter@bugs.debian.org
Subject: Re: Bug#430501: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Sat, 10 Apr 2010 13:20:19 +0200
[Message part 1 (text/plain, inline)]
On Saturday 10 April 2010 13:16:29, Matthias Klose wrote:
> On 10.04.2010 12:12, David Paleino wrote:
> > On Saturday 10 April 2010 12:00:17, Matthias Klose wrote:
> >> reassign 430501 bash-completion
> >> thanks
> >>
> >> I think that's the wrong thing to do. Resourcing the .bashrc should
> >> include all parts. if bash-completion is not safe to resource, please
> >> have a guard in bash-completion instead.
> >
> > What's wrong with:
> >
> > [ -f /etc/bash_completion ]&&  . /etc/bash_completion
> >
> > ?
> 
> if that does work, then nothing is wrong. what do you think is wrong?

Nothing, and I can't see why we should check for BASH_COMPLETION whatsoever 
(re the original bugreport).

Closing the bug,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|----
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, inline)]

Message sent on to Josh Triplett <josh@joshtriplett.org>:
Bug#430501. (Sat, 10 Apr 2010 11:24:18 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#430501; Package bash-completion. (Mon, 12 Apr 2010 19:54:03 GMT) (full text, mbox, link).


Acknowledgement sent to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Mon, 12 Apr 2010 19:54:03 GMT) (full text, mbox, link).


Message #50 received at 430501@bugs.debian.org (full text, mbox, reply):

From: Josh Triplett <josh@joshtriplett.org>
To: David Paleino <dapal@debian.org>, 430501@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>
Subject: Re: Bug#430501: /etc/skel/.bashrc: bash_completion example in default .bashrc should check for previous inclusion via $BASH_COMPLETION
Date: Mon, 12 Apr 2010 12:40:34 -0700
On Sat, Apr 10, 2010 at 01:20:19PM +0200, David Paleino wrote:
> On Saturday 10 April 2010 13:16:29, Matthias Klose wrote:
> > On 10.04.2010 12:12, David Paleino wrote:
> > > On Saturday 10 April 2010 12:00:17, Matthias Klose wrote:
> > >> reassign 430501 bash-completion
> > >> thanks
> > >>
> > >> I think that's the wrong thing to do. Resourcing the .bashrc should
> > >> include all parts. if bash-completion is not safe to resource, please
> > >> have a guard in bash-completion instead.
> > >
> > > What's wrong with:
> > >
> > > [ -f /etc/bash_completion ]&&  . /etc/bash_completion
> > >
> > > ?
> > 
> > if that does work, then nothing is wrong. what do you think is wrong?
> 
> Nothing, and I can't see why we should check for BASH_COMPLETION whatsoever 
> (re the original bugreport).

I don't see anything in /etc/bash_completion that prevents sourcing it
twice, and even if it works idempotently, that wastes a lot of time.  I
suggested checking for duplicate sourcing via $BASH_COMPLETION so that
if both ~/.bashrc and /etc/bash.bashrc source /etc/bash_completion, it
doesn't run twice and take twice as long.  I do agree that
/etc/bash_completion seems like a better place to put this check, but I
think *something* should check rather than duplicating work.

- Josh Triplett




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 11 May 2010 07:31:17 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 09:41:13 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.