Subversion Repositories DevTools

Rev

Rev 4618 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4618 Rev 4619
Line 8... Line 8...
8
#
8
#
9
# Description   : Generate the package Release Note
9
# Description   : Generate the package Release Note
10
#                 Requires
10
#                 Requires
11
#                   1) Release Note data generated by jats_get_releasenote_data.pl
11
#                   1) Release Note data generated by jats_get_releasenote_data.pl
12
#                   2) Target package in dpkg_archive
12
#                   2) Target package in dpkg_archive
13
#                   3) One or more built.files.xxx.xml
13
#                   3) One or more built.files.xxx.xml (optional, but desirable)
14
#
14
#
15
#                 Will:
15
#                 Will:
16
#                   Merge built.files..xml files into the release note data
16
#                   Merge built.files.xxx.xml files into the release note data
17
#                   Insert build meta data
17
#                   Insert build meta data
18
#                   Save the Release Note MetaData within the package
18
#                   Save the Release Note MetaData within the package
19
#                   Generate the HTML release note - save within the package
19
#                   Generate the HTML release note - save within the package
-
 
20
#                   Insert Release_Contents into RM Database
20
#
21
#
21
# Usage:        See POD
22
# Usage:        See POD
22
#
23
#
23
#......................................................................#
24
#......................................................................#
24
 
25
 
Line 55... Line 56...
55
my $opt_pname;
56
my $opt_pname;
56
my $opt_pversion;
57
my $opt_pversion;
57
my $opt_release_note;
58
my $opt_release_note;
58
my $opt_pvid;
59
my $opt_pvid;
59
my $opt_outname;
60
my $opt_outname;
-
 
61
my $opt_outputXml;
60
my $opt_updateRmFiles;
62
my $opt_updateRmFiles;
61
my $opt_workingDir;
63
my $opt_workingDir;
62
 
64
 
63
#   Global vars
65
#   Global vars
64
our $GBE_HOSTNAME;
66
our $GBE_HOSTNAME;
Line 131... Line 133...
131
        $opt_workingDir = FullPath($opt_workingDir);
133
        $opt_workingDir = FullPath($opt_workingDir);
132
        Error("Working directory is not a directory") unless -d $opt_workingDir;
134
        Error("Working directory is not a directory") unless -d $opt_workingDir;
133
        Error("Working directory is writable") unless -w $opt_workingDir;
135
        Error("Working directory is writable") unless -w $opt_workingDir;
134
    }
136
    }
135
    
137
    
136
 
-
 
137
    #
138
    #
138
    #   Determine the target archive
139
    #   Determine the target archive
139
    #   The default archive is GBE_DPKG, but this may be changed
140
    #   The default archive is GBE_DPKG, but this may be changed
140
    #
141
    #
141
    $opt_archive = 'main' unless ( $opt_archive );
142
    $opt_archive = 'main' unless ( $opt_archive );
Line 162... Line 163...
162
    #   Needs to mimic $DPKG_ROOT
163
    #   Needs to mimic $DPKG_ROOT
163
    $OUT_ROOT = defined($opt_workingDir) ? $opt_workingDir : $DPKG_ROOT; 
164
    $OUT_ROOT = defined($opt_workingDir) ? $opt_workingDir : $DPKG_ROOT; 
164
    Verbose2 ("Output Path: $OUT_ROOT" );
165
    Verbose2 ("Output Path: $OUT_ROOT" );
165
 
166
 
166
    #
167
    #
-
 
168
    #   Calculate output filenames
-
 
169
    #   Html Release Note:
-
 
170
    #       RELEASE_NOTES_PVID_PKGNAME_CLEANV.html
-
 
171
    #
-
 
172
    $DPKG_DOC = catdir($OUT_ROOT, 'doc');
-
 
173
    $opt_outputXml = catdir($DPKG_DOC, 'release_note.xml');
-
 
174
 
-
 
175
    my $cleanv = $opt_pversion;
-
 
176
    $cleanv =~ s~\.~_~g;
-
 
177
    $opt_outname = join('_',
-
 
178
                        'RELEASE_NOTES',
-
 
179
                        $opt_pvid,
-
 
180
                        $opt_pname,
-
 
181
                        $cleanv,    
-
 
182
                        ) . '.html';
-
 
183
    Verbose("Note Name: $opt_outname");
-
 
184
 
-
 
185
    #
167
    #   Locate the release note data file
186
    #   Locate the release note data file
168
    #   This was created as a prerequisite to the build
187
    #   This was created as a prerequisite to the build
169
    #   Note: windows requires '/' in the file list
188
    #   Note: windows requires '/' in the file list
170
    #
189
    #
171
    my @filesList;
190
    my @filesList;
Line 173... Line 192...
173
        $item =~ s~\\~/~g;
192
        $item =~ s~\\~/~g;
174
        push @filesList, $item;
193
        push @filesList, $item;
175
    }
194
    }
176
    unless (scalar @filesList > 0)
195
    unless (scalar @filesList > 0)
177
    {
196
    {
-
 
197
        Warning("No file list found within the package");
178
        #
198
        #
179
        #   No filelist found in the package
199
        #   No filelist found in the package
180
        #   This may occur for packages that did not go though the build system
200
        #   This may occur for packages that did not go though the build system
181
        #   Create a package-list
201
        #   Create a package-list
182
        #
202
        #
183
        my $item = generateFileList();
203
        my $item = generateFileList();
184
        $item =~ s~\\~/~g;
204
        $item =~ s~\\~/~g;
185
        push @filesList, $item;
205
        push @filesList, $item;
186
    }
206
    }
187
    Error("No file list found within the package") unless (scalar @filesList > 0);
-
 
188
 
207
 
189
    #
208
    #
190
    #   Generate the name of the release note
-
 
191
    #       RELEASE_NOTES_PVID_PKGNAME_CLEANV.html
-
 
192
    #
-
 
193
    my $cleanv = $opt_pversion;
-
 
194
    $cleanv =~ s~\.~_~g;
-
 
195
    $opt_outname = join('_',
-
 
196
                        'RELEASE_NOTES',
-
 
197
                        $opt_pvid,
-
 
198
                        $opt_pname,
-
 
199
                        $cleanv,    
-
 
200
                        ) . '.html';
-
 
201
    Verbose("Note Name: $opt_outname");
-
 
202
    
-
 
203
    #
-
 
204
    #   Create output directory within the package
209
    #   Create output directory within the package
205
    #
210
    #
206
    $DPKG_DOC = catdir($OUT_ROOT, 'doc');
-
 
207
    mkpath($DPKG_DOC, 0, 0775);
211
    mkpath($DPKG_DOC, 0, 0775);
208
 
212
 
209
    #
213
    #
210
    #   Merge the Release Note and the various file lists into a single
214
    #   Merge the Release Note and the various file lists into a single
211
    #   XML file. Keep the file local
215
    #   XML file. Keep the file local
Line 230... Line 234...
230
            );
234
            );
231
 
235
 
232
    #
236
    #
233
    #   Transfer the XML database directly into the package
237
    #   Transfer the XML database directly into the package
234
    #
238
    #
235
    unless( File::Copy::copy('built.files.releasenote.xml', catdir($DPKG_DOC, 'release_note.xml')) )
239
    unless( File::Copy::copy('built.files.releasenote.xml', $opt_outputXml) )
236
    {
240
    {
237
        Error("Cannot transfer XML release note", $!);
241
        Error("Cannot transfer XML release note", $!, $opt_outputXml);
-
 
242
    }
-
 
243
 
-
 
244
    #
-
 
245
    #   Delete the built.files.xxx.xml that may be present in the root of the package
-
 
246
    #   These are no longer needed - they have been incorporated into the release_note.xml file
-
 
247
    #
-
 
248
    foreach my $item ( glob(catdir($DPKG_ROOT, 'built.files.*.xml'))) {
-
 
249
        unlink $item;
238
    }
250
    }
239
 
251
 
240
    #
252
    #
241
    #   Update the Release Manager entry - File Data
253
    #   Update the Release Manager entry - File Data
242
    #
254
    #
Line 466... Line 478...
466
 
478
 
467
    $updateRmFilesData = ""; 
479
    $updateRmFilesData = ""; 
468
    foreach my $entry (@{$xml->{files}{file}})
480
    foreach my $entry (@{$xml->{files}{file}})
469
    {
481
    {
470
        #
482
        #
-
 
483
        #   Ignore 'merge' entries
-
 
484
        #
-
 
485
        next if ((exists $entry->{type}) && ($entry->{type} eq 'merge'));
-
 
486
        #
471
        #   Clean up the data
487
        #   Clean up the data
472
        #
488
        #
473
        my $fname = $entry->{name} || '';
489
        my $fname = $entry->{name} || '';
474
        my $fpath  = $entry->{path} || '';
490
        my $fpath  = $entry->{path} || '';
475
        my $fsize  = $entry->{size} || 0;
491
        my $fsize  = $entry->{size} || 0;
Line 676... Line 692...
676
 
692
 
677
=item B<-UpdateRmFiles>
693
=item B<-UpdateRmFiles>
678
 
694
 
679
This option will case the utility to ppdate the Files list in Release Manager.
695
This option will case the utility to ppdate the Files list in Release Manager.
680
 
696
 
681
The existinf file list will be replaced by the one within the package.
697
The existing file list will be replaced by the one within the package.
682
 
698
 
683
Note: Write Access to Release Manager is required.
699
Note: Write Access to Release Manager is required.
684
 
700
 
685
=back
701
=back
686
 
702
 
Line 693... Line 709...
693
an HTML based release note.
709
an HTML based release note.
694
 
710
 
695
 
711
 
696
=head1 EXAMPLE
712
=head1 EXAMPLE
697
 
713
 
698
=head2 jats get_releasenote_data -pvid=983058 -outfile=tmpdata.xml
714
=head2 jats jats_gen_releasenote -releasenote=/tmp/myreleasenote.xml
699
 
715
 
700
This will locate a package-version with an id of 983058, extrat required information and create
716
This will process release note data in the specified XML file.
701
an XML file called tmpdata.xml.
-
 
702
 
717
 
703
=cut
718
=cut