diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-09-02 09:42:07 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-09-02 09:42:07 (EDT) |
commit | 1746366bcab3c6f02c556943f3f41e6d85c7717f (patch) | |
tree | 1abbdf59a36fc215d1d8e27915a3aba8aa90046b | |
parent | 26f289de759b9057f19fc09b7faebfe985e400ed (diff) |
scripts/announce-release.sh: Generalize sed code
-rwxr-xr-x | scripts/announce-release.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/announce-release.sh b/scripts/announce-release.sh index d013337..a718cc6 100755 --- a/scripts/announce-release.sh +++ b/scripts/announce-release.sh @@ -5,9 +5,24 @@ version="${2}" package_name="${3}" srcdir="${0%/scripts/announce-release.sh}" -about="$(sed -n '4,${ /^Copyright/q; p; }' "${srcdir}/README")" -news="$(sed -n '6,${ /^ProteanOS Development Kit/q; /^Copyright/q; p; }' \ - "${srcdir}/NEWS")" +about="$(sed -n ' + H; + ${ + g; + s/^\n*[^\n][^\n]*\n[=-][=-]*\n\n*//; + s/\n*[^\n][^\n]*\n[=-][=-]*\n.*$//; + p; + }; + ' "${srcdir}/README")" +news="$(sed -n ' + H; + ${ + g; + s/^\n*[^\n][^\n]*\n[=-][=-]*\n\n*//; + s/\n*[^\n][^\n]*\n[=-][=-]*\n.*$//; + p; + }; + ' "${srcdir}/NEWS")" /usr/sbin/sendmail \ -f pj+proteanos-ml@pehjota.net proteanos-dev@lists.proteanos.com <<-EOF |