Bug#746434: apt: new apt breaks a shell script by reading from standard input when it shouldn't
Package: apt
Version: 1.0.2
Severity: normal
Hello,
I have an automated installation script that doesn't work anymore on Sid. This is a snippet of code:
#!/bin/bash
apt-get -qq -y install iftop
neverexecuted
If executed by piping it to bash, the very first time (when the package is not installed), I get:
# cat test.sh | bash
neverexecuted
Selecting previously unselected package iftop.
(Reading database ... 69655 files and directories currently installed.)
Preparing to unpack .../iftop_1.0~pre2-5_amd64.deb ...
Unpacking iftop (1.0~pre2-5) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up iftop (1.0~pre2-5) ...
As you can see, "neverexecuted" is printed on stdout (by apt-get if I look through strace) instead of being executed by bash at a later time.
If executed the second time (when the package is already installed), I correctly get:
# cat test.sh | bash
bash: line 4: neverexecuted: command not found
apt version: 1.0.2
I'm sure this used to work a few weeks ago.
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on:
ii debian-archive-keyring 2012.4
ii gnupg 1.4.16-1.1
ii libapt-pkg4.12 1.0.2
ii libc6 2.18-5
ii libgcc1 1:4.9.0-1
ii libstdc++6 4.9.0-1
apt recommends no packages.
Versions of packages apt suggests:
pn apt-doc <none>
ii aptitude 0.6.10-1
ii dpkg-dev 1.17.8
ii python-apt 0.9.3.6
-- no debconf information
Reply to: