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

Re: Problem with the "updmap scheme" when a font package is in an "inconsistent state"



Frank Küster <frank@debian.org> wrote:

> Hm, what is the output if lmodern (or foo) is upgraded, and the new
> version is not yet configured (but the old one is)?  How will this be
                                 ^^^^^^^^^^^^^^^^^^
                                          ?
This is impossible. When the new version is unpacked, the _package_ is
not in a configured state anymore.

> different from a completely installed new version?  Because this is the
> second case we have to catch:  A font package is upgraded and changes
> its map file names, but update-updmap and updmap-sys are executed before
> its conffiles are installed (for example because tex-common is upgraded
> in the same run).

Hmmm, I'm not sure I understand; it seems to me you are describing the
exact case I started this thread for.

Does the following help?

# dpkg -P foo                                                            
(Reading database ... 123489 files and directories currently installed.)
Removing foo ...
Purging configuration files for foo ...
# dpkg -i ~flo/debian-experiments/foo/foo_1.0-2_all.deb                  
Selecting previously deselected package foo.
(Reading database ... 123485 files and directories currently installed.)
Unpacking foo (from .../foo/foo_1.0-2_all.deb) ...
Setting up foo (1.0-2) ...
Running foo.postinst configure 
dpkg-query says: 'Status: install ok half-configured'
grep-status says: 'Status: purge ok not-installed'

# dpkg-query -s foo | grep '^Status: ' && grep-status -s Status -P -X foo
Status: install ok installed
Status: install ok installed
# dpkg --unpack ~flo/debian-experiments/foo/foo_1.0-3_all.deb            
(Reading database ... 123489 files and directories currently installed.)
Preparing to replace foo 1.0-2 (using .../foo/foo_1.0-3_all.deb) ...
Unpacking replacement foo ...
# dpkg-query -s foo | grep '^Status: ' && grep-status -s Status -P -X foo
Status: install ok unpacked
Status: install ok unpacked
# dpkg --configure foo                                                   
Setting up foo (1.0-3) ...
Installing new version of config file /etc/foo-cfg ...
Running foo.postinst configure 1.0-2
dpkg-query says: 'Status: install ok half-configured'
grep-status says: 'Status: install ok unpacked'

# dpkg-query -s foo | grep '^Status: ' && grep-status -s Status -P -X foo
Status: install ok installed
Status: install ok installed
# dpkg -i ~flo/debian-experiments/foo/foo_1.0-2_all.deb                  
dpkg - warning: downgrading foo from 1.0-3 to 1.0-2.
(Reading database ... 123489 files and directories currently installed.)
Preparing to replace foo 1.0-3 (using .../foo/foo_1.0-2_all.deb) ...
Unpacking replacement foo ...
Setting up foo (1.0-2) ...
Installing new version of config file /etc/foo-cfg ...
Running foo.postinst configure 1.0-3
dpkg-query says: 'Status: install ok half-configured'
grep-status says: 'Status: install ok installed'

# dpkg-query -s foo | grep '^Status: ' && grep-status -s Status -P -X foo
Status: install ok installed
Status: install ok installed
# dpkg -i ~flo/debian-experiments/foo/foo_1.0-3_all.deb                  
(Reading database ... 123489 files and directories currently installed.)
Preparing to replace foo 1.0-2 (using .../foo/foo_1.0-3_all.deb) ...
Unpacking replacement foo ...
Setting up foo (1.0-3) ...
Installing new version of config file /etc/foo-cfg ...
Running foo.postinst configure 1.0-2
dpkg-query says: 'Status: install ok half-configured'
grep-status says: 'Status: install ok installed'

# dpkg-query -s foo | grep '^Status: ' && grep-status -s Status -P -X foo
Status: install ok installed
Status: install ok installed

Conclusion:

  It seems dpkg updates /var/lib/dpkg/status only at the end of its run,
  which causes grep-status to be inaccurate when run from a maintainer
  script (it reports the state of the package *before* the dpkg command
  causing the maintainer script to be run was started). Obviously, using
  sed to parse /var/lib/dpkg/status is no better.

  This somehow explains why dpkg-query is slower than grep-status: it
  does not parse /var/lib/dpkg/status, but retrieve the information in a
  different way.

  It seems there are two "reliable" ways left to solve the problem:
  .dpkg-new checking (fast, but slightly ugly) and dpkg-query (slow, but
  cleaner at first sight).

-- 
Florent



Reply to: