mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
New upstream version.
committer: mfx <mfx> 983109842 +0000
This commit is contained in:
parent
4a142f35f5
commit
48a520708b
|
@ -8,8 +8,8 @@ exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*-
|
||||||
### ###
|
### ###
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
## $Revision: 2.37 $
|
## $Revision: 2.38 $
|
||||||
## $Date: 2000/12/28 23:19:48 $
|
## $Date: 2001/02/12 19:54:35 $
|
||||||
## $Author: kfogel $
|
## $Author: kfogel $
|
||||||
##
|
##
|
||||||
## (C) 1999 Karl Fogel <kfogel@red-bean.com>, under the GNU GPL.
|
## (C) 1999 Karl Fogel <kfogel@red-bean.com>, under the GNU GPL.
|
||||||
|
@ -78,7 +78,7 @@ use File::Basename;
|
||||||
my $Log_Source_Command = "cvs log";
|
my $Log_Source_Command = "cvs log";
|
||||||
|
|
||||||
# In case we have to print it out:
|
# In case we have to print it out:
|
||||||
my $VERSION = '$Revision: 2.37 $';
|
my $VERSION = '$Revision: 2.38 $';
|
||||||
$VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/;
|
$VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/;
|
||||||
|
|
||||||
## Vars set by options:
|
## Vars set by options:
|
||||||
|
@ -98,6 +98,10 @@ my $Distributed = 0;
|
||||||
# What file should we generate (defaults to "ChangeLog")?
|
# What file should we generate (defaults to "ChangeLog")?
|
||||||
my $Log_File_Name = "ChangeLog";
|
my $Log_File_Name = "ChangeLog";
|
||||||
|
|
||||||
|
# Grab most recent entry date from existing ChangeLog file, just add
|
||||||
|
# to that ChangeLog.
|
||||||
|
my $Cumulative = 0;
|
||||||
|
|
||||||
# Expand usernames to email addresses based on a map file?
|
# Expand usernames to email addresses based on a map file?
|
||||||
my $User_Map_File = "";
|
my $User_Map_File = "";
|
||||||
|
|
||||||
|
@ -196,6 +200,33 @@ my $logmsg_separator = "----------------------------";
|
||||||
|
|
||||||
### Everything below is subroutine definitions. ###
|
### Everything below is subroutine definitions. ###
|
||||||
|
|
||||||
|
# If accumulating, grab the boundary date from pre-existing ChangeLog.
|
||||||
|
sub maybe_grab_accumulation_date ()
|
||||||
|
{
|
||||||
|
if (! $Cumulative) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
|
open (LOG, "$Log_File_Name")
|
||||||
|
or die ("trouble opening $Log_File_Name for reading ($!)");
|
||||||
|
|
||||||
|
my $boundary_date;
|
||||||
|
while (<LOG>)
|
||||||
|
{
|
||||||
|
if (/^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/)
|
||||||
|
{
|
||||||
|
$boundary_date = "$1";
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close (LOG);
|
||||||
|
return $boundary_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Fills up a ChangeLog structure in the current directory.
|
# Fills up a ChangeLog structure in the current directory.
|
||||||
sub derive_change_log ()
|
sub derive_change_log ()
|
||||||
{
|
{
|
||||||
|
@ -210,6 +241,12 @@ sub derive_change_log ()
|
||||||
my $msg_txt;
|
my $msg_txt;
|
||||||
my $detected_file_separator;
|
my $detected_file_separator;
|
||||||
|
|
||||||
|
# Might be adding to an existing ChangeLog
|
||||||
|
my $accumulation_date = &maybe_grab_accumulation_date ();
|
||||||
|
if ($accumulation_date) {
|
||||||
|
$Log_Source_Command .= " -d\'>${accumulation_date}\'";
|
||||||
|
}
|
||||||
|
|
||||||
# We might be expanding usernames
|
# We might be expanding usernames
|
||||||
my %usermap;
|
my %usermap;
|
||||||
|
|
||||||
|
@ -805,6 +842,41 @@ sub derive_change_log ()
|
||||||
|
|
||||||
if (! $Output_To_Stdout)
|
if (! $Output_To_Stdout)
|
||||||
{
|
{
|
||||||
|
# If accumulating, append old data to new before renaming. But
|
||||||
|
# don't append the most recent entry, since it's already in the
|
||||||
|
# new log due to CVS's idiosyncratic interpretation of "log -d".
|
||||||
|
if ($Cumulative && -f $logfile_here)
|
||||||
|
{
|
||||||
|
open (NEW_LOG, ">>$tmpfile")
|
||||||
|
or die "trouble appending to $tmpfile ($!)";
|
||||||
|
|
||||||
|
open (OLD_LOG, "<$logfile_here")
|
||||||
|
or die "trouble reading from $logfile_here ($!)";
|
||||||
|
|
||||||
|
my $started_first_entry = 0;
|
||||||
|
my $passed_first_entry = 0;
|
||||||
|
while (<OLD_LOG>)
|
||||||
|
{
|
||||||
|
if (! $passed_first_entry)
|
||||||
|
{
|
||||||
|
if ((! $started_first_entry)
|
||||||
|
&& /^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/) {
|
||||||
|
$started_first_entry = 1;
|
||||||
|
}
|
||||||
|
elsif (/^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/) {
|
||||||
|
$passed_first_entry = 1;
|
||||||
|
print NEW_LOG $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print NEW_LOG $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close (NEW_LOG);
|
||||||
|
close (OLD_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
if (-f $logfile_here) {
|
if (-f $logfile_here) {
|
||||||
rename ($logfile_here, $logfile_bak);
|
rename ($logfile_here, $logfile_bak);
|
||||||
}
|
}
|
||||||
|
@ -1453,6 +1525,9 @@ sub parse_options ()
|
||||||
my $narg = shift (@ARGV) || die "$arg needs argument.\n";
|
my $narg = shift (@ARGV) || die "$arg needs argument.\n";
|
||||||
$output_file = $narg;
|
$output_file = $narg;
|
||||||
}
|
}
|
||||||
|
elsif ($arg =~ /^--accum$/) {
|
||||||
|
$Cumulative = 1;
|
||||||
|
}
|
||||||
elsif ($arg =~ /^--fsf$/) {
|
elsif ($arg =~ /^--fsf$/) {
|
||||||
$FSF_Style = 1;
|
$FSF_Style = 1;
|
||||||
}
|
}
|
||||||
|
@ -1547,6 +1622,11 @@ sub parse_options ()
|
||||||
$exit_with_admonishment = 1;
|
$exit_with_admonishment = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($XML_Output && $Cumulative) {
|
||||||
|
print STDERR "cannot pass both --xml and --accum\n";
|
||||||
|
$exit_with_admonishment = 1;
|
||||||
|
}
|
||||||
|
|
||||||
# Or if any other error message has already been printed out, we
|
# Or if any other error message has already been printed out, we
|
||||||
# just leave now:
|
# just leave now:
|
||||||
if ($exit_with_admonishment) {
|
if ($exit_with_admonishment) {
|
||||||
|
@ -1564,10 +1644,7 @@ sub parse_options ()
|
||||||
|
|
||||||
## Else no problems, so proceed.
|
## Else no problems, so proceed.
|
||||||
|
|
||||||
if ($Output_To_Stdout) {
|
if ($output_file) {
|
||||||
undef $Log_File_Name; # not actually necessary
|
|
||||||
}
|
|
||||||
elsif ($output_file) {
|
|
||||||
$Log_File_Name = $output_file;
|
$Log_File_Name = $output_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1667,6 +1744,7 @@ Options/Arguments:
|
||||||
-S, --separate-header Blank line between each header and log message
|
-S, --separate-header Blank line between each header and log message
|
||||||
--no-wrap Don't auto-wrap log message (recommend -S also)
|
--no-wrap Don't auto-wrap log message (recommend -S also)
|
||||||
--gmt, --utc Show times in GMT/UTC instead of local time
|
--gmt, --utc Show times in GMT/UTC instead of local time
|
||||||
|
--accum Add to an existing ChangeLog (incompat w/ --xml)
|
||||||
-w, --day-of-week Show day of week
|
-w, --day-of-week Show day of week
|
||||||
--header FILE Get ChangeLog header from FILE ("-" means stdin)
|
--header FILE Get ChangeLog header from FILE ("-" means stdin)
|
||||||
--xml Output XML instead of ChangeLog format
|
--xml Output XML instead of ChangeLog format
|
||||||
|
|
Loading…
Reference in New Issue
Block a user