~ubuntu-branches/ubuntu/maverick/python-debian/maverick

« back to all changes in this revision

Viewing changes to examples/deb822/grep_native_packages.py

  • Committer: Bazaar Package Importer
  • Author(s): John Wright
  • Date: 2008-04-30 23:58:24 UTC
  • mfrom: (1.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080430235824-iq9mp0fbd0efmruv
Tags: 0.1.10
* debian_bundle/deb822.py, tests/test_deb822.py:
  - Do not cache _CaseInsensitiveString objects, since it causes case
    preservation issues under certain circumstances (Closes: #473254)
  - Add a test case
* debian_bundle/deb822.py:
  - Add support for fixed-length subfields in multivalued fields.  I updated
    the Release and PdiffIndex classes to use this.  The default behavior for
    Release is that of apt-ftparchive, just because it's simpler.  Changing
    the behavior to resemble dak requires simply setting the
    size_field_behavior attribute to 'dak'.  (Ideally, deb822 would detect
    which behavior to use if given an actual Release file as input, but this
    is not implemented yet.)  (Closes: #473259)
  - Add support for Checksums-{Sha1,Sha256} multivalued fields in Dsc and
    Changes classes
* debian/control:
  - "python" --> "Python" in the Description field
  - Change the section to "python"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
# grep the names of all Debian native packages out of Sources files
 
4
# Copyright (C) 2007 Stefano Zacchiroli <zack@debian.org>
 
5
#
 
6
# This program is free software: you can redistribute it and/or modify
 
7
# it under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation, either version 3 of the License, or
 
9
# (at your option) any later version.
 
10
 
 
11
import sys
 
12
 
 
13
from debian_bundle import deb822
 
14
 
 
15
for fname in sys.argv[1:]:
 
16
    f = file(fname)
 
17
    for stanza in deb822.Sources.iter_paragraphs(f):
 
18
        pieces = stanza['version'].split('-')
 
19
        if len(pieces) < 2:
 
20
            print stanza['package']
 
21
    f.close()
 
22