Exemplo n.º 1
0
 def add_source_from_line(self, line):
   """
   Add a source with the given apt line and auto-add
   signing key if we have it in the whitelist
   """
   (deb_line, file) = expand_ppa_line(line.strip(), self.distro.codename)
   deb_line = self.expand_http_line(deb_line)
   debsrc_line = 'deb-src' + deb_line[3:]
   new_deb_entry = SourceEntry(deb_line, file)
   new_debsrc_entry = SourceEntry(debsrc_line, file)
   if new_deb_entry.invalid or new_debsrc_entry.invalid:
     return False
   worker = self.check_and_add_key_for_whitelisted_channels(deb_line)
   self.sourceslist.add(new_deb_entry.type,
                        new_deb_entry.uri,
                        new_deb_entry.dist,
                        new_deb_entry.comps,
                        comment=new_deb_entry.comment,
                        file=new_deb_entry.file,
                        architectures=new_deb_entry.architectures)
   self.sourceslist.add(new_debsrc_entry.type,
                        new_debsrc_entry.uri,
                        new_debsrc_entry.dist,
                        new_debsrc_entry.comps,
                        comment=new_debsrc_entry.comment,
                        file=new_debsrc_entry.file,
                        architectures=new_debsrc_entry.architectures)
   self.set_modified_sourceslist()
   if worker:
       # wait for GPG key to be downloaded
       worker.join(30)
   return True
 def add_source_from_line(self, line):
   """
   Add a source with the given apt line and auto-add
   signing key if we have it in the whitelist
   """
   (deb_line, file) = expand_ppa_line(line.strip(), self.distro.codename)
   debsrc_line = 'deb-src' + deb_line[3:]
   new_deb_entry = SourceEntry(deb_line, file)
   new_debsrc_entry = SourceEntry(debsrc_line, file)
   if new_deb_entry.invalid or new_debsrc_entry.invalid:
     return False
   self.check_and_add_key_for_whitelisted_channels(deb_line)
   self.sourceslist.list.append(new_deb_entry)
   self.sourceslist.list.append(new_debsrc_entry)
   self.set_modified_sourceslist()
   return True
 def add_source_from_line(self, line):
   """
   Add a source with the given apt line and auto-add
   signing key if we have it in the whitelist
   """
   codenames = {}
   codenames["wheezy"] = "vivid" 
   codenames["stable"] = "vivid"
   codenames["jessie"] = "vivid"
   codenames["testing"] = "vivid"
   codenames["sid"] = "vivid"
   codenames["unstable"] = "vivid"
   (deb_line, file) = expand_ppa_line(line.strip(), codenames[self.distro.codename])
   deb_line = self.expand_http_line(deb_line)
   debsrc_line = 'deb-src' + deb_line[3:]
   new_deb_entry = SourceEntry(deb_line, file)
   new_debsrc_entry = SourceEntry(debsrc_line, file)
   if new_deb_entry.invalid or new_debsrc_entry.invalid:
     return False
   self.check_and_add_key_for_whitelisted_channels(deb_line)
   self.sourceslist.list.append(new_deb_entry)
   self.sourceslist.list.append(new_debsrc_entry)
   self.set_modified_sourceslist()
   return True