fix-casts.sh

Wed, 05 Oct 2016 16:19:47 -0500

author
Mike Ruprecht <cmaiku@gmail.com>
date
Wed, 05 Oct 2016 16:19:47 -0500
branch
release-2.x.y
changeset 38091
be8d0f7d0041
parent 24975
7abe1341dc45
permissions
-rwxr-xr-x

Remove Facebook (XMPP) account option and support code

This patch removes the Facebook (XMPP) account option and any remaining
supporting code. According to https://developers.facebook.com/docs/chat
the Facebook XMPP Chat API service was ended April 30th, 2015. This code
has already been removed in Pidgin 3, and replaced with a new in-tree
version which uses a different mechanism. There is a backported version
which can be found at https://github.com/dequis/purple-facebook/wiki

This patch intentionally leaves the protocol icon, so that the
backported version mentioned above doesn't need to ship its own.

#!/bin/sh

if [ $# -eq 0 ]; then
	echo "Usage: `basename "$0"` PurpleFoo..."
	echo
	echo "This script searches the *current working directory* and replaces casts"
	echo "with GObject-style type checking and casting macros."
	echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
	exit 0
fi

for struct in $* ; do
	cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
	for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
	done
done

mercurial