Debian Bug report logs - #502804
{Spam?} syntax errors when sourcing bash-completion with POSIX enabled

version graph

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: Freddy Vulto <fvulto@gmail.com>

Date: Sun, 19 Oct 2008 21:48:02 UTC

Severity: normal

Tags: confirmed

Merged with 504010

Found in version bash-completion/20080705

Fixed in version bash-completion/1:1.0-1

Done: David Paleino <d.paleino@gmail.com>

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, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#502804; Package bash-completion. (Sun, 19 Oct 2008 21:48:04 GMT) (full text, mbox, link).


Acknowledgement sent to Freddy Vulto <fvulto@gmail.com>:
New Bug report received and forwarded. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.

Your message had a Version: pseudo-header with an invalid package version:

Latest version from http://bzr.debian.org/bzr/bash-completion/current

please either use found or fixed to the control server with a correct version, or reply to this report indicating the correct version so the maintainer (or someone else) can correct it for you.

(Sun, 19 Oct 2008 21:48:04 GMT) (full text, mbox, link).


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

From: Freddy Vulto <fvulto@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: {Spam?} syntax errors when sourcing bash-completion with POSIX enabled
Date: Sun, 19 Oct 2008 23:29:33 +0200
Package: bash-completion
Version: Latest version from http://bzr.debian.org/bzr/bash-completion/current
Severity: normal

Steps to reproduce the problem:

   $ set -o posix
   $ source bash_completion

Expected output:
No errors

What do you see instead?
Instead I receive three errors (after solving the first, the next becomes apparent):

bash: /mnt/proj/bashCompletion/bash_completion-debian.bzr/bash_completion: line 275: syntax error near unexpected token `<'
bash: /mnt/proj/bashCompletion/bash_completion-debian.bzr/bash_completion: line 275: `	done < <( compgen -d -- "$(quote_readline "$cur")" )'


bash: /mnt/proj/bashCompletion/bash_completion-debian.bzr/bash_completion: line 9585: syntax error near unexpected token `<'
bash: /mnt/proj/bashCompletion/bash_completion-debian.bzr/bash_completion: line 9585: `	done < <( compgen -d -- "$(quote_readline "$cur")" )'


bash: `_ssh-copy-id': not a valid identifier


The solution is to rewrite the redirected while loops (bug 1 & 2) and to remove the hyphens from _ssh-copy-id (bug 3).  See diff underneath.  See also:
- http://fvue.nl/wiki/Bash:_Append_to_array_using_while-loop
- http://www.fvue.nl/wiki/Bash:_Piped_`while-read'_loop_starts_subshell


=== modified file 'bash_completion'
--- bash_completion	2008-10-10 19:01:59 +0000
+++ bash_completion	2008-10-19 21:07:12 +0000
@@ -270,15 +270,23 @@
 	_expand || return 0
 
 	local toks=( ) tmp
-	while read -r tmp; do
-		[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
-	done < <( compgen -d -- "$(quote_readline "$cur")" )
+	toks=( ${toks[@]} $(
+		compgen -d -- "$(quote_readline "$cur")" | { 
+			while read -r tmp; do
+				[[ -n $tmp ]] && echo $tmp
+			done
+		}
+	))
 	
 	if [[ "$1" != -d ]]; then
 		xspec=${1:+"!*.$1"}
-		while read -r tmp; do
-			[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
-		done < <( compgen -f -X "$xspec" -- "$(quote_readline "$cur")" )
+		toks=( ${toks[@]} $(
+			compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
+				while read -r tmp; do
+					[[ -n $tmp ]] && echo $tmp
+				done
+			}
+		))
 	fi
 
 	COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" )
@@ -9572,13 +9580,21 @@
 
 	local toks=( ) tmp
 	
-	while read -r tmp; do
-		[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
-	done < <( compgen -d -- "$(quote_readline "$cur")" )
+	toks=( $(
+		compgen -d -- "$(quote_readline "$cur")" | {
+			while read -r tmp; do
+				[[ -n $tmp ]] && echo $tmp
+			done
+		}
+	))
 
-	while read -r tmp; do
-		[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
-	done < <( eval compgen -f -X $xspec -- "\$(quote_readline "\$cur")" )	
+	toks=( $(
+		eval compgen -f -X $xspec -- "\$(quote_readline "\$cur")" | {
+			while read -r tmp; do
+				[[ -n $tmp ]] && echo $tmp
+			done
+		}
+	))
 	
 	COMPREPLY=( "${toks[@]}" )
 }

=== modified file 'contrib/ssh'
--- contrib/ssh	2008-09-27 10:58:42 +0000
+++ contrib/ssh	2008-10-19 21:12:07 +0000
@@ -74,9 +74,9 @@
 }
 complete -F _scp $nospace scp
 
-# ssh-copy-id(1) completion
+# ssh_copy_id(1) completion
 #
-_ssh-copy-id() {
+_ssh_copy_id() {
 	local cur prev
 
 	COMPREPLY=()
@@ -96,5 +96,5 @@
 
 	return 0
 }
-complete -F _ssh-copy-id $filenames ssh-copy-id
-}
\ No newline at end of file
+complete -F _ssh_copy_id $filenames ssh-copy-id
+}




-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)




Information forwarded to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#502804; Package bash-completion. (Mon, 20 Oct 2008 16:18:05 GMT) (full text, mbox, link).


Acknowledgement sent to "Freddy Vulto" <fvulto@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Mon, 20 Oct 2008 16:18:05 GMT) (full text, mbox, link).


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

From: "Freddy Vulto" <fvulto@gmail.com>
To: 502804@bugs.debian.org
Subject: syntax errors when sourcing bash-completion with POSIX enabled
Date: Mon, 20 Oct 2008 18:11:51 +0200
[Message part 1 (text/plain, inline)]
Hi, I forgot to append to the existing ${toks[@]} array at bug 2 (line
9572).  Attached is an improved diff.
[posix.diff (text/plain, attachment)]

Tags added: pending, confirmed Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Fri, 24 Oct 2008 17:18:06 GMT) (full text, mbox, link).


Forcibly Merged 502804 504010. Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Fri, 31 Oct 2008 22:48:02 GMT) (full text, mbox, link).


Forcibly Merged 502804 504010. Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Fri, 31 Oct 2008 22:51:07 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#502804; Package bash-completion. (Fri, 31 Oct 2008 23:15:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Freddy Vulto" <fvulto@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>. (Fri, 31 Oct 2008 23:15:04 GMT) (full text, mbox, link).


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

From: "Freddy Vulto" <fvulto@gmail.com>
To: 502804@bugs.debian.org
Subject: syntax errors when sourcing bash-completion with POSIX enabled
Date: Sat, 1 Nov 2008 00:10:04 +0100
[Message part 1 (text/plain, inline)]
Here's another improved patch. Adding an hyphen `-' to `${toks[@]-}'
will circumvent an error "Unbound variable" when `set -u' is in
effect.

Regards, Freddy
[posix.diff (text/x-diff, attachment)]

Information stored :
Bug#502804; Package bash-completion. (Sat, 01 Nov 2008 08:57:04 GMT) (full text, mbox, link).


Acknowledgement sent to David Paleino <d.paleino@gmail.com>:
Extra info received and filed, but not forwarded. (Sat, 01 Nov 2008 08:57:04 GMT) (full text, mbox, link).


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

From: David Paleino <d.paleino@gmail.com>
To: Freddy Vulto <fvulto@gmail.com>
Cc: 502804-quiet@bugs.debian.org
Subject: Re: [Bash-completion-devel] Bug#502804: syntax errors when sourcing bash-completion with POSIX enabled
Date: Sat, 1 Nov 2008 09:50:41 +0100
[Message part 1 (text/plain, inline)]
On Sat, 1 Nov 2008 00:10:04 +0100, Freddy Vulto wrote:

> Here's another improved patch. Adding an hyphen `-' to `${toks[@]-}'
> will circumvent an error "Unbound variable" when `set -u' is in
> effect.

Committed (bzr1198), thanks.

David

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

Reply sent to David Paleino <d.paleino@gmail.com>:
You have taken responsibility. (Sat, 04 Apr 2009 14:12:28 GMT) (full text, mbox, link).


Notification sent to Freddy Vulto <fvulto@gmail.com>:
Bug acknowledged by developer. (Sat, 04 Apr 2009 14:12:28 GMT) (full text, mbox, link).


Message #31 received at 502804-close@bugs.debian.org (full text, mbox, reply):

From: David Paleino <d.paleino@gmail.com>
To: 502804-close@bugs.debian.org
Subject: Bug#502804: fixed in bash-completion 1:1.0-1
Date: Sat, 04 Apr 2009 13:47:04 +0000
Source: bash-completion
Source-Version: 1:1.0-1

We believe that the bug you reported is fixed in the latest version of
bash-completion, which is due to be installed in the Debian FTP archive:

bash-completion_1.0-1.diff.gz
  to pool/main/b/bash-completion/bash-completion_1.0-1.diff.gz
bash-completion_1.0-1.dsc
  to pool/main/b/bash-completion/bash-completion_1.0-1.dsc
bash-completion_1.0-1_all.deb
  to pool/main/b/bash-completion/bash-completion_1.0-1_all.deb
bash-completion_1.0.orig.tar.gz
  to pool/main/b/bash-completion/bash-completion_1.0.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 502804@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David Paleino <d.paleino@gmail.com> (supplier of updated bash-completion package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 03 Apr 2009 14:21:43 +0200
Source: bash-completion
Binary: bash-completion
Architecture: source all
Version: 1:1.0-1
Distribution: unstable
Urgency: low
Maintainer: Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>
Changed-By: David Paleino <d.paleino@gmail.com>
Description: 
 bash-completion - programmable completion for the bash shell
Closes: 272660 322238 360628 361535 489927 491856 492328 492476 494292 495142 495883 496162 496828 497074 497597 498105 499780 500316 501473 501843 502664 502804 502885 503317 503317 504141 504547 504650 506560 511789 511790 512556 512823 512917 516614 521041
Changes: 
 bash-completion (1:1.0-1) unstable; urgency=low
 .
   * New upstream release:
     - also see /usr/share/doc/bash-completion/CHANGES.gz
     - fix man -l completing filenames (Closes: #497074)
     - (Partly) fixed java classes completion (Closes: #496828). Look for
       FIXME in source.
     - dump to /dev/null error message from look(1) with no arguments
       (Closes: #495142)
     - set ssh as default for rsync (was rsh) (Closes: #492328)
     - added .oga, .ogv, .ogx to mplayer completion (Closes: #496162)
     - added .epub to unzip|zipinfo completion (Closes: #492476)
     - added ssh-copy-id completion (Closes: #491856)
     - moved ssh completion to separate file (Closes: #360628)
     - bogus completion when mounting subdirs fixed (Closes: #322238)
     - fix `apt-cache showsrc` completing only on source package names
       (Closes: #361535)
     - fixed bugs with gdb completion:
     - when an empty directory is in $PATH (thanks to Morita Sho)
       (Closes: #497597)
     - when a non-existing directory is in $PATH (Closes: #499780)
     - fix missing completion for "-n" and "-e" (we were using echo, now
       using printf) (thanks to Morita Sho) (Closes: #498105)
     - fixed gpg completion --@(export|@(?(l|nr|nrl)sign|edit)-key))
       (Closes: #500316)
     - fixed .cb[rz] completion for evince (Closes: #502885)
     - added gpg2 completion (Closes: #489927)
     - fixed mplayer -skin completion (Closes: #501473)
     - fixed errors with POSIX enabled (Closes: #502804)
     - fixed dpkg-source wrong exit() with return() (Closes: #503317)
     - added --schedule-only to aptitude's completion (Closes: #502664)
     - added build-dep to aptitude's completion (Closes: #495883)
     - added support for `-F configfile' to _known_hosts(), ssh, scp and
       sftp, thanks to Freddy Vulto (Closes: #504141)
     - fixed sed quoting bug in _known_hosts(), thanks to Freddy Vulto
       (Closes: #504650)
     - allow for comments in known_hosts files (Closes: #511789)
     - fixed perl -I/-x completion, thanks to Freddy Vulto
       (Closes: #504547)
     - README updated: explain how to use bash-completion correctly.
       (Closes: #506560)
     - added qdbus completion, thanks to Terence Simpson (LP: #257903)
     - fixed completion of environment variables, thanks to Morita Sho
       (Closes: #272660)
     - fix dpkg completion bug: it listed only non-Essential packages
       (Closes: #511790)
     - fixed _dpkg_source completion (Closes: #503317)
     - remove unused UNAME local variable in _info() (Closes: #501843)
     - added .zip to jar completions (Closes: #521041)
     - Merge from Ubuntu:
       + consume error messages in configure completion (LP: #223882)
         (Mika Fischer)
       + quote $xspec in _filedir_xspec in case it is empty, which would
         cause errors if there was no match under failglob. (LP: #194419)
         (Mika Fischer)
     - Ville Skyttä:
       + remove duplicate cpio completion, thanks to Freddy Vulto
         (Closes: #512823)
       + fix awk error in "modprobe -r /" completion (Closes: #512556)
     - Jakob Unterwurzacher:
       + ps2pdf can run on .pdf files as well.
         (Closes: #516614, LP: #316943)
   * debian/links fixed (Closes: #494292)
   * debian/control:
     - fixed typo in the long description
     - added Vcs-* fields
     - Standards-Version to 3.8.1
     - DMUA set
     - removed Luk Claes from Uploaders
     - Homepage added
   * debian/install:
     - correctly install contrib/* under /etc/bash_completion.d/
   * debian/copyright updated
   * debian/extra/dh_bash-completion:
     - updated to support a list of files in debian/<package>.bash-completion
       (Closes: #512917)
   * debian/rules:
     - install upstream CHANGES and AUTHORS too
Checksums-Sha1: 
 977d1414ca3556a4ad46aa2b48b9ca8e6e86a603 1308 bash-completion_1.0-1.dsc
 61040795731f5ff509c46e818a1edf0a7a93e11d 143578 bash-completion_1.0.orig.tar.gz
 49c583802082e3aa9a761fb0da0d5ec257f257bb 9002 bash-completion_1.0-1.diff.gz
 cb38e807d9b23e84b866e6e9d24814991a61836a 103010 bash-completion_1.0-1_all.deb
Checksums-Sha256: 
 d369f9436c02262d3de898564cd9b5269ace760cf6b7e0632e3b251ac431f2b5 1308 bash-completion_1.0-1.dsc
 bd96e7d2858f02783046908a984993736f1189d07d82e9ce4b465068dd7187ef 143578 bash-completion_1.0.orig.tar.gz
 04c46eff31bf9dfb9e79f417bd79706b6dc67888461ab05128b29cff78c9556b 9002 bash-completion_1.0-1.diff.gz
 81ab4b27a2158e787ea39c7da34619858a5df6b6251ba24d8bda6592feed46f4 103010 bash-completion_1.0-1_all.deb
Files: 
 6cb01d355c4519f911820b2b7c0feb53 1308 shells standard bash-completion_1.0-1.dsc
 cd1c5648272917fbe0eef4ba30bb93f4 143578 shells standard bash-completion_1.0.orig.tar.gz
 e78d5e31ed66fb5e97c77ea7c9f1b343 9002 shells standard bash-completion_1.0-1.diff.gz
 aefc9e1c8db0f4f2b61557c2e207ca0c 103010 shells standard bash-completion_1.0-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknXYZAACgkQ5UTeB5t8Mo0jGACfQVygJmdQ3v4i/dymRnZSVnhA
qHoAnjcS99HMQgFHzQ2NnNAY1OPvlPK6
=6i7t
-----END PGP SIGNATURE-----





Reply sent to David Paleino <d.paleino@gmail.com>:
You have taken responsibility. (Sat, 04 Apr 2009 14:12:29 GMT) (full text, mbox, link).


Notification sent to Noah Slater <nslater@bytesexual.org>:
Bug acknowledged by developer. (Sat, 04 Apr 2009 14:12:29 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 13 May 2009 07:26: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 10:02:59 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.