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

Bug#540797: marked as done (edos-debcheck: output format needs to be easier to parse)



Your message dated Mon, 28 Jul 2014 10:31:37 +0200
with message-id <20140728083137.GH32535@seneca.home.org>
and subject line Re: edos-debcheck: output format needs to be easier to parse
has caused the Debian Bug report #540797,
regarding edos-debcheck: output format needs to be easier to parse
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
540797: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540797
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: edos-debcheck
Version: 1.0-9
Severity: normal

edos-debcheck is used extensively in Emdebian, not by humans but by
scripts that expect to be able to parse the output and work out which
packages need to be built/added to meet "NOT AVAILABLE" or "missing"
dependencies and which packages need to be updated.

edos-debcheck has now changed that output format and the XML choice
isn't particularly helpful for this kind of parsing because the
explanation is simply xml:text wrapped in tags with no meaning assigned
to the actual components of the explanation.

If the XML is to be useful, something like this will be required:

<package package="xserver-xorg-video-voodoo" architecture="i386"
version="1:1.2.2-1em1" result="failure">
  <depends package="xserver-xorg-video-voodoo"
dependency="xserver-xorg-core">
    <constraint>(= 2:1.6.3-1+b1em1)</constraint>
    <type>cascade</type>
  </depends>
  <depends package="xserver-xorg-core" dependency="xserver-xorg">
    <constraint>(= 1:7.4+3em1)</constraint>
    <type>cascade</type>
  </depends>
  <depends package="xserver-xorg" dependency="hal">
    <constraint>(= 0.5.13-2em1)</constraint>
    <type>cascade</type>
  </depends>
  <depends package="hal" dependency="libblkid1">
    <constraint>(&gt;= 2.16)</constraint>
    <type package="libblkid1">missing</type>
  </depends>
</package>

(this is just off-the-cuff, it needs more thought and more distinction
between tags with the same name but different contexts. The use of
<package package=""/> is particularly irksome and could be easily
resolved by using <package name=""/>.)

An alternative:

<?xml version="1.0"?>
<package name="xserver-xorg-video-voodoo" version="1:1.2.2-1em1" result="failure">
 <architecture triplet="i486-linux-gnu">
  <cascade package="xserver-xorg-video-voodoo">
    <dependency>xserver-xorg-core</dependency>
    <constraint>=</constraint>
    <version>2:1.6.3-1+b1em1</version>
  </cascade>
  <cascade package="xserver-xorg-core">
    <dependency>xserver-xorg</dependency>
    <constraint>=</constraint>
    <version>1:7.4+3em1</version>
  </cascade>
  <cascade package="xserver-xorg">
    <dependency>hal</dependency>
    <constraint>=</constraint>
    <version>0.5.13-2em1</version>
  </cascade>
  <missing package="hal" dependency="libblkid1">
    <constraint>&gt;=</constraint>
    <version>2.16</version>
  </missing>
 </architecture>
</package>

Note the use of the full architecture triplet and the possibility of
using the same tags to fold other architecture results into the final
file from running repeated tests and using XML parsers to collate the
results, without duplicating the package data itself.

e.g.:
<package>
 <architecture triplet="arm-linux-gnu">
  <missing/>
 </architecture>
 <architecture triplet="arm-linux-gnueabi">
  <missing/>
 </architecture>
</package>

(The arch is easily converted to a triplet using
`dpkg-architecture -a$arch -qDEB_HOST_GNU_TYPE` which will ensure that
all supported cross-architectures are identified.)

Also note the use of unique tags for the results, cascade and missing.

Cascade = this package cannot be installed because of some failure later
in the cascade but is otherwise OK.

Missing = identifies the package(s) that is/are missing.

A Schema would also be very helpful, as would proper formatting of the
XML such that it passes xmllint and similar checks. 

The main requirement is that each discrete piece of data is uniquely
identifiable as an XML tag or attribute - it may be useful to separate
the constraint from the version too:

  <constraint>=</constraint>
  <version>1:7.4+3em1</version>

(as in the alternative above)

This provides an XMLPath to each piece of data, essential to use any
kind of XML parsing reliably in scripts. (In essence, no spaces should
exist; everywhere a space exists in the plain text an XML tag or
property is used in -xml and newlines are abandoned completely.)

In addition, the plain text output has a typo, &gt; characters needed
for XML are not being converted:

  hal (= 0.5.13-2em1) depends on missing:
  - libblkid1 (&gt;= 2.16)

Should be:

  hal (= 0.5.13-2em1) depends on missing:
  - libblkid1 (>= 2.16)

(so that the constraint can be passed directly to dpkg
--compare-versions)

The plain text output could also be improved by keeping things on the
same lines to make it easier to use grep etc. even if it is only the
"missing" lines that are put onto a single line.

The main requirement is that scripts can check for "missing" (or some
other unique phrase) in the output (use of LANG=C in the environment
notwithstanding) and easily identify the package that is missing without
having to keep a buffer or collapse two lines into one.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages edos-debcheck depends on:
ii  edos-distcheck                1.4.2-4    Checks whether dependencies of pac

edos-debcheck recommends no packages.

edos-debcheck suggests no packages.

-- debconf-show failed



--- End Message ---
--- Begin Message ---
Version: 3.2.2-2

edos-distcheck is now superseded by dose-distcheck which gives explanations
in a structured output format (YAML).

-Ralf.

--- End Message ---

Reply to: