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.


On 2020/02/03 21:09, Stuart Henderson wrote:
> On 2020/02/03 20:55, Mikolaj Kucharski wrote:
> > Hi,
> > 
> > I've noticed recently that I still have python3.6 on my RPi and I think
> > pkgpaths in python3.7 are not exactly correct. With inlined diff test
> > upgrade works for me.
> 
> yes, I have been looking at this also (I noticed because it breaks
> pkg_add -u if you go to -current from a version before the switch to
> py3.7 as default, after I upgraded quite a few machines recently).
> funnily enough I just started a test build when I read your mail.
> 
> > # env \
> >     TRUSTED_PKG_PATH=/home/ports/packages/%a/all/ \
> >     PKG_PATH=https://cdn.openbsd.org/pub/OpenBSD/%c/packages/%a/ \
> >     pkg_add -n -u
> > quirks-3.216 signed on 2020-01-04T15:56:06Z
> > py3-setuptools-41.6.0v0:python-3.6.9+python-3.7.6->python-3.7.6p0: ok
> > # echo $?
> > 0
> > 
> > I've looked a bit at history of Pythons in ports tree and I also
> > tested version of the diff with something a long the lines of:
> > 
> > +@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
> >  @pkgpath lang/python3.5,-gdbm
> >  @pkgpath lang/python3.6,-gdbm
> > +@pkgpath lang/python3/3.2,-gdbm
> > +@pkgpath lang/python3/3.3,-gdbm
> > +@pkgpath lang/python3/3.4,-gdbm
> > +@pkgpath lang/python3/3.5,-gdbm
> > +@pkgpath lang/python3/3.6,-gdbm
> > +@pkgpath lang/python3/3.7,-gdbm
> > 
> > for every Python subpackage, but I'm not sure is it practically
> > necessary to go that long in time for an upgrade path. Comments
> > welcome.
> > 
> > 
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/ports/lang/python/3.7/Makefile,v
> > retrieving revision 1.13
> > diff -u -p -u -r1.13 Makefile
> > --- Makefile        28 Dec 2019 18:35:39 -0000      1.13
> > +++ Makefile        3 Feb 2020 20:45:02 -0000
> > @@ -9,6 +9,7 @@ VERSION =           3.7
> >  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
> > Index: pkg/PLIST-gdbm
> > ===================================================================
> > RCS file: /cvs/ports/lang/python/3.7/pkg/PLIST-gdbm,v
> > retrieving revision 1.4
> > diff -u -p -u -r1.4 PLIST-gdbm
> > --- pkg/PLIST-gdbm  11 Dec 2019 19:55:40 -0000      1.4
> > +++ pkg/PLIST-gdbm  3 Feb 2020 20:45:02 -0000
> > @@ -1,7 +1,9 @@
> >  @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
> > +@conflict python-gdbm->=3,<3.8
> 
> this should be split in two ("conflict with 'this' version of python" which
> should be present for all subpkgs, and "conflict with old versions to provide
> an upgrade path").
> 
> >  @pkgpath lang/python3.5,-gdbm
> >  @pkgpath lang/python3.6,-gdbm
> 
> ha, these two @pkgpath are totally bogus and are repeated in a bunch of
> subpackages. they should be removed rather than just adding the fixed ones.
> 
> > +@pkgpath lang/python/3.5,-gdbm
> > +@pkgpath lang/python/3.6,-gdbm
> >  @so lib/python3.7/lib-dynload/_gdbm.so
> 
> 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

Reply via email to