source: branches/3.0/tools/mdv-changelog.pl

Last change on this file was 922, checked in by bruno, 13 years ago

Delivery to MDV is now OK

  • Property svn:executable set to *
File size: 909 bytes
Line 
1#!/usr/bin/perl -w
2#
3# Remove changelog from official mdv package and
4# prepare the comment for the commit
5
6use strict;
7use File::Copy;
8
9open(FILE, $ARGV[0]) || die "Unable to open $ARGV[0]";
10open(OUT, "> $ENV{'MONDOTMP'}/out.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";
11open(CMT, "> $ENV{'MONDOTMP'}/cmt.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";
12while (<FILE>) {
13    if ($_ !~ /^\%changelog/) {
14        print OUT "$_";
15    } else {
16        # We found %changelog, that's the end for the spec
17        print OUT "$_";
18        close(OUT);
19        # Next line is the date + ver => unneeded
20        my $tmp = <FILE>;
21
22        # Get the first changelog set into the comment for SVN
23        while (<FILE>) {
24            if ($_ !~ /^[   ]*$/) {
25                print CMT "$_";
26            } else {
27                # We found an empty line, that's the end for the cmt
28                close (CMT);
29                close (FILE);
30
31                move("$ENV{'MONDOTMP'}/out.spec", $ARGV[0]);
32                exit(0);
33            }
34        }
35    }
36
37}
Note: See TracBrowser for help on using the repository browser.