Changes between Version 1 and Version 2 of YumCodeSnippet/GetReleaseVersion

Show
Ignore:
Author:
james (IP: 65.172.155.230)
Timestamp:
10/01/10 15:12:25 (7 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YumCodeSnippet/GetReleaseVersion

    v1 v2  
    33{{{ 
    44 
    5 # Directly... NOTE that this disregards some yum specific information: 
    6 import rpmUtils 
     5# Directly... NOTE that this disregards some yum specific information (and assumes redhat-release): 
     6pkg_provide = "redhat-release" 
     7import rpm 
     8import rpmUtils.transaction 
    79 
    8 ts = rpmUtils.transaction.initReadOnlyTransaction(root=installroot
     10ts = rpmUtils.transaction.initReadOnlyTransaction(
    911ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) 
    1012# This can throw exceptions, have fun... :) 
    11 idx = ts.dbMatch('provides', distroverpkg
     13idx = ts.dbMatch('provides', pkg_provide
    1214if idx.count() == 0: 
    1315    releasever = '$releasever' 
    2123yb = yum.YumBase() 
    2224yb.conf 
    23 print '$releasever =', yb.yumvars['releasever'] 
     25print '$releasever =', yb.yumvar['releasever'] 
    2426 
    2527}}}