Difference: PackageSpecifications (4 vs. 5)

Revision 52020-04-02 - squinney

Line: 1 to 1
 
META TOPICPARENT name="DocsForLCFGUsers"
Changed:
<
<

Package Specifications

>
>

Package Specifications

 
Changed:
<
<
Entries in an LCFG package list must conform to a standard syntax. The complete specification looks like this:
>
>
Entries in an LCFG package list must conform to a standard syntax.

The modern specification style (requires lcfg-core 1.54.3, perl-LCFG-Core 0.26.0, LCFG-Compiler 3.7.0) looks like this:

prefix:name=version-release/arch:flags[context]

Note the '=' (equals) separator between name and version. In this form the version may contain colons (for the epoch) and hyphens (seen in some Debian packages).

The legacy specification style looks like this:

 
prefix:arch2/name-version-release/arch1:flags[context]
Changed:
<
<
Due to the Redhat heritage of our systems the concatenatation of the name-version-release elements using a hyphen is modelled on the Redhat package specification. To wrap other parts of the syntax around this string in a way which is easily parseable we have added a few extra limitations on the permitted characters for some elements (e.g. see the release element).
>
>
Due to the Redhat heritage of our systems the concatenatation of the name-version-release elements using a hyphen is modelled on the Redhat package specification.
 
Changed:
<
<
There are 8 possible elements for a package specification, 3 of which are required.
>
>
To wrap other parts of the syntax around this string in a way which is easily parseable we have added a few extra limitations on the permitted characters for some elements (e.g. see the release element).

There are 7 possible elements for a package specification, 3 of which are required.

 

Required Elements

Name

Changed:
<
<
This is a string of at least 1 character in length.
>
>
This is a string of at least 1 character in length and the first character MUST be in [a-zA-Z0-9_]. All subsequent characters must match [A-Za-z0-9_-.+]

Note that some package managers may have additional limitations on package name (e.g. Debian does not permit use of the '_' (underscore) character.

 

Version

Changed:
<
<
This is a string of at least 1 character in length which MUST NOT contain a hyphen/minus sign (-).
>
>
This is a string of at least 1 character in length. All characters MUST be in the set [A-Za-z0-9:.~+-_*?].

Note that some package managers may have additional limitations on package version (e.g. Redhat does not permit use of the '-' (hyphen) character.

With the legacy style of specification this MUST NOT contain a hyphen/minus sign (-) and MUST NOT contain a colon (:).

  If the string is an asterisk (*) this is interpreted as a wild-card value and the package tool will consider this to mean "use the greatest version available".
Changed:
<
<
Note that we do NOT support the RPM epoch field correctly. If one is specified it will become part of the version string. This can subsequently cause problems when you try to build an RPM package file name from the available information as two RPM which are identical except for the epoch do not have different package names.
>
>
Note that we do NOT support the RPM epoch field correctly. If one is specified it will become part of the version string. This can subsequently cause problems when you try to build an RPM package file name from the available information as two RPM which are identical except for the epoch do not have different file names.
 

Release

Changed:
<
<
This is a string of at least 1 character in length which MUST NOT contain any of hyphen/minus sign (-), forward-slash (/), colon (:) or left-square-bracket ([). These character limitations go beyond what is required for RPMs but we don't expect this to cause any problems.
>
>
This is a string of at least 1 character in length. All characters MUST be in the set [A-Za-z0-9.~+-_*?] (similar to the version string except : (colon) is not permitted).
 
Changed:
<
<
If the string is an asterisk (*) this is interpreted as a wild-card value and the package tool will consider this to mean "use the greatest release available for the specified version". Not all platforms use the release field to identify package versions (e.g. OS X) in which case the recommended practice is to always use an asterisk.
>
>
Note that some package managers may have additional limitations on package version (e.g. Redhat does not permit use of the '-' (hyphen) character.

If the string is an asterisk (*) this is interpreted as a wild-card value and the package tool will consider this to mean "use the greatest release available for the specified version".

Not all platforms use the release field to identify package versions (e.g. Debian native packages) in which case the recommended practice is to always use an asterisk.

 

Optional Elements

Line: 40 to 64
  This is the architecture of the platform for which the package was built (e.g. x86_64 or i686).
Changed:
<
<
Note that the package specification syntax allows this to be expressed in two ways, this was done to support platforms which permit multiple architecture versions of the same package (e.g. i386 on x86_64). If you use both then the second will override the first.
>
>
Note that the legacy specification style allows this to be expressed in two ways, this was done to support platforms which permit multiple architecture versions of the same package (e.g. i386 on x86_64). If you use both then the second will override the first.
  On Linux, if the architecture is not specified for a package then the default for the current platform will be selected, as of updaterpms version 3.5.0 this will typically match what you expect.
Line: 70 to 94
 

Perl Reference Regular Expression

Added:
>
>
Legacy style specifications:
 
my $pkgspec_re = qr{^
                    ([?+-])?               # prefix   (optional)
Line: 90 to 116
 If you want to check a package specification to see how it will be parsed you can use the parse_pkgspec tool which is provided as part of the lcfg-pkgtools package:
Added:
>
>
% parse_pkgspec 'foo-bar-baz=1:5-6-8/noarch:br[!install]' Name: foo-bar-baz Version: 1:5-6 Release: 8 Arch: noarch Flags: br Prefix: Context: install

or with the legacy specification:

 % /usr/bin/parse_pkgspec '+i386/foo-bar-baz-1:5-8/noarch:br[!install]' Name: foo-bar-baz Version: 1:5
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback