[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#264241: postrm assumes mktexlsr is available



On Tue, Aug 10, 2004 at 02:34:20PM +0200, Hilmar Preusse wrote:
> > tetex-extra's postrm fails:
> > (Reading database ... 7896 files and directories currently installed.)
> > Removing tetex-extra ...
> > Purging configuration files for tetex-extra ...
> > dpkg: error processing tetex-extra (--purge):
> >  subprocess post-removal script returned error exit status 127
> > Errors were encountered while processing:
> >  tetex-extra
> > 
> > You can't assume that any of your dependencies are available in
> > your postrm script, so you need to handle the case where mktexlsr
> > has already been removed.
> > 
> Hmm.
> 
> In postrm of tetex-extra we do:
> 
> #!/bin/sh
> <snip>
> command mktexlsr >/dev/null 2>&1 && mktexlsr
> 
> The man page of bash tells us, that it should be sufficient to do so
> if /bin/sh points to /bin/bash. I guess we have to remove the bashism

It does?  To me, it looks like you run mktexlsr twice, once via command,
and once without.  And both will fail if mktexlsr doesn't exist.
You need something more like:
command mktexlsr >/dev/null 2>&1 || true

Which runs mktexlsr without doing a shell function lookup, or runs true
if that fails for some reason (such as mktexlsr not existing).

-- 
Ryan Murray, Debian Developer (rmurray@cyberhqz.com, rmurray@debian.org)
The opinions expressed here are my own.



Reply to: