On Tue, Dec 02, 2014 at 05:31:36AM +0100, Guillem Jover wrote:
> Hi!
> 
> On Mon, 2014-12-01 at 20:14:55 -0800, Josh Triplett wrote:
> > Package: dpkg
> > Version: 1.17.22
> > Severity: normal
> > 
> > Preparing to unpack .../chromium_39.0.2171.71-1_amd64.deb ...
> > /var/lib/dpkg/tmp.ci/preinst: 6: /var/lib/dpkg/tmp.ci/preinst: upgrade: not 
> > found
> > Unpacking chromium (39.0.2171.71-1) over (38.0.2125.101-3) ...
> > 
> > I've seen such errors from maintainer scripts before, and they previously
> > showed the name of the package, rather than just a temporary dpkg path.
> 
> That's because the script does not return with an error exit code, and
> as such I don't think dpkg can do much. This is the equivalent broken
> code:
> 
> ,--- preinst ---
> #!/bin/sh
> set -e
> if "$1" = "upgrade"; then
>     echo "action"
> fi
> `---
> 
> ,---
> $ ./preinst upgrade; echo $?
> ./preinst: 3: ./preinst: upgrade: not found
> 0
> `---

This would occur with any such error message generated by a maintainer
script, and it has nothing to do with the error exit code.  I seem to
recall maintainer scripts previously emiting such messages with the
actual name of the script, though it's possible that I didn't see such
messages from preinst scripts that get run before unpacking the package
to the filesystem (and thus have to run from a temporary location rather
than /var/lib/dpkg/info/).

In any case, dpkg could improve the error message here by naming the
script in the temporary directory the same as it names scripts in
/var/lib/dpkg/info; in this case, /var/lib/dpkg/tmp.ci/chromium.preinst.

- Josh Triplett


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to