You are not logged in.

#1 2006-10-30 08:03:17

Pajaro
Member
Registered: 2004-04-21
Posts: 884

pacman variable definitions

I develop pajman. a boosted bash based package manager.

What I found is that it would be easier to understand and implement pacman alternatives if variable names where in a concrete file to be able to check them.

Pacman should have a file in which we have all the variables that sit in configuration or information files (/etc/pacman.conf, /var/lib/pacman/local/*/depends, etc).

Right now if we look for %DEPENDS% we get that it is inlined in the code:

[root@patito src]# busca %DEPENDS%
gensync
129:            echo "%DEPENDS%" >>depends
updatesync
132:            echo "%DEPENDS%" >>depends
convertdb.c
102:            fputs("%DEPENDS%nn", fp);
db.c
450:                    if(!strcmp(line, "%DEPENDS%")) {
581:            fputs("%DEPENDS%n", fp);
[root@patito src]#

if there was a file with all variables, pajman would be able to check if there is something new to keep in mind and tell me.
I could check if the vesion of pacman changed and then using cvs download this new version of the variable definitions.
This file could also implement a clear explanation of what is what every variable means and what it does. This way I could also check if the explanation changed and know that i have to update pajman, because the few things that it does may not work anymore.

i suggest having something like:

definitions.c
23: VARNAME_DEPENDS="%DEPENDS%";
24: // DEPENDS CONTAINS A LIST OF PACKAGES THAT ARE NEEDED FOR THIS PACKAGE TO RUN
25: // ASSOCIATED TO EACH PACKAGE YOU CAN FIND REQUIRED VERSION INFORMATION (ex: kdelibs>=3.2.3)

I post this in the forum first to see other opinions about it.

Offline

#2 2006-10-30 15:53:16

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman variable definitions

you can probably easilly parse it the "pacman way" - a line that matches %*% is the "heading", then you read until an empty line is found.

Offline

#3 2006-10-30 16:46:48

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: pacman variable definitions

fputs("%DEPENDS%n", fp);
%*% = %DEPENDS%

read until end of line:
n", fp);

what's the point of that?

what i want to do is to be able to know when pacman has new/modified features.

Offline

Board footer

Powered by FluxBB