source: soft/build_system/build_system/upload/robot/trunk/changelog @ 1

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

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

File size: 3.1 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($version $contrib $debug $club);
8use URPM;
9
10if ($ARGV[0] =~ /^-c/) {
11    $contrib++;
12    shift;
13}
14
15if ($ARGV[0] =~ /^-C/) {
16    $club++;
17    shift;
18}
19
20if ($ARGV[0] =~ /^-d/) {
21    $debug++;
22    shift;
23}
24
25if ($ARGV[0] =~ /^-f/) {
26    shift;
27    $version = shift;
28}
29
30my $rpm = shift or die "Give me a fuel for my aeroplane\n";
31my $list = "Changelog List <changelog\@mandrivalinux.org>";
32local *M;
33
34#my $changelog = `~/robot/ch $rpm`;# die "Can't ~/robot/ch $rpm: $!" if $?;chomp $changelog;
35#my $maintain = `~/robot/ch -m $rpm`;# die "Can't ~/robot/ch -m $rpm: $!" if $?;chomp $maintain;
36my $official_maintainer = `~/robot/rpmmon -p $rpm`;
37
38my $URPM = URPM->new();
39my $description = `rpm --nosignature -qpi $rpm`;die "Can't ~/robot/ch -m $rpm: $!" if $?;
40my ($id) = $URPM->parse_rpm($rpm, keep_all_tags => 1);
41my $pkg = $URPM->{depslist}[$id];
42
43my $name = $pkg->name . "-" . $pkg->version . "-" . $pkg->release;
44
45my $changelog = ($pkg->changelog_name)[0] . "\n\n" . ($pkg->changelog_text)[0];
46my $maintain = ($pkg->changelog_name)[0];
47$maintain =~ s/<.*\@.*>.*//;
48
49$description .= "\n";
50$description .= "Buildarchs: ". join(' ',$pkg->buildarchs). "\n" if $pkg->buildarchs;
51$description .= "Exclusivearch: ". join(' ',$pkg->exclusivearchs). "\n" if $pkg->exclusivearchs;
52$description .= "Excludearch: ". join(' ',$pkg->exclusivearchs). "\n" if $pkg->excludearchs;
53
54unless ($debug) {
55    open M, "|/usr/sbin/sendmail -B8BITMIME -oi -t " or die "Can't fork for sendmail: $!\n";select M;
56}
57
58if ($club) {
59  print "From: ", encode_mimewords($maintain), "<devel\@mandriva.com>\nTo: webmaster\@mandrivaclub.com\n";
60} else {
61  print "From: ", encode_mimewords($maintain), "<devel\@mandriva.com>\nTo: $list\nReply-To: cooker\@mandrivalinux.org\nSender: devel\@mandriva.com\n";
62}
63
64my $srpms;
65
66my $tag;
67if ($contrib) {
68  if ($version) {
69    $tag = "$version-";
70    if ($club) { $tag = "Club-$tag" }
71    $srpms = "/community/$version/SRPMS/contrib"
72  } else {
73    $srpms = '/SRPMS/contrib/release/'
74  }
75  print "Subject: [${tag}Contrib-Rpm] " . $name . "\n\n[Contrib-RPM]\n\n";
76} else {
77  if ($version) {
78    $tag = "$version-";
79    if ($club) { $tag = "Club-$tag" }
80    $srpms = "/community/$version/SRPMS/main";
81  } else {
82    $srpms = '/SRPMS/main/release/';
83  }
84  print "Subject: [${tag}CHRPM] " . $name . "\n\n";
85}
86
87my $diff = `~/robot/diffsrcrpm $rpm $srpms`;
88my $rpmlint = `rpmlint $rpm`;
89
90print "-=-=-=-\n$description\n\n";
91$official_maintainer ? print "-=-=-=-\nOfficial maintainer: $official_maintainer\n" : print "-=-=-=-\nUnmaintained......\n";
92$changelog ? print "-=-=-=-\n$changelog\n\n" : print "-=-=-=-\nNothing :-( ......\n\n";
93$rpmlint ? print "-=-=-=-\n$rpmlint\n" : print "-=-=-=-\nNo rpmlint error, happy (wo)man :-)\n\n";
94print "-=-=-=-\nhttp://cvs.mandriva.com/cgi-bin/viewvc.cgi/" . ( $contrib ? "contrib-" : "" ) . "SPECS/" . $pkg->name . "/\n";
95print "\n", "$diff" || "No diff from old package", "\n\n" ;
96print "-- \nhttp://www.mandrivalinux.com/en/cookerdevel.php3\n";
97
98
99close M unless $debug;
100
Note: See TracBrowser for help on using the repository browser.