Bug 231332

Summary: Mk/Scripts/qa.sh: Fix flavor detection for LIB_DEPENDS
Product: Ports & Packages Reporter: David Naylor <dbn>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me CC: ports-bugs
Priority: --- Flags: koobs: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
qa.sh: use package name instead of port origin none

Description David Naylor freebsd_committer freebsd_triage 2018-09-12 17:36:58 UTC
Created attachment 197060 [details]
qa.sh: use package name instead of port origin

qa.sh uses `pkg annotate -q -S $origin flavor` to get the flavor of file's package.  However, if there are multiple flavors of a port origin installed then things brake:

# pkg info -E multimedia/phonon
phonon-qt4-4.10.1
phonon-qt5-4.10.1
# pkg annotate -q -S multimedia/phonon flavor
qt4
qt5

The attached patch ensures ensures the full package name is used, instead of the origin.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2018-09-14 12:54:16 UTC
Could you provide a port that is broken, to test this?

Or a port that can be broken to test it?
Comment 2 David Naylor freebsd_committer freebsd_triage 2018-09-14 14:09:27 UTC
If you have both versions of phonon installed then audio/soundkonverter will fail stage-qa.
Comment 3 David Naylor freebsd_committer freebsd_triage 2018-12-11 07:14:11 UTC
Any objections against committing this patch?
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-01-11 12:51:49 UTC
A commit references this bug:

Author: mat
Date: Fri Jan 11 12:50:52 UTC 2019
New revision: 489958
URL: https://svnweb.freebsd.org/changeset/ports/489958

Log:
  Fix proxydeps QA check when multiple flavor of a package are installed.

  Previously it would do this:

  $ pkg which -q -o /usr/local/lib/libphonon4qt5.so
  multimedia/phonon
  $ pkg pkg annotate -q -S multimedia/phonon flavor
  qt4
  qt5

  And that would break things in an interesting way.

  This changes makes it use the package name of the required file, which
  is unique.

  Note that this problem would probably only ever happen on a live system.
  I was not able to find a single port that would trigger this it in a
  clean environment (poudriere testport).

  PR:		231332
  Submitted by:	dbn

Changes:
  head/Mk/Scripts/qa.sh