Also you can build a fence with wood. Make a square around the farm, and de pigs will stay inside. ^^
Only meat is not the best way to keep food. I like use it as a B plan if townsfolk run out of food and the weath / fruit farms are empty. And use too for bone itens, if my iron / coal production is low.
Best way to keep´food in town is weath and fruit together. Since the animal spawn time is a little large. Now in 0.46 the pear trees are no longer bugged, so we can farm it.
Sry for my bad english,