Subversion Repositories DevTools

Rev

Rev 4632 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4625 dpurdie 1
########################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
3
#
4
# Module name   : process_release_notes.pl
5
# Module type   : JATS Utility
6
# Compiler(s)   : Perl
7
# Environment(s): jats
8
#
9
# Description   : Poll RM and generate Release Notes as required
10
#                 Must run on the same machine as the package archive
11
#                 It directly manipulates the target package
12
#                 Requires access to the machines sudo mechism
13
#
14
# Usage         : See POD at the end of this file
15
#
16
#......................................................................#
17
 
18
require 5.008_002;
19
 
20
use strict;
21
use warnings;
22
use JatsError;
23
use JatsSystem;
24
use Getopt::Long;
25
use Pod::Usage;                             # required for help support
26
use File::Temp qw/ tempfile tempdir /;
27
use LWP::UserAgent;
28
use HTTP::Request::Common 'POST';
29
use Fcntl ':flock';
30
use FindBin;                                # Determine the current directory
31
 
32
use JatsEnv;
33
use JatsRmApi;
34
use FileUtils;
35
 
36
use DBI;
37
 
38
my $VERSION = "1.0.0";                      # Update this
39
my $GBE_DPKG = $ENV{GBE_DPKG};              # Sanitised by Jats
40
my $RM_DB;
41
my $tempdir;
42
my $sudoUtilsDir = '/home/releasem/sbin';
43
my $lockFile = '/tmp/JATSRN_LOCK';
44
my $scriptDir = "$FindBin::Bin";
45
 
46
#
47
#   Options
48
#
49
my $opt_verbose = 0;
50
my $opt_help = 0;
51
my $opt_age = 2;
52
my $opt_keepTemp = 0;
53
my $opt_status = 0;
54
my $opt_pvid;
55
 
56
#
57
#   Package information
58
#
59
my @Packages;
60
my @packageItems = qw( PV_ID RTAG_ID NAME VERSION PKG_ID PROJ_ID RNINFO);
61
my %rmConfig;
62
 
63
#-------------------------------------------------------------------------------
64
# Function        : Main Entry
65
#
66
# Description     :
67
#
68
# Inputs          :
69
#
70
# Returns         :
71
#
72
my $result = GetOptions (
73
                'help+'         => \$opt_help,          # flag, multiple use allowed
74
                'manual:3'      => \$opt_help,          # flag
75
                'verbose:+'     => \$opt_verbose,       # flag
76
                'age:i'         => \$opt_age,           # Number
77
                'keeptemp!'     => \$opt_keepTemp,      # flag
78
                'status+'       => \$opt_status,        # flag
79
                'pvid:i'        => \$opt_pvid,          # Number
80
                );
81
 
82
#
83
#   Process help and manual options
84
#
85
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
86
pod2usage(-verbose => 1)  if ($opt_help == 2);
87
pod2usage(-verbose => 2)  if ($opt_help > 2);
88
 
89
ErrorConfig( 'name'    =>'RelNotes', 
90
             'verbose' => $opt_verbose );
91
$opt_verbose-- if ($opt_verbose > 0);
92
#
93
#   Sanity Test
94
#
95
Error("Not running on a Unix System") unless ($ENV{GBE_UNIX});
96
Error("Sudo Utils not found: $sudoUtilsDir") unless ( -d $sudoUtilsDir);
97
Warning("Not running as a sutable user" ) unless ($ENV{USER} eq 'buildadm' || $ENV{USER} eq 'releasem');
98
EnvImport ('GBE_PERL');
99
 
100
#
101
#   Ensure only one instance is running
102
#   PerlMonks say to use $0 as the lock file, but that did not work.
103
#   Perhaps the file was open in an editor
104
#   Solution: Create my own file
105
#
106
open( FW, '>',$lockFile);
107
print FW '';
108
close FW;
109
 
110
open (my $self, '<', $lockFile) || Error("Couldn't open self: $!");
111
flock ($self, (LOCK_EX | LOCK_NB)) || Error("This script is already running");
112
 
113
#
114
#   Init parameters
115
#
116
$tempdir = tempdir('/tmp/JATSRN_XXXXXX',CLEANUP => !$opt_keepTemp);
117
Warning("Need to remove tempdir: " . DisplayPath($tempdir)) if $opt_keepTemp;
118
Verbose("Tempdir:" , DisplayPath($tempdir));
119
Verbose("scriptDir:" , DisplayPath($scriptDir));
120
 
121
#   Force GBE_ABT. Currently the Release Manager proxy password only works
122
#   When used in this mode
123
$ENV{GBE_ABT} = 1 unless defined $ENV{GBE_ABT};
124
 
125
#
126
#   User RW password, if provided
127
#
128
$ENV{GBE_RM_USERNAME} = $ENV{GBE_RM_USERNAME_RW} if (exists $ENV{GBE_RM_USERNAME_RW});
129
$ENV{GBE_RM_PASSWORD} = $ENV{GBE_RM_PASSWORD_RW} if (exists $ENV{GBE_RM_PASSWORD_RW});
130
 
131
if ($ENV{GBE_ABT} && $ENV{GBE_RM_USERNAME} && $ENV{GBE_RM_USERNAME} !~ m~]$~ )
132
{
133
    Verbose("Access RM database as proxy user");
134
    $ENV{GBE_RM_USERNAME} = $ENV{GBE_RM_USERNAME} . '[release_manager]'; 
135
}
136
 
137
#
138
#   Interogate the RM database and locate packages that need to be processed
139
#
140
$opt_pvid ? LocatePackagesByPvid() : LocatePackages();
141
Verbose("Package to process:" . scalar @Packages);
142
#DebugDumpData("Packages", \@Packages);
143
 
144
#
145
#   Process each found entry
146
#
147
foreach my $entry ( @Packages)
148
{
149
    GenerateReleaseNote( $entry);
150
}
151
 
152
unlink $lockFile;
153
exit 0;
154
 
155
#-------------------------------------------------------------------------------
156
# Function        : LocatePackages 
157
#
158
# Description     : Locate packages in need of Release Notes
159
#
160
# Inputs          : None
161
#
162
# Returns         : Nothing
163
#                   Populates the @Packages array
164
#
165
sub LocatePackages
166
{
167
 
168
    my $m_sqlstr =
169
            "SELECT * from
170
            (
171
                SELECT pv.pv_id, 
172
                       rc.rtag_id, 
173
                       pkg.pkg_name, 
174
                       pv.pkg_version, 
175
                       pv.pkg_id, 
176
                       rt.proj_id , 
177
                       pv.release_notes_info,
178
                       TRUNC(sysdate - pv.modified_stamp ) AS age , 
179
                       row_number() OVER (PARTITION BY pv.pv_id, pkg.pkg_name, pv.pkg_version ORDER BY rc.rtag_id) rn
180
                FROM release_manager.package_versions pv, 
181
                     release_manager.release_content rc, 
182
                     release_manager.packages pkg, 
183
                     release_manager.release_tags rt
184
                WHERE pv.pv_id = rc.pv_id
185
                AND pkg.pkg_id = pv.pkg_id
186
                AND rc.rtag_id = rt.rtag_id
187
                AND pv.pv_id IN (SELECT pv_id 
188
                                 FROM release_manager.package_versions 
189
                                 WHERE (release_notes_info IS null 
190
                                     OR release_notes_info like 'MSG:%' )
191
                                 AND pv.dlocked = 'Y'
192
                                 AND pv.modified_stamp > (sysdate - $opt_age)
193
                                 )
194
            )
195
            where rn = 1";
196
 
197
    populateArrayFromSql('LocatePackages', \@Packages, $m_sqlstr, \@packageItems);
198
#    DebugDumpData("Packages", \@Packages);
199
}
200
 
201
#-------------------------------------------------------------------------------
202
# Function        : LocatePackagesByPvid 
203
#
204
# Description     : Locate one package, as specified by its PVID
205
#                   This mode is only used in testing  
206
#
207
# Inputs          : Global: $opt_pvid 
208
#
209
# Returns         : Populate the @Packages array
210
#
211
sub LocatePackagesByPvid
212
{
213
    #   Extract: PV_ID RTAG_ID NAME VERSION PKG_ID PROJ_ID RNINFO AGE 
214
    my $m_sqlstr = "
215
                SELECT pv.pv_id, 
216
                       rc.rtag_id, 
217
                       pkg.pkg_name, 
218
                       pv.pkg_version, 
219
                       pv.pkg_id, 
220
                       rt.proj_id, 
221
                       pv.release_notes_info
222
                FROM release_manager.package_versions pv, 
223
                     release_manager.release_content rc, 
224
                     release_manager.packages pkg, 
225
                     release_manager.release_tags rt
226
                WHERE pv.pv_id = rc.pv_id
227
                AND pkg.pkg_id = pv.pkg_id
228
                AND rc.rtag_id = rt.rtag_id
229
                AND pv.pv_id = $opt_pvid
230
                ";
231
 
232
    populateArrayFromSql('LocatePackagesByPvid', \@Packages, $m_sqlstr, \@packageItems);
233
    #DebugDumpData("Packages", \@Packages);
234
}
235
 
236
#-------------------------------------------------------------------------------
237
# Function        : GenerateReleaseNote  
238
#
239
# Description     : Generate One Release Note
240
#                   Invoke several JATS utilities to do the hard work
241
#
242
# Inputs          : $entry          - Hash of useful infomation
243
#
244
# Returns         : Nothing
245
#                   Will exit on error
246
#
247
sub GenerateReleaseNote
248
{
249
    my ($entry) = @_;
250
    my $outfile;
251
    my $rv;
252
    my @args;
253
 
254
    #DebugDumpData("Entry", $entry);
255
    Message("-------------------- $entry->{NAME}, $entry->{VERSION}") if $opt_status || $opt_verbose;
256
 
257
    my $pkgBase = catdir($GBE_DPKG, $entry->{NAME}, $entry->{VERSION});
258
    Verbose("Processing: $pkgBase");
259
    unless (-d $pkgBase) {
260
        Warning("Package not in archive: $pkgBase");
261
        return;
262
    }
263
 
264
    #
265
    #   Make the target Package Version Writable and Ensure that the doc directory
266
    #   exists. This is done via a script that is invoked with SUDO, partially to
267
    #   interwork with the existing system  
268
    #
269
    runSudoCommand('make_writable', 'dpkg_archive', $entry->{NAME},$entry->{VERSION});
270
    runSudoCommand('make_docFolder', 'dpkg_archive', $entry->{NAME},$entry->{VERSION}, 'doc');
271
 
272
    #
273
    #   Get the basic data required for the Release Note
274
    #   jats jats_get_releasenote_data.pl -pvid=1002782
275
    #
276
    $outfile = catdir($tempdir, join('_',$entry->{NAME},$entry->{VERSION})) . '.xml';
277
    $rv = localTool('jats_get_releasenote_data', '-verbose', $opt_verbose, '-pvid', $entry->{PV_ID}, '-outfile', $outfile );
278
 
279
    #
280
    #   Generate the actual release note and update the Release Manager
281
    #   jats jats_gen_releasenote.pl -releasenote=mcrdemo_1.2.3157.cr.xml -UpdateRmFiles
282
    unless ($rv)
283
    {
284
        $rv = localTool('jats_gen_releasenote.pl', '-verbose', $opt_verbose, '-UpdateRmFiles', '-releasenote', $outfile);
285
    }
286
 
287
    #
288
    #   Release note complete - or failed
289
    #       Make the target PackageVersion ReadOnly
290
    #       Signal End of Package Processing - which will trigger blat
291
    #
292
    #   Do this even if we have a Release Note Failure
293
    #
294
    runSudoCommand('make_readonly', 'dpkg_archive', $entry->{NAME},$entry->{VERSION});
295
 
296
    #    make_release_changed 
297
    #       archive=archive-path 
298
    #       pkg_name=package-name 
299
    #       pkg_version=package-version 
300
    #       rtag_id=release-tag-id 
301
    #       pkg_id=package-id 
302
    #       pv_id=package-version-id 
303
    #       proj_id=project-id 
304
    #       mode_id=change-mode-id (1 pkg added, 2 pkg removed, 3 pkg released)
305
    #
306
    push @args, 'archive=dpkg_archive';
307
    push @args, 'mode_id=3';
308
    push @args, 'pkg_name='    . $entry->{NAME};
309
    push @args, 'pkg_version=' . $entry->{VERSION};
310
    push @args, 'rtag_id='     . $entry->{RTAG_ID};
311
    push @args, 'pkg_id='      . $entry->{PKG_ID};
312
    push @args, 'pv_id='       . $entry->{PV_ID};
313
    push @args, 'proj_id='     . $entry->{PROJ_ID};
314
 
315
    runSudoCommand('make_release_changed', @args);
316
 
317
    #
318
    #   Email interested users
319
    #
320
    notifyInterestedUsers($entry);
321
 
322
    Error ("Did not generate Release Note: $entry->{NAME}, $entry->{VERSION}") if ($rv);
323
}
324
 
325
#-------------------------------------------------------------------------------
326
# Function        : localTool 
327
#
328
# Description     : Run a jats tool from the same directory as this script 
329
#
330
# Inputs          : $name           - Name of the script
331
#                   ...             - Arguments for the command
332
#
333
# Returns         : 
334
#
335
sub localTool
336
{
337
    my $cmd = shift;
338
    $cmd .= '.pl' unless ( $cmd =~ m~\.pl$~i );
339
    $cmd = catdir($scriptDir, $cmd);
340
    Error ("Command not found: $cmd") unless -f $cmd;
341
 
342
    return System ( '--NoShell', $::GBE_PERL, $cmd, @_ );
343
}
344
 
345
 
346
#-------------------------------------------------------------------------------
347
# Function        : notifyInterestedUsers  
348
#
349
# Description     : A user can register interest in a package (name) being built in a 
350
#                   specific Project 
351
#                   Perhaps this should be done by the build tool, but at the moment 
352
#                   this release note generation process is really a part of the build
353
#
354
#                   NOTE: Similar code exists in the RM web server to handle manually
355
#                         released packages.
356
#                   
357
# Inputs          : $entry          - Hash of useful infomation
358
#
359
# Returns         : 
360
#
361
sub notifyInterestedUsers
362
{
363
    my ($entry) = @_;
364
    my @userList;
365
 
366
    #
367
    #   Determine interested users
368
    #
369
    my $m_sqlstr = "SELECT U.user_email, prj.proj_name, rt.rtag_name, pkg.pkg_name, pv.pkg_version ,pv.pv_id, rt.rtag_id
370
        FROM PACKAGE_INTEREST PI, 
371
             PACKAGES PKG, 
372
             PACKAGE_VERSIONS PV, 
373
             USERS U,
374
             RELEASE_TAGS RT, 
375
             PROJECTS PRJ 
376
        WHERE PKG.PKG_ID = PI.PKG_ID 
377
          AND RT.RTAG_ID = $entry->{RTAG_ID}
378
          AND PV.PV_ID = $entry->{PV_ID}
379
          AND PV.PKG_ID = PKG.PKG_ID 
380
          AND PRJ.PROJ_ID = RT.PROJ_ID 
381
          AND PRJ.PROJ_ID = PI.PROJ_ID 
382
          AND U.USER_ID = PI.USER_ID";
383
 
384
    my @items = qw( USER_EMAIL PROJ_NAME RTAG_NAME PKG_NAME PKG_VERSION PV_ID RTAG_ID );
385
 
386
    populateArrayFromSql('notifyInterestedUsers', \@userList, $m_sqlstr, \@items);
387
 
388
    #
389
    #   Do we have something to do
390
    #
391
    return unless (@userList);
392
    #DebugDumpData("userList", \@userList);
393
 
394
    #   Ensure we have basic emailing information
395
    #
396
    getRmConfig();
397
 
398
    #
399
    #   Send Email to all the required users
400
    #   Note: This emailer requires a sendmail utility
401
    #
402
    foreach my $entry ( @userList)
403
    {
404
        #$entry->{USER_EMAIL} = 'dpurdie@vixtechnology.com';
405
        #Debug0("Sending email to David Purdie indead of real user");
406
 
407
        my $subject = "Package Release Notification: $entry->{PKG_NAME} $entry->{PKG_VERSION}";
408
        my $content = "Version <a href='http://bms:8002/ManagerSuite/Release_Manager/fixed_issues.asp?pv_id=$entry->{PV_ID}&rtag_id=$entry->{RTAG_ID}'>$entry->{PKG_VERSION}</a> of Package $entry->{PKG_NAME} in Project $entry->{PROJ_NAME} on Release Branch $entry->{RTAG_NAME} has been released.";
409
           $content .= "<p>Package Link: http://bms:8002/ManagerSuite/Release_Manager/fixed_issues.asp?pv_id=$entry->{PV_ID}&rtag_id=$entry->{RTAG_ID}";
410
           $content .= "<p>You have received this email as a result of your interest in this package. If you do not wish to receive further emails then remove your package interest from the notifications area in Release Manager.";
411
 
412
 
413
        my $req = POST( 'mailto:' . $entry->{USER_EMAIL},
414
            From         => $rmConfig{'BUILD FAILURE MAIL SENDER'},
415
            CC           => 'buildadm@vixtechnology.com',
416
            Date         => scalar localtime,
417
            Subject      => $subject,
418
            Content_Type => qq(text/html),
419
            Content      => $content,
420
        );
421
 
422
        my $response = LWP::UserAgent->new->request($req);
423
        if ($response->code != 202)
424
        {
425
            Warning("Email Send Error: $response->code");
426
            #DebugDumpData("Response", \$response);
427
        }
428
    }
429
}
430
 
431
 
432
#-------------------------------------------------------------------------------
433
# Function        : getRmConfig 
434
#
435
# Description     : Get Basic config from Release Manager
436
#                   Only do it once
437
#
438
#                   Just need:
439
#                       'BUILD FAILURE MAIL SENDER'
440
#                       'MAIL SERVER'
441
#
442
# Inputs          : None
443
#
444
# Returns         : Populates a global hash
445
#
446
sub getRmConfig
447
{
448
    return if keys(%rmConfig) > 0;
449
    my $m_sqlstr = "SELECT * from BUILD_SERVICE_CONFIG";
450
 
451
    performSqlQueryCallback('getRmConfig', 
452
                            $m_sqlstr, 
453
                            sub { 
454
                                my ($pRow) = @_;
455
                                $rmConfig{ $pRow->[0] } = $pRow->[1];
456
                                }
457
                            );
458
#DebugDumpData("rmConfig", \%rmConfig);
459
}
460
 
461
 
462
#-------------------------------------------------------------------------------
463
# Function        : runSudoCommand 
464
#
465
# Description     : Run a Unix command as root via the sodo system
466
#                   Requires that target commands be available
467
#                   Requires sudo to be configured to allow this user to run them
468
#
469
# Notes           : The sudoers file on the archive server needs to be configured to allow:
470
#                       This user to run programs from /home/releasem/sbin without a password
471
#                       The users sudo credentials must not timeout (or be used)
472
#
473
# Inputs          : prog            - Command to run
474
#                   arguments       - Command arguments
475
#
476
# Returns         : Nothing 
477
#
478
sub runSudoCommand
479
{
480
    my ($prog, @arguments) = @_;
481
    my $cmd;
482
    my $rv;
483
 
484
    #
485
    #   Construct command
486
    #
487
    $cmd = catdir($sudoUtilsDir, $prog);
488
    $rv = System('--NoShell','sudo','-n', $cmd, @arguments);
489
    Warning("SudoCmd Result: $prog: $rv") if ($rv);
490
}
491
 
492
#-------------------------------------------------------------------------------
493
# Function        : performSqlQueryCallback 
494
#
495
# Description     : Perform a general Sql query and invoke a user function for
496
#                   each row of results
497
#
498
# Inputs          : $fname                  - Name of query for error reporting
499
#                   $m_sqlstr               - Query string
500
#                   $f_process              - Function called for each row in the result
501
#                                             Use closure to have callback modify other data
502
#
503
# Returns         : Number of rows found
504
#
505
sub performSqlQueryCallback
506
{
507
    my ($fname, $m_sqlstr, $f_process ) = @_;
508
    my $found = 0;
509
 
510
    #
511
    #   Connect to the database - once
512
    #
513
    connectRM(\$RM_DB, $opt_verbose) unless $RM_DB;
514
 
515
    $m_sqlstr =~ s~\s+~ ~g;
516
    Verbose3("SQL:", $m_sqlstr);
517
    my $sth = $RM_DB->prepare($m_sqlstr);
518
    if ( defined($sth) )
519
    {
520
        if ( $sth->execute( ) )
521
        {
522
            if ( $sth->rows )
523
            {
524
                while ( my @row = $sth->fetchrow_array )
525
                {
526
                    $found++;
527
                    &$f_process(\@row);
528
                }
529
            }
530
            $sth->finish();
531
        }
532
        else
533
        {
534
            Error("$fname:Execute failure: $m_sqlstr", $sth->errstr() );
535
        }
536
    }
537
    else
538
    {
539
        Error("$fname:Prepare failure" );
540
    }
541
 
542
    unless ( $found )
543
    {
544
        Verbose("$fname:No data found");
545
    }
546
    return $found;
547
}
548
 
549
#-------------------------------------------------------------------------------
550
# Function        : populateArrayFromSql 
551
#
552
# Description     : Issue an SQL query and push the results into an array of hashes
553
#                   where each row from the query is a hash and the entire result is an 
554
#                   array 
555
#
556
# Inputs          :     name                - For error reporting
557
#                       pArray              - Ref to the output array
558
#                       sql                 - Sql to process
559
#                       pItems              - Array of tems to extract
560
#                                             Must match the SQL SELECT arguments
561
#                                             Item names starting with '-' do not end up in the
562
#                                             generated XML
563
# Returns         : 
564
#
565
sub populateArrayFromSql
566
{
567
    my ($fname, $pArray, $m_sqlstr, $pItems) = @_;
568
 
569
    performSqlQueryCallback($fname, 
570
                            $m_sqlstr, 
571
                            sub { 
572
                                my ($pRow) = @_;
573
                                my %entry;
574
                                push @{$pArray}, populateHash( \%entry, $pRow, $pItems);
575
                                }
576
                            );
577
#DebugDumpData("populateArrayFromSql", $pArray);
578
}
579
 
580
#-------------------------------------------------------------------------------
581
# Function        : populateHash 
582
#
583
# Description     : Put an array of data items into a hash
584
#
585
# Inputs          : pHash           - ref to output hash
586
#                   pRow            - Ref to the row data 
587
#                   pItems          - Ref to an hash array of entry names
588
#
589
# Returns         : pHash
590
#
591
sub populateHash
592
{
593
    my ($pHash, $pRow, $pItems) = @_;
594
 
595
    foreach my $item ( @{$pItems} ) {
596
        my $data = shift @{$pRow};
597
 
598
        if (defined $data)
599
        {
600
            $data =~ s~^\s+~~;
601
            $data =~ s~\s+$~~;
602
 
603
            #
604
            #   Store in hash
605
            #
606
            $pHash->{$item} = $data;
607
        }
608
    }
609
    return $pHash;
610
}
611
 
612
#-------------------------------------------------------------------------------
613
#   Documentation
614
#
615
 
616
=pod
617
 
618
=for htmltoc    SYSUTIL::
619
 
620
=head1 NAME
621
 
622
process_release_notes - Create Release Notes for newly created packages
623
 
624
=head1 SYNOPSIS
625
 
626
 jats process_release_notes [options]
627
 
628
 Options:
629
    -help              - Brief help message
630
    -help -help        - Detailed help message
631
    -man               - Full documentation
632
    -verbose           - Display additional progress messages
633
    -pvid=nn           - PVID of package to process(test mode)
634
    -age=nn            - Examine packages created in last n days
635
    -keeptemp          - Keep the temp workspace
636
    -status            - Display status
637
 
638
=head1 OPTIONS
639
 
640
=over 8
641
 
642
=item B<-help>
643
 
644
Print a brief help message and exits.
645
 
646
=item B<-help -help>
647
 
648
Print a detailed help message with an explanation for each option.
649
 
650
=item B<-man>
651
 
652
Prints the manual page and exits.
653
 
654
=item B<-pvid=nn>
655
 
656
This option bypasses the normal mechanism of determining packages to be processed and 
657
will process just the specified package. This is normally only used to test the operation 
658
of the subsystem.
659
 
660
=item B<-age=nn>
661
 
662
This option control the period of time period used in determing which packages to process. 
663
 
664
The number is in days. The default value is 2 days.
665
 
666
=item B<-keeptemp>
667
 
668
If this option is specified, then the temporary directory created in the processing will be 
669
retained. The user is responsible for deleting the directory.
670
 
671
This option is normally only used in testing.
672
 
673
=item B<-status>
674
 
675
When set, this option will cause the program to display the package name and version of each
676
package being processed.
677
 
678
=back
679
 
680
=head1 DESCRIPTION
681
 
682
This utility program is apart of the Package Release process. It is an interim solution.
683
 
684
The script is designed to be run as a cron jon on the dpkg_archive server.
685
 
686
It will scan the Release Manager database for packages that have been release, but do 
687
not yet have release notes. For each package it will then generate a Release Note by: 
688
 
689
=over 4
690
 
691
=item *
692
 
693
Invoke jats_get_releasenote_data to:
694
 
695
Extract relevent information from
696
 
697
=over 4
698
 
699
=item *
700
 
701
The Release Manager database
702
 
703
=item *
704
 
705
the ClearQuest database (now conatined within the Release Manager database)
706
 
707
=item *
708
 
709
the Jira Issue server 
710
 
711
=back
712
 
713
and create and XML file.
714
 
715
=item *
716
 
717
Invoke jats_gen_releasenote to:
718
 
719
=over 4
720
 
721
=item *
722
 
723
Process the the XML file created above, and package list info found within the new package. 
724
 
725
If no package informationis found then the utility will create a package list, but this is 
726
much slower than having it created by the package builder.
727
 
728
=item *
729
 
730
Create an XML file containing all the package information
731
 
732
=item *
733
 
734
Create an HTML based Release Note, from the XML file. This file could also be used to create a Release note in another format if required. 
735
 
736
=item *
737
 
738
Transfer these two files into the package in dpkg_archive
739
 
740
=item *
741
 
742
Insert the packages file list into the Release Manager database.
743
 
744
=back
745
 
746
=item *
747
 
748
Make the package read-only. This will trigger any post-install processing of the 
749
package. This is only required for packages that form a part of the build system.
750
 
751
=item *
752
 
753
Flag that the package has been released. This may tigger the BLAT package file transfer process 
754
and the package will be transferred to remote sites.
755
 
756
=item *
757
 
758
Determine the users that have registered interest in being informed when the package is released. 
759
It will then email these users.
760
 
761
=back
762
 
763
=head1 EXAMPLE
764
 
765
=head2 process_release_notes
766
 
767
This will perform a single scan of the Release Manager database and generate Release Notes as required.
768
 
769
=cut
770