wrong arch in ppa2pup_gawk when run as 32bit chroot system in a 64bit host
The following code
arch='i386' case $(uname -m) in i*86) arch='i386' ;; *64) arch='amd64' ;; esac
gives the wrong arch when running pkg in a 32bit chroot system with a 64bit host. It might also be an issue if a 32bit OS is booted with a 64bit kernal. WIth such a setup one can run 64bit sytems in a virtual machine, while running a 32 bit os.
The arch variable should come from /etc/DISTRO_SPECS.
uname -a can be used as a fallback if DISTRO_SPECS either doesn't exist or doesn't have the arch parameter set.