pkgrel

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pkgrel says whether two readings of a software's release are the same release written with more or less detail: a scan banner's "10.2", an upstream "10.2p1", Alpine's "10.2_p1-r1", Debian's "1:10.2p1-2ubuntu3.8", RPM's "8.7p1-38.el9". A pure function on text a device, a person or a scan sent; a text of another shape is compared as written, never guessed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distro

func Distro(osName string) string

Distro is the Linux distribution family an OS name names ("alpine", "ubuntu", "debian", "rhel", "suse"), "" for none (Windows, a network OS such as Junos, an unknown OS). Only a distribution builds packages whose release differs from the upstream version.

func Marked

func Marked(v string) bool

Marked says a release text carries a distribution's mark in its revision ("2ubuntu3.8", "+deb12u3", ".el9").

func Release

func Release(p string) bool

Release says a text is a distribution's package release by its own shape: Alpine's apk ("10.2_p1-r1", also after a package name: "openssh-10.2_p1-r1"), a release with a distribution's mark ("1:10.2p1-2ubuntu3.8", "9.2p1-2+deb12u3", "8.7p1-38.el9"), or a Debian version with an epoch ("1:9.2p1-2"). A vendor's release ("15.1R7.9", "v7.2.13", "9.6") is not one.

func Same

func Same(aVersion, aPkg, bVersion, bPkg string) bool

Same reports whether two readings are one release: each reading is its package release when it has one, else its version. "10.2" and "10.2p1" are the same (the shorter one omits the patch level); 10.2 and 9.8, or 10.2 and 10.3, are not. An empty reading is never the same as anything.

func Upstream

func Upstream(v string) string

Upstream is the upstream version a release text names, lower case: a banner's extra words are dropped ("10.2p1 Ubuntu 2ubuntu3.8" is 10.2p1), an apk release reads as NVD writes it ("10.2_p1-r1" is 10.2p1), and a Debian or RPM release loses its epoch and its distribution revision ("1:9.2p1-2+deb12u3" is 9.2p1, "8.7p1-38.el9" is 8.7p1).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL