Hi, Forgot to add that I've tested Stuart's diff with `pkg_add -u -n` and it worked. I didn't do real update (without -n), but I think it should work.
On Mon, Feb 03, 2020 at 10:13:25PM +0000, Stuart Henderson wrote: > My attempt at a diff is below, it works for me in tests updating from > a system with 3.6+subpackages. > > I use ${VERSION_SPEC} in the PLIST for the "same-version" conflicts > needed to override "@option no-default-conflict", those should be in all > PLISTs, and use a separate conflict entry for the ones there to handle > the update from old MODPY_DEFAULT_VERSION_3. I've also added some > commentary to the place in python.port.mk where people will look > if switching the version to save people having to figure it out again > when we move to 3.8-as-default. ... > > I'll work up an alternative diff and send out after tests. > > > > > Index: Makefile.inc > =================================================================== > RCS file: /cvs/ports/lang/python/Makefile.inc,v > retrieving revision 1.133 > diff -u -p -r1.133 Makefile.inc > --- Makefile.inc 11 Nov 2019 17:47:41 -0000 1.133 > +++ Makefile.inc 3 Feb 2020 21:56:47 -0000 > @@ -130,6 +130,8 @@ MAKE_FLAGS += LD_LIBRARY_PATH=${WRKSRC} > MAKE_FLAGS += LDFLAGS='-L${WRKSRC} -L${LOCALBASE}/lib/' > FAKE_FLAGS += RANLIB=: > > +SUBST_VARS += VERSION_SPEC > + > # Python itself is clean, but some extensions e.g. py-cryptography > # and QtWebKit require W|X mappings. > USE_WXNEEDED = Yes > Index: python.port.mk > =================================================================== > RCS file: /cvs/ports/lang/python/python.port.mk,v > retrieving revision 1.119 > diff -u -p -r1.119 python.port.mk > --- python.port.mk 19 Dec 2019 02:42:46 -0000 1.119 > +++ python.port.mk 3 Feb 2020 21:56:47 -0000 > @@ -9,6 +9,22 @@ CATEGORIES += lang/python > MODPY_DEFAULT_VERSION_2 = 2.7 > MODPY_DEFAULT_VERSION_3 = 3.7 > > +# If switching the default version: > +# - In the old default version, @comment the non-suffixed bin/XXX files > (python3, > +# pydoc3, etc) and bump REVISION > +# - In the new version, uncomment these same files > +# - In the new version, add @conflict on the old REVISION of the old version > + > +# If later *removing* an old version: > +# - *move* the numbered @conflict python-*->=3.2,<3.7 to the new version > +# and update e.g. to @conflict python-*->=3.2,<3.8 > +# - *move* the @pkgpath markers to the new version and add a new one for > +# the old version you have just retired. > + > +# In all cases: > +# - keep the @conflict python-*-${VERSION_SPEC} PLIST lines as-is, they are > +# there to override the "@option no-default-conflict". > + > .if !defined(MODPY_VERSION) > > FLAVOR ?= > Index: 3.7/Makefile > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/Makefile,v > retrieving revision 1.13 > diff -u -p -r1.13 Makefile > --- 3.7/Makefile 28 Dec 2019 18:35:39 -0000 1.13 > +++ 3.7/Makefile 3 Feb 2020 21:56:47 -0000 > @@ -10,10 +10,12 @@ PATCHLEVEL = .6 > SHARED_LIBS = python3.7m 0.0 > VERSION_SPEC = >=3.7,<3.8 > > +REVISION = 0 > + > CONFIGURE_ARGS += --with-ensurepip=no > CONFIGURE_ARGS += --enable-loadable-sqlite-extensions > > -CONFIGURE_STYLE = autoconf > +CONFIGURE_STYLE = autoconf > > PORTROACH = limit:^3\.7 > > Index: 3.7/pkg/PLIST-gdbm > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-gdbm,v > retrieving revision 1.4 > diff -u -p -r1.4 PLIST-gdbm > --- 3.7/pkg/PLIST-gdbm 11 Dec 2019 19:55:40 -0000 1.4 > +++ 3.7/pkg/PLIST-gdbm 3 Feb 2020 21:56:47 -0000 > @@ -1,7 +1,11 @@ > @comment $OpenBSD: PLIST-gdbm,v 1.4 2019/12/11 19:55:40 sthen Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-gdbm->=3.7,<3.8 > -@pkgpath lang/python3.5,-gdbm > -@pkgpath lang/python3.6,-gdbm > +@conflict python-gdbm-${VERSION_SPEC} > +@conflict python-gdbm->=3.2,<3.7 > +@pkgpath lang/python/3.2,-gdbm > +@pkgpath lang/python/3.3,-gdbm > +@pkgpath lang/python/3.4,-gdbm > +@pkgpath lang/python/3.5,-gdbm > +@pkgpath lang/python/3.6,-gdbm > @so lib/python3.7/lib-dynload/_gdbm.so > Index: 3.7/pkg/PLIST-idle > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-idle,v > retrieving revision 1.5 > diff -u -p -r1.5 PLIST-idle > --- 3.7/pkg/PLIST-idle 11 Dec 2019 19:55:40 -0000 1.5 > +++ 3.7/pkg/PLIST-idle 3 Feb 2020 21:56:47 -0000 > @@ -1,11 +1,14 @@ > @comment $OpenBSD: PLIST-idle,v 1.5 2019/12/11 19:55:40 sthen Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-idle->=3.7,<3.8 > +@conflict python-idle-${VERSION_SPEC} > +@conflict python-idle->=3.2,<3.7 > +@pkgpath lang/python/3.2,-idle > +@pkgpath lang/python/3.3,-idle > +@pkgpath lang/python/3.4,-idle > +@pkgpath lang/python/3.5,-idle > +@pkgpath lang/python/3.6,-idle > @conflict python->=3.6,<3.6.8p0 > -@conflict python-idle->=3.6,<3.6.8p2 > -@pkgpath lang/python3.5,-idle > -@pkgpath lang/python3.6,-idle > bin/idle3 > bin/idle3.7 > lib/python3.7/idlelib/ > Index: 3.7/pkg/PLIST-main > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-main,v > retrieving revision 1.9 > diff -u -p -r1.9 PLIST-main > --- 3.7/pkg/PLIST-main 28 Dec 2019 18:35:39 -0000 1.9 > +++ 3.7/pkg/PLIST-main 3 Feb 2020 21:56:47 -0000 > @@ -1,11 +1,14 @@ > @comment $OpenBSD: PLIST-main,v 1.9 2019/12/28 18:35:39 kmos Exp $ > @option no-default-conflict > @option is-branch > -@conflict python->=3.7,<3.8 > -@conflict python->=3,<3.6.8p2 > -@pkgpath lang/python3.5,-main > -@pkgpath lang/python3.6,-main > -@comment bin/2to3 > +@conflict python-${VERSION_SPEC} > +@conflict python->=3.2,<3.7 > +@pkgpath lang/python/3.2,-main > +@pkgpath lang/python/3.3,-main > +@pkgpath lang/python/3.4,-main > +@pkgpath lang/python/3.5,-main > +@pkgpath lang/python/3.6,-main > +bin/2to3 > bin/2to3-3.7 > bin/pydoc3 > bin/pydoc3.7 > Index: 3.7/pkg/PLIST-tests > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-tests,v > retrieving revision 1.5 > diff -u -p -r1.5 PLIST-tests > --- 3.7/pkg/PLIST-tests 28 Dec 2019 18:35:39 -0000 1.5 > +++ 3.7/pkg/PLIST-tests 3 Feb 2020 21:56:47 -0000 > @@ -1,10 +1,14 @@ > @comment $OpenBSD: PLIST-tests,v 1.5 2019/12/28 18:35:39 kmos Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-tests->=3.7,<3.8 > +@conflict python-tests-${VERSION_SPEC} > @conflict python->=3.6,<3.6.8p0 > -@pkgpath lang/python3.5,-tests > -@pkgpath lang/python3.6,-tests > +@conflict python-tests->=3.2,<3.7 > +@pkgpath lang/python/3.2,-tests > +@pkgpath lang/python/3.3,-tests > +@pkgpath lang/python/3.4,-tests > +@pkgpath lang/python/3.5,-tests > +@pkgpath lang/python/3.6,-tests > lib/python3.7/test/ > lib/python3.7/test/Sine-1000Hz-300ms.aif > lib/python3.7/test/__init__.py > Index: 3.7/pkg/PLIST-tkinter > =================================================================== > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-tkinter,v > retrieving revision 1.4 > diff -u -p -r1.4 PLIST-tkinter > --- 3.7/pkg/PLIST-tkinter 11 Dec 2019 19:55:40 -0000 1.4 > +++ 3.7/pkg/PLIST-tkinter 3 Feb 2020 21:56:47 -0000 > @@ -1,9 +1,13 @@ > @comment $OpenBSD: PLIST-tkinter,v 1.4 2019/12/11 19:55:40 sthen Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-tkinter->=3.7,<3.8 > -@pkgpath lang/python3.5,-tkinter > -@pkgpath lang/python3.6,-tkinter > +@conflict python-tkinter-${VERSION_SPEC} > +@conflict python-tkinter->=3.2,<3.7 > +@pkgpath lang/python/3.2,-tkinter > +@pkgpath lang/python/3.3,-tkinter > +@pkgpath lang/python/3.4,-tkinter > +@pkgpath lang/python/3.5,-tkinter > +@pkgpath lang/python/3.6,-tkinter > @so lib/python3.7/lib-dynload/_tkinter.so > lib/python3.7/tkinter/ > lib/python3.7/tkinter/__init__.py > Index: 3.8/pkg/PLIST-gdbm > =================================================================== > RCS file: /cvs/ports/lang/python/3.8/pkg/PLIST-gdbm,v > retrieving revision 1.2 > diff -u -p -r1.2 PLIST-gdbm > --- 3.8/pkg/PLIST-gdbm 11 Nov 2019 17:47:42 -0000 1.2 > +++ 3.8/pkg/PLIST-gdbm 3 Feb 2020 21:56:47 -0000 > @@ -1,5 +1,5 @@ > @comment $OpenBSD: PLIST-gdbm,v 1.2 2019/11/11 17:47:42 ajacoutot Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-gdbm->=3.8,<3.9 > +@conflict python-gdbm-${VERSION_SPEC} > @so lib/python3.8/lib-dynload/_gdbm.so > Index: 3.8/pkg/PLIST-idle > =================================================================== > RCS file: /cvs/ports/lang/python/3.8/pkg/PLIST-idle,v > retrieving revision 1.1 > diff -u -p -r1.1 PLIST-idle > --- 3.8/pkg/PLIST-idle 7 Nov 2019 16:14:09 -0000 1.1 > +++ 3.8/pkg/PLIST-idle 3 Feb 2020 21:56:47 -0000 > @@ -1,7 +1,7 @@ > @comment $OpenBSD: PLIST-idle,v 1.1 2019/11/07 16:14:09 kmos Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-idle->=3.8,<3.9 > +@conflict python-idle-${VERSION_SPEC} > @comment bin/idle3 > bin/idle3.8 > lib/python3.8/idlelib/ > Index: 3.8/pkg/PLIST-main > =================================================================== > RCS file: /cvs/ports/lang/python/3.8/pkg/PLIST-main,v > retrieving revision 1.3 > diff -u -p -r1.3 PLIST-main > --- 3.8/pkg/PLIST-main 28 Dec 2019 18:34:39 -0000 1.3 > +++ 3.8/pkg/PLIST-main 3 Feb 2020 21:56:47 -0000 > @@ -1,7 +1,7 @@ > @comment $OpenBSD: PLIST-main,v 1.3 2019/12/28 18:34:39 kmos Exp $ > @option no-default-conflict > @option is-branch > -@conflict python->=3.8,<3.9 > +@conflict python-${VERSION_SPEC} > @comment bin/2to3 > bin/2to3-3.8 > @comment bin/pydoc3 > Index: 3.8/pkg/PLIST-tests > =================================================================== > RCS file: /cvs/ports/lang/python/3.8/pkg/PLIST-tests,v > retrieving revision 1.2 > diff -u -p -r1.2 PLIST-tests > --- 3.8/pkg/PLIST-tests 28 Dec 2019 18:34:39 -0000 1.2 > +++ 3.8/pkg/PLIST-tests 3 Feb 2020 21:56:47 -0000 > @@ -1,7 +1,7 @@ > @comment $OpenBSD: PLIST-tests,v 1.2 2019/12/28 18:34:39 kmos Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-tests->=3.8,<3.9 > +@conflict python-tests-${VERSION_SPEC} > lib/python3.8/ctypes/test/ > lib/python3.8/ctypes/test/__init__.py > lib/python3.8/ctypes/test/__main__.py > Index: 3.8/pkg/PLIST-tkinter > =================================================================== > RCS file: /cvs/ports/lang/python/3.8/pkg/PLIST-tkinter,v > retrieving revision 1.2 > diff -u -p -r1.2 PLIST-tkinter > --- 3.8/pkg/PLIST-tkinter 11 Nov 2019 17:47:42 -0000 1.2 > +++ 3.8/pkg/PLIST-tkinter 3 Feb 2020 21:56:47 -0000 > @@ -1,7 +1,7 @@ > @comment $OpenBSD: PLIST-tkinter,v 1.2 2019/11/11 17:47:42 ajacoutot Exp $ > @option no-default-conflict > @option is-branch > -@conflict python-tkinter->=3.8,<3.9 > +@conflict python-tkinter-${VERSION_SPEC} > @so lib/python3.8/lib-dynload/_tkinter.so > lib/python3.8/tkinter/ > lib/python3.8/tkinter/__init__.py -- Regards, Mikolaj