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 
| (most upper dependency), but I think all dependency patterns should be merged
| into one dependency pattern smartly.


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

The script is run as follow:
% awk -f libdewey.awk -f dewey.awk pmatch 'x>1' 'x-2'
% awk -f libdewey.awk -f dewey.awk reduce 'x>1' 'x>=2' 'x<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
(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,

Home | Main Index | Thread Index | Old Index