[gmime: 8/21] Added porting script from 2.6 to 3.0
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 8/21] Added porting script from 2.6 to 3.0
- Date: Sun, 26 Mar 2017 19:41:19 +0000 (UTC)
commit 8caf550d531d81de998226e1ac0195bacfd741f5
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Wed Mar 22 10:10:46 2017 -0400
Added porting script from 2.6 to 3.0
PORTING | 5 +++--
tools/Makefile.am | 2 +-
tools/gmime-port-2-6-to-3-0.sh | 32 ++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/PORTING b/PORTING
index 1800364..af6d1d4 100644
--- a/PORTING
+++ b/PORTING
@@ -78,8 +78,9 @@ Porting from GMime 2.6 to GMime 3.0
- g_mime_stream_write_to_stream(), g_mime_stream_writev(), and g_mime_stream_printf()
now return a gint64.
-- Renamed GMimeCertificateTrust to GMimeTrust and GMIME_CERTIFICATE_TRUST_NONE
- to GMIME_TRUST_UNKNOWN.
+- Renamed GMimeCertificateTrust to GMimeTrust. GMIME_CERTIFICATE_TRUST_NONE
+ has been renamed to GMIME_TRUST_UNKNOWN and GMIME_CERTIFICATE_TRUST_FULLY has been
+ renamed to GMIME_TRUST_FULL.
- Removed g_mime_gpg_context_[get,set]_always_trust(). This can now be accomplished
by passing GMIME_ENCRYPT_ALWAYS_TRUST to g_mime_crypto_context_encrypt().
diff --git a/tools/Makefile.am b/tools/Makefile.am
index b88d638..942acdf 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -2,4 +2,4 @@
SUBDIRS = .
-EXTRA_DIST = gmime-port-2-2-to-2-4.sh gmime-port-2-4-to-2-6.sh
+EXTRA_DIST = gmime-port-2-2-to-2-4.sh gmime-port-2-4-to-2-6.sh gmime-port-2-6-to-3-0.sh
diff --git a/tools/gmime-port-2-6-to-3-0.sh b/tools/gmime-port-2-6-to-3-0.sh
new file mode 100755
index 0000000..47a0974
--- /dev/null
+++ b/tools/gmime-port-2-6-to-3-0.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+for src in `find . -name "*.[c,h]"`
+do
+ echo "Auto-porting '$src' from GMime-2.6 to GMime-3.0..."
+ sed -e "s/g_mime_message_get_sender/g_mime_messaget_get_from/g" \
+ -e "s/GMIME_RECIPIENT_TYPE_/GMIME_ADDRESS_TYPE_/g" \
+ -e "s/g_mime_message_get_recipients/g_mime_message_get_addresses/g" \
+ -e "s/g_mime_message_add_recipient/g_mime_message_add_mailbox/g" \
+ -e "s/g_mime_param_new_from_string/g_mime_param_list_parse/g" \
+ -e "s/g_mime_content_type_new_from_string/g_mime_content_type_parse/g" \
+ -e "s/g_mime_content_type_to_string/g_mime_content_type_get_mime_type/g" \
+ -e "s/g_mime_content_type_get_params/g_mime_content_type_get_parameters/g" \
+ -e "s/g_mime_content_disposition_new_from_string/g_mime_content_disposition_parse/g" \
+ -e "s/g_mime_content_disposition_to_string/g_mime_content_disposition_encode/g/" \
+ -e "s/g_mime_content_disposition_get_params/g_mime_content_disposition_get_parameters/g/" \
+ -e "s/internet_address_list_parse_string/internet_address_list_parse/g" \
+ -e "s/GMimeCertificateTrust/GMimeTrust/g" \
+ -e "s/GMIME_CERTIIFCATE_TRUST_NONE/GMIME_TRUST_UNKNOWN/g" \
+ -e "s/GMIME_CERTIFICATE_TRUST_FULLY/GMIME_TRUST_FULL/g" \
+ -e "s/GMIME_CERTIFICATE_TRUST_/GMIME_TRUST_/g" \
+ -e "s/g_mime_stream_file_new_for_path/g_mime_stream_file_open/g" \
+ -e "s/g_mime_stream_fs_new_for_path/g_mime_stream_fs_open/g" \
+ -e "s/g_mime_part_set_content_object/g_mime_part_set_content/g" \
+ -e "s/g_mime_part_get_content_object/g_mime_part_get_content/g" \
+ -e "s/g_mime_parser_set_scan_from/g_mime_parser_set_format/g" \
+ -e "s/g_mime_parser_get_scan_from/g_mime_parser_get_format/g" \
+ -e "s/g_mime_parser_get_from/g_mime_parser_get_mbox_marker/g" \
+ -e "s/g_mime_parser_get_from_offset/g_mime_parser_get_mbox_marker_offset/g" \
+ < "$src" > "$src.tmp"
+ mv "$src.tmp" "$src"
+done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]