[pacman-dev] Package name and version check
Hi! I refer to this thread: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010252.html Well, I agree with Dan and Aaron, quote: "Maybe I want my packages just named pkgname.lol". However, I don't see the clear rules, where (pkgname,pkgver) comes from in case of repos. I would like make a little comment here: Packages in sync (and local) dbs are identified by their directory names, not by %NAME% and %VERSION% in desc (reason: speed-up): see line 220 in be_files.c: if(_alpm_db_splitname(ent->d_name, pkg->name, pkg->version) != 0)... So we should make sure, that directory name contains the valid %NAME% and %VERSION% (or %NAME% and %VERSION% is not needed in desc) And of course %FILENAME% should point to a package with the correct %NAME% and %VERSION% <- we may want to check the .PKGINFO content of the (downloaded) pointed file, not the filename itself. However, I'm not sure if this is needed: then we should also check %DEPENDS%, %PROVIDES% and other fields... (checkdeps might have been fooled for example) Bye
On Sat, Dec 15, 2007 at 12:45:22PM +0100, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
I refer to this thread: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010252.html
then please use the In-Reply-To mail header. thanks, - VMiklos
On Dec 15, 2007 5:45 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
Hi! I refer to this thread: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010252.html Well, I agree with Dan and Aaron, quote: "Maybe I want my packages just named pkgname.lol". However, I don't see the clear rules, where (pkgname,pkgver) comes from in case of repos. I would like make a little comment here:
Packages in sync (and local) dbs are identified by their directory names, not by %NAME% and %VERSION% in desc (reason: speed-up): see line 220 in be_files.c: if(_alpm_db_splitname(ent->d_name, pkg->name, pkg->version) != 0)... So we should make sure, that directory name contains the valid %NAME% and %VERSION% (or %NAME% and %VERSION% is not needed in desc) And of course %FILENAME% should point to a package with the correct %NAME% and %VERSION% <- we may want to check the .PKGINFO content of the (downloaded) pointed file, not the filename itself. However, I'm not sure if this is needed: then we should also check %DEPENDS%, %PROVIDES% and other fields... (checkdeps might have been fooled for example)
This is a very confusing read, so let me see if I understand what you just said: We don't need %NAME% and %VERSION% in the database 'desc' files because we can parse this from the directory name? If so, I think this falls in the realm of "premature optimization" - there's no reason to do that at all, and you're assuming the DB files will always follow the same pathing structure.
participants (3)
-
Aaron Griffin
-
Miklos Vajna
-
Nagy Gabor