upload_buildsymbols.py
changeset 5 418f808c28e0
parent 4 fffe07f13f9a
child 6 460ec0868b86
equal deleted inserted replaced
4:fffe07f13f9a 5:418f808c28e0
    28           if fn[1] == "rpm":
    28           if fn[1] == "rpm":
    29 	    if fn[0].find("buildsymbols") != -1:
    29 	    if fn[0].find("buildsymbols") != -1:
    30 	      tmpstr = fn[0].rsplit(".", 1)[0]
    30 	      tmpstr = fn[0].rsplit(".", 1)[0]
    31 	      tmpstr = tmpstr.rsplit("-", 2)
    31 	      tmpstr = tmpstr.rsplit("-", 2)
    32 	      name = tmpstr[0].rsplit("-", 1)[0]
    32 	      name = tmpstr[0].rsplit("-", 1)[0]
       
    33 	      # filter xulrunner symbols
       
    34 	      if name.find("xulrunner") == -1:
       
    35 		continue
    33 	      version = tmpstr[1] + "-" + tmpstr[2]
    36 	      version = tmpstr[1] + "-" + tmpstr[2]
    34               if version.find("_") == -1:
    37               if version.find("_") == -1:
    35 	        self.packages[name] = version
    38 	        self.packages[name] = version
    36 
    39 
    37   def get_buildsymbols(self):
    40   def get_buildsymbols(self):
    47   try:
    50   try:
    48     f = urllib2.urlopen(uri)
    51     f = urllib2.urlopen(uri)
    49     lf = open(filename, "wb")
    52     lf = open(filename, "wb")
    50     lf.write(f.read())
    53     lf.write(f.read())
    51     lf.close()
    54     lf.close()
    52   except HTTPError, e:
    55   except urllib2.HTTPError, e:
    53     print "HTTP Error:",e.code , uri
    56     print "HTTP Error:",e.code , uri
    54   except URLError, e:
    57   except urllib2.URLError, e:
    55     print "URL Error:",e.reason , uri
    58     print "URL Error:",e.reason , uri
    56 
    59 
    57   # extract
    60   # extract
    58   command = "rpm2cpio " + filename + " | cpio -idm --quiet"
    61   command = "rpm2cpio " + filename + " | cpio -idm --quiet"
    59   print "extracting symbols from package"
    62   print "extracting symbols from package"
    82   os.system(command)
    85   os.system(command)
    83 
    86 
    84 
    87 
    85 def find_packages(repo, arch):
    88 def find_packages(repo, arch):
    86   updates = []
    89   updates = []
    87   f = urllib2.urlopen(repo)
    90   try:
       
    91     f = urllib2.urlopen(repo)
       
    92   except urllib2.HTTPError, e:
       
    93     print e.code
       
    94     print "Repo does not exist"
       
    95     return False
       
    96 
    88   s = f.read()
    97   s = f.read()
    89 
    98 
    90   parser = MyParser()
    99   parser = MyParser()
    91   parser.parse(s)
   100   parser.parse(s)
    92 
   101 
   126 
   135 
   127 # MAIN
   136 # MAIN
   128 
   137 
   129 baseurl = "http://download.opensuse.org/"
   138 baseurl = "http://download.opensuse.org/"
   130 archs = [ "i586", "x86_64"]
   139 archs = [ "i586", "x86_64"]
   131 repos = [ "distribution/11.3/repo/oss/suse/", "update/11.3/rpm/", "distribution/11.4/repo/oss/suse/", "update/11.4/rpm/" ]
   140 repos = [ "distribution/12.2/repo/oss/suse/", "distribution/12.3/repo/oss/suse/", "update/12.2/", "update/12.3/" ]
   132 bsrepos = [ "repositories/mozilla/", "repositories/mozilla:/beta/" ]
   141 bsrepos = [ "repositories/mozilla/", "repositories/mozilla:/beta/", "repositories/mozilla:/alpha/" ]
   133 bsdists = [ "openSUSE_11.4", "openSUSE_11.3", "openSUSE_11.2" ]
   142 bsdists = [ "openSUSE_13.1", "openSUSE_12.3", "openSUSE_12.2" ]
   134 SSHCONF = "mozsymbols"
   143 SSHCONF = "mozsymbols"
   135 
   144 
   136 # product repos
   145 # product repos
   137 for repo in repos:
   146 for repo in repos:
   138   for arch in archs:
   147   for arch in archs: