~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to UpdateManager/Core/MetaRelease.py

  • Committer: Michael Vogt
  • Date: 2009-01-26 16:26:13 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090126162613-yvx1zkwdwspbwqow
improve logic that detects what mirror is in use by
sources.list inspection (LP: #107983)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from ConfigParser import ConfigParser
31
31
from subprocess import Popen,PIPE
32
32
 
 
33
try:
 
34
  from utils import *
 
35
except Exception:
 
36
  from UpdateManager.Common.utils import *
 
37
 
 
38
 
33
39
class Dist(object):
34
40
    def __init__(self, name, version, date, supported):
35
41
        self.name = name
153
159
        """
154
160
        self.new_dist = dist
155
161
 
156
 
    def get_dist(self):
157
 
        " return the codename of the current runing distro "
158
 
        p = Popen(["lsb_release","-c","-s"],stdout=PIPE)
159
 
        res = p.wait()
160
 
        if res != 0:
161
 
            sys.stderr.write("lsb_release returned exitcode: %i\n" % res)
162
 
            return "unknown distribution"
163
 
        dist = string.strip(p.stdout.readline())
164
 
        return dist
165
 
    
166
162
    def parse(self):
167
163
        self._debug("MetaRelease.parse()")
168
164
        current_dist_name = self.get_dist()