sounds like i386 should turn into x86, and then you can insert $ARCH into the path to generate the mirror, instead of all the if/elses