From owner-freebsd-python@freebsd.org  Sun Jun 19 07:41:13 2016
Return-Path: <owner-freebsd-python@freebsd.org>
Delivered-To: freebsd-python@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BBF7A7A264
 for <freebsd-python@mailman.ysv.freebsd.org>;
 Sun, 19 Jun 2016 07:41:13 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org
 [IPv6:2001:1900:2254:206a::50:5])
 by mx1.freebsd.org (Postfix) with ESMTP id E7A4D2EF4
 for <freebsd-python@freebsd.org>; Sun, 19 Jun 2016 07:41:12 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: by mailman.ysv.freebsd.org (Postfix)
 id E371BA7A263; Sun, 19 Jun 2016 07:41:12 +0000 (UTC)
Delivered-To: python@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31D9A7A262
 for <python@mailman.ysv.freebsd.org>; Sun, 19 Jun 2016 07:41:12 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org (kenobi.freebsd.org
 [IPv6:2001:1900:2254:206a::16:76])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BAAAD2EEF
 for <python@FreeBSD.org>; Sun, 19 Jun 2016 07:41:12 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from bugs.freebsd.org ([127.0.1.118])
 by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u5J7fCw6006784
 for <python@FreeBSD.org>; Sun, 19 Jun 2016 07:41:12 GMT
 (envelope-from bugzilla-noreply@freebsd.org)
From: bugzilla-noreply@freebsd.org
To: python@FreeBSD.org
Subject: [Bug 209551] Python bits ignore DEFAULT_VERSIONS
Date: Sun, 19 Jun 2016 07:41:12 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Ports & Packages
X-Bugzilla-Component: Ports Framework
X-Bugzilla-Version: Latest
X-Bugzilla-Keywords: patch
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: iblis@hs.ntnu.edu.tw
X-Bugzilla-Status: Open
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: python@FreeBSD.org
X-Bugzilla-Flags: 
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-209551-21822-0eHvCgKpSw@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209551-21822@https.bugs.freebsd.org/bugzilla/>
References: <bug-209551-21822@https.bugs.freebsd.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-BeenThere: freebsd-python@freebsd.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-python>, 
 <mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python/>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-python>,
 <mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 19 Jun 2016 07:41:13 -0000

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209551

--- Comment #4 from Iblis Lin <iblis@hs.ntnu.edu.tw> ---
Created attachment 171564
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D171564&action=
=3Dedit
propose patch: keep PYTHON_VERSION

The PYTHON_VERSION will be handy for install non-conclict python package
(e.g. py27-sqlite3 + py34-sqlite3). Please consider to keep it!

I make a patch following the rule in comment #1

Here describe the testing flow for this patch:

1. prepare a new jail

2. check the current priority of `${LOCALBASE}/bin/python`

   $ pkg install python  # should create a symlink `/usr/local/bin/python`
   $ cd /usr/ports/databases/py-sqlite3
   $ make -V PYTHON_VERSION DEFAULT_VERSIONS=3Dpython=3D3.5
   python2.7  # the symlink win now

3. apply this patch

4. check that DEFAULT_VERSIONS got higher priority

   $ cd /usr/ports/databases/py-sqlite3
   $ make -V PYTHON_VERSION
   python2.7
   $ make -V PYTHON_VERSION DEFAULT_VERSIONS=3Dpython=3D3.5
   python3.5

5. one more check for priority of symlink `/usr/local/bin/python`
   $ pkg delete python
   $ pkg install python3  # we will get python3.4 installed
   $ cd /usr/local/bin
   $ ln -s python3 python
   $ ls -l python
   lrwxr-xr-x  1 root  wheel  7 Jun 19 14:16 python@ -> python3

   $ cd /usr/ports/databases/py-sqlite3
   $ make -V PYTHON_VERSION DEFAULT_VERSIONS=3Dpython=3D3.5
   python3.5
   $ make -V PYTHON_VERSION
   python3.4  # ya! symlink auto-detect correct!

--=20
You are receiving this mail because:
You are the assignee for the bug.=