On Sun, 8 Oct 2006 06:21:27 -0500 "Aaron Griffin" <aaronmgriffin@gmail.com> wrote:
On 10/8/06, Jason Chu <jason@archlinux.org> wrote:
Instead of checking for /etc/arch-release or /etc/frugalware-release, why not make it an autoconf option? --with-arch-in-filename or something...
That would work too, but I would feel more comfortable with the on-the-fly parsing. I mean, if we decide we want to have the arch name in the file name at a later date, this would allow us to make changes a few packages at a time without breaking things in the least.
I wouldn't feel more comfortable with it. If I had a case where I didn't have an /etc/arch-release or /etc/frugalware-release (I accidently deleted it or I was using pacman.static to make a chroot for a different distro), it's not going to work reliably.
Trying to guess if the architecture is included in the filename isn't possible reliably. foo-bar-2.4-1 is ambiguous and a pretty common case.
The arch is added at the end in this patch, after the pkgrel, so there is no ambiguity foo-bar-2.4-1-i686 foo-bar-2.4-1-x86_64 etc etc
So we know what valid arch strings are? Currently we parse packages based on the number of dashes. The string after the last dash is the pkgrel and the string after the penultimate dash but before the last dash is the version. In a case where you have a package foo-bar-2.4-1, is the package name foo-bar, the version 2.4, and the pkgrel 1 OR is the package name foo, the version bar, the pkgrel 2.4, and the arch 1? In your example, is that foo-bar-2.4, version 1, release i686? Or foo-bar, version 2.4, release 1, arch i686? Does that mean pkgrel's can never be in the list of arches? It also means we have to update all these scripts as new arches come out. It's not just pacman that has this sort of assumption (ie. the gensync db doesn't store a filename associated with a package, the filename is just $pkgname-$pkgver-$pkgrel.pkg.tar.gz), it's all the supporting scripts too. The ones that create packages aren't that bad (makepkg), but ones that have to take pkgname, pkgver, and pkgrel and create a filename are more trouble (gensync, pacman, pacbuild). Jason