Patterns/Definition Language

Şuraya atla: kullan, ara

Pattern definition language

Rationale

As openSUSE is using patterns from 10.2 on, a way to describe patterns is needed. It should be

  • easy to read (by humans)
  • easy to write (by humans)
  • easy to process (by computers)

The current .pat format does not fully achieve these requirements as its hard to read and one has to remember cryptic key names. Going forward, patterns should also be available in repomd repositories.

So we need some tools to convert from the pattern description to .pat format and to repomd format.


Proposal

Pick up the .spec file format already used by RPM. It is ASCII based and uses human-readable names and expressions.

The basic format is

 key: value

For dependencies, value consist of kind specifier (either package or pattern) followed by a colon and a name. A version expression (operator version-release) is optional.


Example

This is the default pattern as used in openSUSE-10.2 Alpha 3

# Pattern definition file
# pattern[default-10.2-4.i586]
Name: default
Summary: Default System
Description: This is the default system for this product.
Version: 10.2
Release: 4
Arch: i586
Requires: pattern:basesystem
Recommends: pattern:base
Recommends: pattern:x11
Recommends: pattern:apparmor
Recommends: pattern:32bit
Recommends: pattern:64bit
Recommends: pattern:x86

More examples: base , kde , laptop, X11

Questions

  • How to cope with multi-line values (e.g. Description:) ?
    • Repeat the tag (Description:) for each line
    • All lines up to the next tag
    • Indent continuation lines (tags start leftmost, continuation lines have one leading space)
  • Should multiple values (e.g. for dependencies, as in .spec files) be allowed ?
    • comma or space separated ?
  • Default to one kind (package: or pattern:) in dependencies ?

Internationalization

Dont forget about translations

# Pattern definition file
# pattern[default-10.2-4.i586]
Name: default
Summary: Default System
Summary[de]: Grundsystem
Summary[hu]: Alaprendszer
Description: This is the default system for this product.
Description[de]: Das Grundsystem dieses Produkts.
Description[hu]: A termék alaprendszere.
Version: 10.2
Release: 4
Arch: i586
Requires: pattern:basesystem
Recommends: pattern:base
Recommends: pattern:x11
Recommends: pattern:apparmor
Recommends: pattern:32bit
Recommends: pattern:64bit
Recommends: pattern:x86