[Pkg-bazaar-commits] r134 ./bzr-builddeb/people/jdw/merge_upstream: Switch to iter_paragraphs, rather than splitting the source file myself.

James Westby jw+debian at jameswestby.net
Sat Jun 30 17:37:57 UTC 2007


------------------------------------------------------------
revno: 134
committer: James Westby <jw+debian at jameswestby.net>
branch nick: merge_upstream
timestamp: Sat 2007-06-30 18:37:57 +0100
message:
  Switch to iter_paragraphs, rather than splitting the source file myself.
  
  deb822.Sources provides an iter_paragraphs method to get an object for each
  package described in the file. This is a lot safer than splitting it myself.
  
  Thanks to John Wright for pointing this method out.
modified:
  import_dsc.py
-------------- next part --------------
=== modified file 'import_dsc.py'
--- a/import_dsc.py	2007-06-30 14:17:45 +0000
+++ b/import_dsc.py	2007-06-30 17:37:57 +0000
@@ -323,10 +323,7 @@
     if self.sources_path.endswith(".gz"):
       sources_file = gzip.GzipFile(fileobj=sources_file)
     dsc_files = []
-    for source in sources_file.read().split('\n\n'):
-      if source == '':
-        continue
-      source = deb822.Sources(source)
+    for source in deb822.Sources.iter_paragraphs(sources_file):
       base_dir = source['Directory']
       if not self._check_basedir(base_dir):
         continue



More information about the Pkg-bazaar-commits mailing list