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

On Tue, May 7, 2013 at 7:23 PM, Greg Troxel <> wrote:
> 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

I don't think this is how many pkgsrc users work.  I think cvs update
to an existing tree is the norm.

> 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

Yes, I know there are a few tools to do this sort of thing.  I am
trying to get the 80% solution/ease the one workflow I described.

> 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
> here):
>   package-install-or-replace:
> 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
> pkg_rolling-replace.
> Still, I think your proposed change is useful.

I thought pkg_add -u would be easiest because of the way we build
binary packages for each pkg.
Also make replace comes with a huge set of warnings.

Anyway, I'm probably not grokking your entire argument. (as you
mentioned can of worms earlier)

Home | Main Index | Thread Index | Old Index