source: soft/build_system/build_system/upload/robot/trunk/changelog_rpm4.2 @ 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.4 KB
Line 
1#!/usr/bin/perl
2# -*- Mode: cperl -*-
3# Send a changelog to $list
4
5use strict;
6use MIME::Words qw(encode_mimewords);
7use vars qw($contrib $debug $frozen);
8use URPM;
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
29#my $changelog = `~/robot/ch $rpm`;# die "Can't ~/robot/ch $rpm: $!" if $?;chomp $changelog;
30#my $maintain = `~/robot/ch -m $rpm`;# die "Can't ~/robot/ch -m $rpm: $!" if $?;chomp $maintain;
31
32my $URPM = URPM->new();
33my $description = `rpm --nogpg -qpi $rpm`;die "Can't ~/robot/ch -m $rpm: $!" if $?;
34my ($id) = $URPM->parse_rpm($rpm, keep_all_tags => 1);
35my $pkg = $URPM->{depslist}[$id];
36
37my $name = $pkg->name . "-" . $pkg->version . "-" . $pkg->release;
38
39my $changelog = ($pkg->changelog_name)[0] . "\n\n" . ($pkg->changelog_text)[0];
40my $maintain = ($pkg->changelog_name)[0];
41$maintain =~ s/<.*\@.*>.*//;
42
43$description .= "\n";
44$description .= "Buildarchs: ". join(' ',$pkg->buildarchs). "\n" if $pkg->buildarchs;
45$description .= "Exclusivearch: ". join(' ',$pkg->exclusivearchs). "\n" if $pkg->exclusivearchs;
46$description .= "Excludearch: ". join(' ',$pkg->exclusivearchs). "\n" if $pkg->excludearchs;
47
48unless ($debug) {
49    open M, "|/usr/sbin/sendmail -B8BITMIME -oi -t " or die "Can't fork for sendmail: $!\n";select M;
50}
51
52print "From: ", encode_mimewords($maintain), "<devel\@mandriva.com>\nTo: $list\nReply-To: cooker\@linux-mandrake.com\nSender: devel\@mandriva.com\n";
53
54my $srpms;
55
56if ($contrib) {
57    print "Subject: [Contrib-Rpm] " . $name . "\n\n[Contrib-RPM]\n\n";
58    $srpms = '/contrib/SRPMS';
59} else {
60  if ($frozen) {
61    print "Subject: [Frozen-CHRPM] " . $name . "\n\n";
62    $srpms = '/frozen/SRPMS';
63  } else {
64    print "Subject: [CHRPM] " . $name . "\n\n";
65    $srpms = '/SRPMS';
66  }
67}
68
69my $diff = `~/bin/diffsrcrpm $rpm $srpms`;
70my $rpmlint = `rpmlint $rpm`;
71
72print "-=-=-=-\n$description\n\n";
73$changelog ? print "-=-=-=-\n$changelog\n\n" : print "-=-=-=-\nNothing :-( ......\n\n";
74$rpmlint ? print "-=-=-=-\n$rpmlint\n" : print "-=-=-=-\nNo rpmlint error, happy man :-)\n\n";
75$diff ? print "-=-=-=-\n$diff\n\n" : print "-=-=-=-\nNo diff from old package\n\n";
76print "-- \nhttp://www.mandrake-linux.com/en/cookerdevel.php3\n";
77
78
79close M unless $debug;
80
Note: See TracBrowser for help on using the repository browser.