tech-pkg archive

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

Re: add PKG_INSTALL_TRY_UPGRADE -- please review

matthew sporleder <> writes:

> I am getting pretty sick of the following workflow:
> cd /usr/src/pkgsrc; cvs update
> cd devel/tig
> make install clean
> ... (an hour later)
> pkg_add: A different version of foo-dependency-1.0.1 is already
> installed: foo-dependency-1.0.0
> pkg_add: 1 package addition failed
> *** Error code 1
> ...
> (grumble) pkg_add -u /usr/src/packages/All/foo-depdendency-1.0.1
> make install
> repeat...

This is a can of worms, but pkgsrc basically wants to have

  a consistent checkout (which you are doing)

  all packages up to date/built from that checkout  

So, I see two possible approaches:

  After you do the cvs update, then use pkg_rolling-replace.  It will do
  'make replace' in the right order (mostly), and this will mostly work.

  something along the lines of what you are doing

As for your specific approach, I think it has a bug, because when a
package is installed, either there is a version, or there isn't.  So
what I'd suggest is to add a target (NB I am assuming a DESTDIR world


that says

  if the package is installed, do make replace
  if the package  is not installed, do make package-install

and then you can set DEPENDS_TARGET to package-install-or-replace.

Alternatively a PKG_INSTALL_USE_REPLACE variable.

Note that make replace is basically pkg_add -u.  However, make replace
also uses -U, to avoid exact-version dependency checks that will fail.

Also, once you do a make replace, there will be dirty
("unsafe_depends=YES") packages.  To fix this those should also be "make
replace"d.  But once you do that, and add ordering, you've reinvented

Still, I think your proposed change is useful.

Attachment: pgpLbLwwVsktl.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index