tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: compound depends



On Tuesday, at 00:46, OBATA Akio wrote:
| With current codes, multiple ">=" dependencies will be merged into one 
dependency
| (most upper dependency), but I think all dependency patterns should be merged
| into one dependency pattern smartly.

Hi,

Just FYI, I once came up with an awk script doing the merge job. The script
contains a literal translation of pkg_install/lib/dewey.c for the 'pmatch'
action, and a new 'reduce' procedure (more generic than
flavor/pkg/reduce-depends.awk).

The script is run as follow:
% awk -f libdewey.awk -f dewey.awk pmatch 'x>1' 'x-2'
yes
% awk -f libdewey.awk -f dewey.awk reduce 'x>1' 'x>=2' 'x<3'
x>=2<3

It also (tries to) handle csh alternatives {,} as well as != or ==
dependencies, but it may have some problems in complex situations.

For anyone interested the script is available at
        wget http://homepages.laas.fr/mallet/dewey.tar.gz
(this is not a permanent location so I will eventually clean it up, though I
can move it to a better place if needed)

Best regard,
Anthony


Home | Main Index | Thread Index | Old Index