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

Re: Renaming packages: maintscripts



On Sun, 2012-09-02 at 14:04 -0700, Steve Langasek wrote:
> On Sun, Sep 02, 2012 at 08:54:39PM +0100, Ben Hutchings wrote:
> > On Sun, 2012-09-02 at 23:17 +0400, Michael Tokarev wrote:
> > [...]
> > > But the OP system does not have old autofs5 package installed,
> > > only the config files from it, and the maintscripts.  Which is
> > > exactly the problem.
> 
> > > I want to ensure that if old autofs5 is installed, installing
> > > new autofs should pull new autofs5 TOO.
> 
> > > The only way currently I see to do it is to declare autofs
> > > as DEPENDING on autofs5.  This is obviously ugly, but it will
> > > save from this very situation, and I don't see any other way.
> > > Is there?
> 
> > # in autofs.postinst
> > rm -f /var/lib/dpkg/info/autofs5.postrm
> 
> > (There may be a cleaner way to do this.)
> 
> if postrm=$(dpkg-query -c autofs5 postrm 2>/dev/null); then
> 	rm -f "$postrm"
> fi
> 
> Not sure about cleaner, but that's the supported dpkg interface.

That certainly seems a bit cleaner than assuming we know what the dpkg
database looks like it.  However the manual page says 'Warning: this
command is deprecated, please switch to use --control-list and
--control-show instead.'  Those options don't expose any filenames at
all!

Ben.

> And yeah, short of time travel, I also don't see any cleaner alternative to
> manually hacking the old maintainer scripts.

-- 
Ben Hutchings
Theory and practice are closer in theory than in practice.
                                - John Levine, moderator of comp.compilers

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: