codec-rpm-0.1.3: A library for manipulating RPM files

Copyright(c) 2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Codec.RPM.Version

Contents

Description

Functions and types for working with version numbers, as understood by RPM.

Synopsis

Types

data DepRequirement Source #

RPM supports the concept of dependencies between packages. Collectively, these dependencies are commonly referred to as PRCO - Provides, Requires, Conflicts, and Obsoletes. These dependencies can optionally include version information. These relationships can be examined with various RPM inspection tools or can be found in the spec files that define how a package is built. Examples include:

Requires: python-six
Requires: python3-blivet >= 1:1.0
Obsoletes: booty <= 0.107-1

This data type expresses a single dependency relationship. The example dependencies above would be represented like so:

DepRequirement "python-six" Nothing
DepRequirement "python3-blivet" (Just (GTE, EVR (Just 1) "1.0" ""))
DepRequirement "booty" (Just (LTE, EVR Nothing "0.107" "1"))

It is not in the scope of this type to know what kind of relationship a DepRequirement describes.

This type derives Ord so that it can be easily be used with collection types, but the derived ordering will not make sense for the purpose of comparing requirements. Use satisfies to determine if requirements match one another.

data EVR Source #

The versioning information portion of a package's name - epoch, version, release.

Constructors

EVR 

Fields

  • epoch :: Maybe Word32

    The epoch of a package. This is sort of a super version number, used when a package with an earlier version number must upgrade a package with a later version number. The package with a larger epoch will always in version comparisons. Most packages do not have an epoch.

  • version :: Text

    The version number provided by the package's upstream, represented as Text.

  • release :: Text

    The release number, represented as Text. The release value is added on by a distribution and allows them to make multiple releases of the same upstream version, fixing bugs and applying distribution-specific tweaks.

Instances

Eq EVR Source # 

Methods

(==) :: EVR -> EVR -> Bool #

(/=) :: EVR -> EVR -> Bool #

Ord EVR Source # 

Methods

compare :: EVR -> EVR -> Ordering #

(<) :: EVR -> EVR -> Bool #

(<=) :: EVR -> EVR -> Bool #

(>) :: EVR -> EVR -> Bool #

(>=) :: EVR -> EVR -> Bool #

max :: EVR -> EVR -> EVR #

min :: EVR -> EVR -> EVR #

Show EVR Source # 

Methods

showsPrec :: Int -> EVR -> ShowS #

show :: EVR -> String #

showList :: [EVR] -> ShowS #

Functions

parseEVR :: Text -> Either ParseError EVR Source #

Convert a Text representation into an EVR or a ParseError if something goes wrong.

parseDepRequirement :: Text -> Either ParseError DepRequirement Source #

Convert a Text representation into a DepRequirement or a ParseError if something goes wrong.

satisfies Source #

Arguments

:: DepRequirement

The package in question, represented as a DepRequirement.

-> DepRequirement

The requirement.

-> Bool 

Determine if a candidate package satisfies the dependency relationship required by some other package.

vercmp :: Text -> Text -> Ordering Source #

Compare two version numbers and return an Ordering.