source: soft/build_system/build_system/upload/robot/trunk/changelog_rpm4.0 @ 1

Last change on this file since 1 was 1, checked in by fasma, 13 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 2.1 KB
Line 
1#!/usr/bin/perl
2# -*- Mode: cperl -*-
3# Send a changelog to $list
4
5use strict;
6use RPM::Header;
7use MIME::Words qw(encode_mimewords);
8use vars qw($contrib $debug $frozen);
9
10if ($ARGV[0] =~ /^-c/) {
11    $contrib++;
12    shift;
13}
14
15if ($ARGV[0] =~ /^-d/) {
16    $debug++;
17    shift;
18}
19
20if ($ARGV[0] =~ /^-f/) {
21    $frozen++;
22    shift;
23}
24
25my $rpm = shift or die "Give me a fuel for my aeroplane\n";
26my $list = "Changelog List <changelog\@linux-mandrake.com>";
27local *M;
28
29my $changelog = `~/robot/ch $rpm`;die "Can't ~/robot/ch $rpm: $!" if $?;chomp $changelog;
30my $maintain = `~/robot/ch -m $rpm`;die "Can't ~/robot/ch -m $rpm: $!" if $?;chomp $maintain;
31$maintain =~ s|<.*\@.*>||;
32
33my %header;
34my $description = `rpm -qpi $rpm`;die "Can't ~/robot/ch -m $rpm: $!" if $?;
35tie %header, "RPM::Header", $rpm or die "ERROR: $RPM::err\n";
36my ($name, $version, $release, $buildarchs, $exclusivearch, $excludearch) = @header{qw(NAME VERSION RELEASE BUILDARCHS EXCLUSIVEARCH EXCLUDEARCH)};
37
38$description .= "\n";
39$description .= "Buildarchs: @$buildarchs " if ref $buildarchs;
40$description .= "Exclusivearch: $exclusivearch " if $exclusivearch;
41$description .= "Excludearch: $excludearch" if $excludearch;
42
43unless ($debug) {
44    open M, "|/usr/sbin/sendmail -B8BITMIME -oi -t " or die "Can't fork for sendmail: $!\n";select M;
45}
46
47print "From: ", encode_mimewords($maintain), "<devel\@mandriva.com>\nTo: $list\nReply-To: cooker\@linux-mandrake.com\nSender: devel\@mandriva.com\n";
48
49my $srpms;
50
51if ($contrib) {
52    print "Subject: [Contrib-Rpm] $name-$version-$release\n\n[Contrib-RPM]\n\n";
53    $srpms = '/contrib/SRPMS';
54} else {
55  if ($frozen) {
56    print "Subject: [Frozen-CHRPM] $name-$version-$release\n\n";
57    $srpms = '/frozen/SRPMS';
58  } else {
59    print "Subject: [CHRPM] $name-$version-$release\n\n";
60    $srpms = '/SRPMS';
61  }
62}
63
64my $diff = `~/bin/diffsrcrpm $rpm $srpms`;
65my $rpmlint = `rpmlint $rpm`;
66
67print "--=-=-=\n$description\n--=-=-=\n\n";
68$changelog ? print $changelog, "\n" : print "Nothing :-( ......\n";
69print "--=-=-=\n$rpmlint\n--=-=-=\n";
70print "$diff\n--=-=-=\n\n";
71print "-- \nhttp://www.mandrake-linux.com/en/cookerdevel.php3\n";
72
73
74close M unless $debug;
75
Note: See TracBrowser for help on using the repository browser.