From e1885d17f21e35a33ec16eac291eb847a0a320cf Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 9 Apr 2000 18:39:08 +0000 Subject: [PATCH] Added ability to put new-lines in changelog entry. Added -p to locate destination directory. --- tools/genpatch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/genpatch b/tools/genpatch index a93cff99a63..539f1f40dc0 100755 --- a/tools/genpatch +++ b/tools/genpatch @@ -58,7 +58,6 @@ my %options; # command line options my @modified_files; # optional list of files that were modified my @added_files; # added files as an array my $added_file; # added file being considered -my $patches_dir; # location of the patch file my $cvs_line; # line of output from CVS my $mod_files_str; # string that describes the modified files @@ -67,19 +66,21 @@ my $mod_files_str; # string that describes the modified files $options{n} = strftime "%Y%m%d%H%M", gmtime; $gen_date = strftime "%Y/%m/%d %H:%M:%S UTC", gmtime; -unless(getopts("vn:f:c:m:a:", \%options)) +unless(getopts("vn:f:c:m:a:p:", \%options)) { print STDERR "Usage: $0 [-v] [-n patch_name] [-f patch_file] " . - "[-c change_log] [-m modified_files] [-a added_files]\n"; + "[-c change_log] [-m modified_files] [-a added_files] [-p path_to_patches]\n"; exit 1; } -$options{f} = "patches/$options{n}.diff" unless(exists $options{f}); -$patches_dir = dirname $options{f}; +$options{p} = "patches" unless(exists $options{p}); +$options{f} = "$options{p}/$options{n}.diff" unless(exists $options{f}); +$options{p} = dirname $options{f}; @added_files = split ' ', $options{a}; @modified_files = split ' ', $options{m}; +$options{c} =~ s/\\n/\n\t/g; -if(-d $patches_dir) +if(-d $options{p}) { if(-e $options{f}) { @@ -89,8 +90,8 @@ if(-d $patches_dir) } else { - mkdir $patches_dir, (0777 & ~umask) or - die "Unable to mkdir $patches_dir: $!"; + mkdir $options{p}, (0777 & ~umask) or + die "Unable to mkdir $options{p}: $!"; } $mod_files_str = exists($options{m}) ? $options{m} : "";