Combine sugar, vinegar and spices in a heavy bottomed pot. Heat gently until mixture caramelises and resembles amber brown toffee. Add the tomatoes and onions and cook on medium heat until it comes to the boil, then lower the heat. Reduce the mixture until it is thick enough to coat the back of a spoon. This takes around 1½ hours.
Let cool then bottle in sterilised containers and seal.