+sub read_author_info($) {
+ my ($file) = @_;
+ my $user;
+ open my $f, '<', "$file" or die("Failed to open $file: $!\n");
+
+ while (<$f>) {
+ chomp;
+ # Expected format is this;
+ # exon=Andreas Ericsson <ae@op5.se>
+ if (m/^([^ \t=]*)[ \t=]*([^<]*)(<.*$)\s*/) {
+ $user = $1;
+ $conv_author_name{$1} = $2;
+ $conv_author_email{$1} = $3;
+ # strip trailing whitespace from author name
+ $conv_author_name{$1} =~ s/\s*$//;
+ }
+ }
+ close ($f);
+}
+
+sub write_author_info($) {
+ my ($file) = @_;
+ open my $f, '>', $file or
+ die("Failed to open $file for writing: $!");
+
+ foreach (keys %conv_author_name) {
+ print $f "$_=" . $conv_author_name{$_} .
+ " " . $conv_author_email{$_} . "\n";
+ }
+ close ($f);
+}
+
+getopts("hivmkuo:d:p:C:z:s:M:P:A:") or usage();