Skip to content

arzonus/goevr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOEVR

Build Status Coverage Status

Description

goevr is a NEVRA library written in golang for comparing rpm/dpkg package version. Documentation is here.

Usage

You can use this library for comparing different rpm/dpkg package versions

package main

import (
  "github.com/arzonus/goevr"
  "log"
)

func main() {

    oldVersion := "6.0-16+deb8u2"
    newVersion := "0:6.0-17+deb7u2"
    
    
    if goevr.GT(newVersion, oldVersion) {
      log.Println(newVersion, "greater than", oldVersion )
    } else {
      log.Println(newVersion, "less or equal than", oldVersion)
    }
    
    newEvr := goevr.New(newVersion)
    oldEvr := goevr.New(oldVersion)
    
    if newEvr.GTE(oldEvr) {
      log.Println(newEvr.String(), "greater or equal than", oldEvr.String())
    } else {
      log.Println(newEvr.String(), "less than", oldEvr.String())
    }
    
    e, v, r := goevr.Parse(oldVersion)
    log.Println(e, v, r)    
}

Installation

go get github.com/arzonus/goevr

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages