Giter Club home page Giter Club logo

Comments (4)

0tanay avatar 0tanay commented on September 27, 2024

Hi @mlandres,

I'm starting out and I'd be happy to add this feature if it gets accepted.

from zypper.

mlandres avatar mlandres commented on September 27, 2024

Hi @0tanay, feel free to go ahead.

The xmlout.rnc can be modified to take an optional autoinstalled="true" attribute.

    attribute status { "installed" | "other-version" | "not-installed" },
+   attribute autoinstalled { xsd:boolean }?,

But beware that the information is not present, at least not reliably. The code unfortunately renders the not-XML table output as XML. In this case the Locked(il), Ptf(iP) or Retracted(iR) information supersedes the autoinstalled info. In these cases you can not tell from the table's status whether it is autoinstalled or not.

from zypper.

0tanay avatar 0tanay commented on September 27, 2024

Hey Michael,

I tried the method that @moberer suggested and it works - although only for search.

For info, the output by default looks something like this:

# zypper -x info zsh
<?xml version='1.0'?>
<stream>
<message type="info">Loading repository data...</message>
<message type="info">Reading installed packages...</message>
<message type="info">Repository     : openSUSE-Tumbleweed-Oss
Name           : zsh
Version        : 5.9-6.3
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 9.6 MiB
Installed      : No
Status         : not installed
Source package : zsh-5.9-6.3.src
Upstream URL   : https://www.zsh.org
Summary        : Shell with comprehensive completion
Description    : 
    Zsh is a UNIX command interpreter (shell) that resembles the Korn shell
    (ksh). It is not completely compatible. It includes many enhancements,
    notably in the command-line editor, options for customizing its
    behavior, file name globbing, features to make C-shell (csh) users feel
    at home, and extra features drawn from tcsh (another `custom&apos; shell).
    Zsh is well known for its command line completion.
</message>
</stream>

Is this behavior correct? Should this output rather be broken down into tags (like <name>zsh</name>)?

I can submit a fix just for search, or I can try to also fix info.
What would you prefer?

from zypper.

mlandres avatar mlandres commented on September 27, 2024

(Sorry for the delay.) Frankly, we don't want to invest into the xml output. Many commands provide this poor-man's xml by simply wrapping the output into xml data. It was enhanced only on demand for specific (business) cases. But we don't think that further investment into this format pays.

The point is that XML is not the best machine readable output format. And our hardcoded data sets are not suitable for every client. We are working on a dedicated query command where the client is able to define the data to query as well as the format to render them. It will be similar to rpm's --queryformat option. With this one should be able to generate the most suitable format for a specific task.
'%{NAME}\n'
'name: "%{NAME}"\n'
'<name>%{NAME}<\\name>\n'

from zypper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.