[cairo-commit] cairo/util cairo-api-update,1.3,1.4

Carl Worth commit at pdx.freedesktop.org
Fri May 6 21:59:12 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/util
In directory gabe:/tmp/cvs-serv10998/util

Modified Files:
	cairo-api-update 
Log Message:

        * util/cairo-api-update: Make idempotent substitutions that extend
        old names:

        cairo_select_font               -> cairo_select_font_face
        cairo_pattern_add_color_stop    -> cairo_pattern_add_color_stop_rgba

        by only substituting if the old name is not immediately followed
        by an underscore.

        Tweak the substitution slightly to allow the script to be run on
        the cairo source itself, (eg. avoid changing the REPLACED_BY and
        DEPRECATED_BY macros that must mention the old names).


Index: cairo-api-update
===================================================================
RCS file: /cvs/cairo/cairo/util/cairo-api-update,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-api-update	7 May 2005 04:33:22 -0000	1.3
+++ cairo-api-update	7 May 2005 04:59:10 -0000	1.4
@@ -14,7 +14,7 @@
 	backup=$file.bak
 
 	cp $file $backup
-	sed -e '
+	sed -e '/\(DEPRECATED\|REPLACED\)_BY/! {
 		s/cairo_current_font_extents/cairo_font_extents/g
 		s/cairo_get_font_extents/cairo_font_extents/g
 		s/cairo_current_operator/cairo_get_operator/g
@@ -31,7 +31,7 @@
 		s/cairo_get_status_string/cairo_status_string/g
 		s/cairo_concat_matrix/cairo_transform/g
 		s/cairo_scale_font/cairo_set_font_size/g
-		s/cairo_select_font/cairo_select_font_face/g
+		s/cairo_select_font\([^_]\)/cairo_select_font_face\1/g
 		s/cairo_transform_font/cairo_set_font_matrix/g
 		s/cairo_transform_point/cairo_user_to_device/g
 		s/cairo_transform_distance/cairo_user_to_device_distance/g
@@ -42,7 +42,7 @@
 		s/cairo_default_matrix/cairo_identity_matrix/g
 		s/cairo_matrix_set_affine/cairo_matrix_init/g
 		s/cairo_matrix_set_identity/cairo_matrix_init_identity/g
-		s/cairo_pattern_add_color_stop/cairo_pattern_add_color_stop_rgba/g
+		s/\([^_]\)cairo_pattern_add_color_stop\([^_]\)/\1cairo_pattern_add_color_stop_rgba\2/g
 		s/cairo_set_rgb_color/cairo_set_source_rgb/g
 		s/cairo_set_pattern/cairo_set_source/g
 		s/CAIRO_OPERATOR_SRC/CAIRO_OPERATOR_SOURCE/g
@@ -52,6 +52,7 @@
 		s/CAIRO_OPERATOR_OUT_REVERSE/CAIRO_OPERATOR_DEST_OUT/g
 		s/CAIRO_OPERATOR_ATOP_REVERSE/CAIRO_OPERATOR_DEST_ATOP/g
 		s/^#\([ 	]*\)ifdef[ 	]*CAIRO_HAS/#\1if CAIRO_HAS/g
+		}
 		' $backup > $file
 }
 




More information about the cairo-commit mailing list