Contents of /branches/ports/maemo/debian/parse-changelog

Parent Directory Parent Directory | Revision Log Revision Log


Revision 60 - (hide annotations)
Sun Feb 8 22:01:23 2009 UTC (15 years, 3 months ago) by achadwick
Original Path: branches/ports/debian/debian/parse-changelog
File size: 574 byte(s)
Debian ports branch:
  merge from trunk,
  update changelog,
  add a version number fragment parser,
  PREFIX setting for dh_auto_build
1 achadwick 60 #!/usr/bin/perl
2    
3     $CHANGELOG = 'debian/changelog';
4    
5     ($what, $trunkv) = (@ARGV);
6     defined($what) && defined($trunkv) or die "usage: $0 WHAT TRUNK_VERSION\n";
7     $trunkv_re = quotemeta($trunkv);
8     open(CL, '<', $CHANGELOG) || die "open($CHANGELOG) failed: $!\n";
9     while (<CL>) {
10     m{\((.*?)\b$trunkv_re\b(.*?)\)} or next;
11     ($prefix, $suffix) = ($1, $2);
12     last;
13     }
14     close CL;
15     if (! (defined($suffix) || defined($prefix))) {
16     die "error: $CHANGELOG does not list trunk version $trunkv\n";
17     }
18     if ($what eq 'prefix') {
19     print $prefix, "\n";
20     }
21     else {
22     print $suffix, "\n";
23     }

Properties

Name Value
svn:executable *