You are not logged in.

#1 2009-01-18 14:49:45

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Version Numbering of Packages - Need Info

I don't know any way inbuilt in pacman which works like pacman -Sc but does not remove non-installed packages.

Since I learnt C++ over the last two years as a light subject, I decided to make a program to do that.

It was quite easy to get a list of files in the /var/cache/pacman/pkg directory. They all contain in the begening an alphanumeric name which may include a "-" character. They all end with .pkg.tar.gz extention. Between the two is the version number.

Is the version numbering of all packages in archlinux repositories common ? If so, HOW IS IT DONE ?

PS: This is going to be a GPL 3.0 senior secondary high school C++ project tongue

Offline

#2 2009-01-18 15:17:52

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Version Numbering of Packages - Need Info

MetalheadGautham wrote:

Is the version numbering of all packages in archlinux repositories common ? If so, HOW IS IT DONE ?

Awesome wiki, we has it!

Offline

#3 2009-01-18 15:32:49

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

^^Yeah, but I need someone to interpret in simpler words for me. Didn't quite understand it. sad

Offline

#4 2009-01-18 15:50:24

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Version Numbering of Packages - Need Info

MetalheadGautham wrote:

I don't know any way inbuilt in pacman which works like pacman -Sc but does not remove non-installed packages.

The only thing -Sc does is removing non-installed packages. So your sentence does not make much sense smile

Btw, there is a second behavior possible for -Sc, see man pacman.

CleanMethod = KeepInstalled | KeepCurrent
           If set to KeepInstalled (the default), the -Sc operation will clean
           packages that are no longer installed (not present in the local
           database). If set to KeepCurrent, -Sc will clean outdated packages
           (not present in any sync database). The second behavior is useful
           when the package cache is shared among multiple machines, where the
           local databases are usually different, but the sync databases in
           use could be the same.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#5 2009-01-18 15:58:50

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Version Numbering of Packages - Need Info

MetalheadGautham wrote:

^^Yeah, but I need someone to interpret in simpler words for me. Didn't quite understand it. sad

Here's how I understand it:

Package filenames share this pattern: A-B-C.pkg.tar.gz

where:

A = name: lowercase letters, numbers and hyphens (-).
B = version: numbers, periods (.) and, if necessary, letters.
C = release: same restrictions as version, usually just a number starting from 1 and increasing with each package revision (caution: this is specific to Arch and doesn't relate to the package's version in any way).

Last edited by foutrelis (2009-01-18 15:59:27)

Offline

#6 2009-01-18 16:30:01

EVRAMP
Member
From: Czech Republic
Registered: 2008-10-03
Posts: 173
Website

Re: Version Numbering of Packages - Need Info

Thank you shining, something i was looking for.
Pacman roulette is great!
Arch is no longer a boring distro.

CleanMethod = KeepCurrent also isn't bad big_smile.

Last edited by EVRAMP (2009-01-18 16:38:33)

Offline

#7 2009-01-19 10:11:30

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

hmm... well, as far as Sc is concerned, it ALSO REMOVES LATEST BUT NON INSTALLED PACKAGES. I like to download and keep packages which I have not installed, and I like to keep them at their respective latest versions. The reason is because the cache will be shared b/w multiple machines and not all would have all the software installed.

Anyway, @foutrelis:

Where are the various package data stored by pacman ? Is there a folder with files which contain info about the latest versions of various packages and their version number ?

If so, all I need to do is to read files there one by one, extract info about ALL the latest packages, and put 'em in a temporary file, "temp.lst", and compare the contents of the file with contents of cache.lst obtained by

System("ls -a > cache.lst")

and then delete any line in cache.lst if it also appears in temp.lst, so that cache.lst is now left with files which already have newer versions, and its contents can be deleted one by one.

Also, whats the biggest file name of any package I may encounter ? Would a 200 words capacity character array do ?

Offline

#8 2009-01-19 10:29:56

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Version Numbering of Packages - Need Info

Already a few scripts do what you are trying to ...but most of them are in bash or python... But they will give you the basic idea about where the files,dbs etc are...
And have a look at Cleanmethod option in pacman.conf. wink

Edit: Too late... I should read the whole thread smile

Last edited by u_no_hu (2009-01-19 10:38:15)


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#9 2009-01-19 10:44:34

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Version Numbering of Packages - Need Info

MetalheadGautham wrote:

hmm... well, as far as Sc is concerned, it ALSO REMOVES LATEST BUT NON INSTALLED PACKAGES.

Go back and read the comment by Shining...

Offline

#10 2009-01-19 11:05:32

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

Thanks. Didn't see it clearly.

But I still want to know where pacman keeps info about packages like version number.

There is still plenty of things I can do with the information, and that includes an AptOnCD clone for ArchLinux (again, this appears easy enough to do in a single day)

Offline

#11 2009-01-19 11:09:14

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Version Numbering of Packages - Need Info

Look in /var/lib/pacman/sync/

Offline

#12 2009-01-19 12:33:02

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

Thanks.

But there are situations which are exceptional. For example, KDE4 is not considered a newer version of KDE3 as far as individual packages are concerned. People want BOTH. Does pacman have a built-in procedure to resolve this issue ?

Offline

#13 2009-01-19 12:34:15

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Version Numbering of Packages - Need Info

not really...  kde4 packages are name like "kdelibs" while kde3 packages are named "kdelibs3".

Offline

#14 2009-01-19 13:10:32

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

Was it a renaming or was it the original naming ?
Because I had KDEmod 3.5.9 installed ages ago and made a backup a few months back.

Offline

#15 2009-01-19 13:12:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Version Numbering of Packages - Need Info

That was a renaming.

Offline

#16 2009-01-19 13:38:39

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

Hmmm... thats too bad. Can't we have something like kde3libs and kde4libs instead ? It feels more future proof. I already like arch's naming of the kernel as kernel26. Others either continue adding kernel after kernel to system and boot menu (ubuntu and debian) or change kernel after each upgrade, which would be unwise in the future event of release of kernel 2.8.x.y series.

Anyway, next question:

One text file takes much less time to get processed than a huge bundle of text files. Why does archlinux use that many text files for its work ?

IMO, Multiple files makes it easier to use for HUMANS, but harder for MACHINES. But I don't think many people do package management manually. Why can't we have something rc.conf style ?

PS: hmm... all I had to do IF [pacman -Sc KeepCurrent] did not exist, was to get a list of files in indivudual repositories in pacman's sync folder and take second line in desc. The arrangement DOES seem simple for humans...

Offline

#17 2009-01-19 20:01:52

Xiong Chiamiov
Member
From: central coast, california
Registered: 2008-06-18
Posts: 142
Website

Re: Version Numbering of Packages - Need Info

MetalheadGautham wrote:

Hmmm... thats too bad. Can't we have something like kde3libs and kde4libs instead ? It feels more future proof.

Arch is a rolling release, meant to be updated regularly.  So, when the devs decide KDE4 is stable and move it into [extra], all you have to do is upgrade your system, and it replaces kde3 with kde4.  We still have kde3 packages because they are some things that need them, but if you install kde, it should be kde4, and so the packages are named appropriately.

Offline

#18 2009-01-21 23:55:26

MetalheadGautham
Member
From: Bangalore, India
Registered: 2008-07-27
Posts: 143
Website

Re: Version Numbering of Packages - Need Info

^^Yeah I know that. But KDE3 to KDE4 is not like Gnome 2.18 to Gnome 2.22 is it ?
Its completely different and the only similarity is the name.

Ofcourse I and most others use KDE4, but what about those *select few* ?

Offline

Board footer

Powered by FluxBB