On Fri, Oct 12, 2012 at 11:23:49AM -0700, Jeremy Evans wrote:
> Currently, when pkg_add -u is run, if it encounters an update candidate
> with the same package name, but a different pkgpath, it silent discards
> the candidate.  This makes it more difficult to track down the cause.
> 
> The most common way this happens is if a package is moved in the tree,
> and someone forgets to add the @pkgpath marker to the PLIST.  You have
> an old version installed that uses the old pkgpath, and when you run
> pkg_add -u, it doesn't update and doesn't tell you why, even in the more
> verbose modes.
> 
> This makes pkg_add -uvv print a message saying why the update candidate
> was skipped, with both package names and all pkgpaths for both packages.
> 
> For example, if I copy the databases/ruby-sequel port to
> databases/ruby-sequel-new, update the version, and then try to update
> it:
> 
> $ pkg_add -uvv ruby-sequel
> Update candidates: quirks-1.75 -> quirks-1.75 (ok)
> parsing quirks-1.75
> No change in quirks-1.75
> Skipping ruby-sequel-4.29.0 due to differing pkgpath:
> databases/ruby-sequel-new,ruby18|databases/ruby-sequel-new|databases/ruby-sequel-foo
> vs. databases/ruby-sequel,ruby18|databases/ruby-sequel for
> ruby-sequel-3.37.0p0
> Update candidates: ruby-sequel-3.37.0p0 -> ruby-sequel-3.37.0p0 (ok)
> No change in ruby-sequel-3.37.0p0
> 
> I don't really like the current output, but unless we want to split the
> message into multiple lines, I can't think of anything better.
> 
> Thoughts?
> 
> Jeremy
> 
Well, for starters, I don't see anything that makes your code obey -v...
and printing that all the time isn't very acceptable.

Second, I would probably keep the location around and only display 
something if no update candidate is found with the right path is found...

I think that your usage is slightly bogus... if you're finding "the same"
package, it means that you didn't move away your old packages in the
repository you're using. And you are not supposed to do that. If you let
old packages accumulate, then you have a lot of pending problems.

With the logic you currently have, pkg_add -u will chatter about
postfix/stable and editors/vim,no_x11 where it's not supposed to...

Reply via email to