[pacman-dev] Package name and version check

Aaron Griffin aaronmgriffin at gmail.com
Mon Dec 17 00:53:53 EST 2007

On Dec 15, 2007 5:45 AM, Nagy Gabor <ngaba at 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.

More information about the pacman-dev mailing list