[pacman-dev] [arch] Plans for switching to new package naming format (name-ver-rel -> name-ver-rel-arch)
Andrew Fyfe
andrew at neptune-one.net
Wed Jun 13 20:13:53 EDT 2007
Dan McGee wrote:
> On 6/13/07, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
>> On 6/13/07, Johan Grahn <johan at cgeek.net> wrote:
>>> On Wed, 2007-06-13 at 22:43 +0100, Andrew Fyfe wrote:
>>>> Are there any plans (if so when) to switch the official repositories
>>>> over to the new package naming format?
>>>>
>>>> Current/Old: name-ver-rel.pkg.tar.gz
>>>> New: name-ver-rel-arch.pkg.tar.gz
>>> Why do you wanna do this? I'm just curios...
>>>
>>> Is it not better to just have separate repos because they are compiled
>>> differently and better to maintain.
>>>
>>> I'm not saying that is it a bad idea, I just wanna know how you think
>> No body "wants" to do it - it's already done, and part of pacman 3.0.
>> The rationalization is simple: the majority of the time you don't
>> touch real package files... it's pacman -S, done. There is really
>> nothing lost from adding the suffix - what is gained is clarity in
>> looking at the filename.
>>
>> To respond to Andrew: there actually is no real "plan" at the
>> moment... but we want to make sure pacman2 users have sufficient time
>> to make the switch before we kill their packages.
>
> This drifts into something that should be on the pacman ML, so I'm
> moving it there. Is there any reason for pacman to enforce a naming
> convention at all when it comes to the packages? We should do any
> information gathering from the .PKGINFO file in the package itself
> rather than the name, shouldn't we?
>
> I also might be way off here- maybe pacman doesn't care. If so, let me
> know- I haven't dug into the code yet on this issue.
>
> -Dan
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev at archlinux.org
> http://archlinux.org/mailman/listinfo/pacman-dev
This isn't so much a problem for pacman, but it's a problem for the
support scripts. There are two methods to get a package name,
1) from .PKGINFO
+ guaranteed to get the correct name
- can be very slow with big packages or when parsing a lot of packages.
This takes 4 seconds....
tar -xOf kernel26-2.6.21.5-1.pkg.tar.gz .PKGINFO | \
grep '^pkgname = ' | sed 's/^pkgname = //'
2) from the file name
+ fast
- can be difficult to get the correct package name. Because pkgname
can contain - it's difficult to parse the file name because we have two
different naming schemes. Unless you hard code a check for {i686,x86_64}
there's no easy way (without reading .PKGINFO) to check if you've got
the right name.
This takes 0.02 seconds...
echo kernel26-2.6.21.5-1.pkg.tar.gz | \
sed 's/.pkg.tar.gz$//;s/-[^-]*-[^-]*$//'
or for new format...
echo kernel26-2.6.21.5-1-i686.pkg.tar.gz | \
sed 's/.pkg.tar.gz$//;s/-[^-]*-[^-]*-[^-]*$//'
Andrew
More information about the pacman-dev
mailing list