pkg add should reorder or dedup list of packages to install

Lawrence Stewart lstewart at freebsd.org
Wed May 27 10:36:12 UTC 2015


Hi all,

[I'm not subscribed to this list, so please CC me on replies.]

Consider the following output of a pkg-1.5.1 run:

##########

> pkg add /var/tmp/portswork/packages/All/p5-Types-Serialiser-1.0_1.txz
/var/tmp/portswork/packages/All/p5-common-sense-3.73_1.txz
/var/tmp/portswork/packages/All/perl5-5.20.2_3.txz
Installing p5-Types-Serialiser-1.0_1...
`-- Installing p5-common-sense-3.73_1...
|   `-- Installing perl5-5.20.2_3...
|   `-- Extracting perl5-5.20.2_3... done
`-- Extracting p5-common-sense-3.73_1... done
Extracting p5-Types-Serialiser-1.0_1... done
Installing p5-common-sense-3.73_1...
the most recent version of p5-common-sense-3.73_1 is already installed
Installing perl5-5.20.2_3...
the most recent version of perl5-5.20.2_3 is already installed

##########

It is rather gratuitous to attempt double installation of packages. I
would suggest that either:

- The specified list of packages to install should be updated if any in
the list are auto pulled in as dependencies of packages earlier in the
list i.e. for the above example, as a result of installing
p5-Types-Serialiser first which auto pulls in perl5 and p5-common-sense
as deps, perl5 and p5-common-sense should be removed from the specified
install list.

OR

- The specified list should be ordered prior to beginning the install
such that the packages are installed in order of interdependence and
therefore no attempts to install a package twice would be made i.e. for
the above example, perl5 being a dep of both p5- packages would be
ordered first, then p5-common-sense being a dep of p5-Types-Serialiser
would be next followed finally by p5-Types-Serialiser.

I suspect the first option might be better because it would be
programmatically easier and cheaper, but the pkg team can ponder.

Cheers,
Lawrence


More information about the freebsd-pkg mailing list