tech-pkg archive

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

pkg_add and update

For updating pkgsrc packages we can do the following

1) "pkg_delete -f" all auto-removable (automatic=yes) packages (in
   "tsort | tac" order) that are not needed for any packages  installed
   by user (I mean packages to be installed here).
2) tsort packages_to_be_installed.txt |
   while read p; do
     if package_auto_removable $p; then
       pkg_add -DUA /path/to/$p.tgz
       pkg_add -DU /path/to/$p.tgz
3) pkg_admin rebuild-tree

This procedure is more or less the same in pkgnih, pkg_rr and probably pkgin.

Now lets assume that we have installed

  A-0.1 and B-0.1 where B-0.1 DEPENDS on A>=0.1.

Packages to be installed are

  A-0.2 and B-0.2 where B-0.2 DEPENDS on A>=0.2 and A-0.2 CONFLICTS with B<0.2

Installation procedure shown above will fail at "pkg_add -DU A-0.2" step
due to CONFLICTS with installed package B-0.1.  In order to avoid this
problem we need to "pkg_delete -f B" first and then install A=-0.2. As a
result we loose automatic=yes flag for package A.  Thus, we need two
additional steps in step 2: a) we need to analyse CONFLICTS before
trying to install packages b) we need to safe "automatic" and
tool-specific flags (if any) and reuse them in the future for
uninstalled packages. In my view these additional steps make update
procedure non-trivial and adds unnecessary complexity to the code
without any benefits.

Can 'pkg_add -D' be adapted for ignoring CONFLICTS field just like it
does for DEPENDS? Because this relates to not only my pkgnih but also
pkg_rr, pkg_chk, pkgin and others I believe it a common interest. As
about files causing CONFLICTS, I think pkg_add should work like the
following. While installing A-0.2 files common to A-0.2 and B-0.1 (if
any) should be assigned to A-0.2. While installing B-0.2 these common
files should not be removed from the file system ignoring the fact they
were part of B-0.1.

Best regards, Aleksey Cheusov.

Home | Main Index | Thread Index | Old Index