Changes

Jump to navigation Jump to search
Line 1: Line 1:  
{{Level|Developer}}
 
{{Level|Developer}}
 +
When we use some tools to automatise rpm build, it is a mandatory to find and bump the version in cvs
 
===script to increment version number===
 
===script to increment version number===
 
For use with scripts, or more customizability to apply to various versioning systems. It could use a couple more options, but as it stands now it works for my projects using the "major.minor[.maintenance[.build]]" version sequences.
 
For use with scripts, or more customizability to apply to various versioning systems. It could use a couple more options, but as it stands now it works for my projects using the "major.minor[.maintenance[.build]]" version sequences.
Line 87: Line 88:  
in a script you can use this from your spec file
 
in a script you can use this from your spec file
 
  version=$(grep -sri 'define version' *.spec | sed 's/%define version //gI')
 
  version=$(grep -sri 'define version' *.spec | sed 's/%define version //gI')
 +
versionincr=$(increment_version $version 2)
 +
 +
or also
 +
        # Informations needed from the spec file
 +
        version=$(rpm -q --qf "%{version}\n" --specfile $name.spec | head -1)
 +
        versionincr=$(increment_version $version 2)
    
===find and bump release number===
 
===find and bump release number===
Line 94: Line 101:  
  #bump the release
 
  #bump the release
 
  release=$((release + 1))
 
  release=$((release + 1))
 +
or
 +
        # Informations needed from the spec file
 +
        release=$(rpm -q --qf "%{release}\n" --specfile $name.spec | head -1| sed s/\.el.//)
 +
        release=$((release + 1))

Navigation menu