pacman provides a `checkupdates` script, see /usr/bin/checkupdates for how it works.
Wow, I didn't know this one, thanks !