|
|
|
@ -30,7 +30,6 @@ function patch_message_pm { |
|
|
|
echo 'already patched!' |
|
|
|
fi |
|
|
|
message=$(prepend_2lines_of_text_before_existing_line "$MESSAGE_PM" '$data->{sender} = $self->{sender};' '$data->{gecos} = $self->{gecos};' '$data->{subject} = $self->{decoded_subject};') |
|
|
|
echo $message |
|
|
|
if [[ $message == 'do prepend' ]]; then |
|
|
|
echo 'prepending sender and gecos in message pm' |
|
|
|
FOUND=true |
|
|
|
@ -53,9 +52,9 @@ function prepend_2lines_of_text_before_existing_line { |
|
|
|
|
|
|
|
if ! (grep "^$existing$" $file -B2 | grep -qz "$line1.*$line2.*$existing"); then |
|
|
|
echo 'do prepend' |
|
|
|
echo -e "line1=$line1" |
|
|
|
echo -e "line2=$line2" |
|
|
|
echo -e "existing=$existing" |
|
|
|
# >&2 echo "line1=$line1" |
|
|
|
# >&2 echo "line2=$line2" |
|
|
|
# >&2 echo "existing=$existing" |
|
|
|
sed -i "/^$existing$/s/^/$line1\n$line2\n/" $file |
|
|
|
else |
|
|
|
echo 'already done!' |
|
|
|
|