Bug#936244: bsdmainutils: Python2 removal in sid/bullseye

2020-04-19 Thread peter green

Severity 936244 serious
Thanks

libhdate has now been removed from testing, so bsdmainutils can no longer be 
built in testing.



Bug#936244: bsdmainutils: Python2 removal in sid/bullseye

2019-10-24 Thread Andreas Henriksson
Control: tags -1 + patch

On Fri, Aug 30, 2019 at 07:12:19AM +, Matthias Klose wrote:
> Package: src:bsdmainutils
[...]
> Usertags: py2removal
[...]

Hello,

Please see attached patch to port to python3.

Note that this depends on the patch just posted to blocking
bug #727005 to build python3 bindings for libhdate.

Regards,
Andreas Henriksson
diff -Nru bsdmainutils-11.1.2/debian/calendarJudaic.py 
bsdmainutils-11.1.2+nmu1/debian/calendarJudaic.py
--- bsdmainutils-11.1.2/debian/calendarJudaic.py2017-12-29 
10:02:08.0 +0100
+++ bsdmainutils-11.1.2+nmu1/debian/calendarJudaic.py   2019-10-24 
21:25:02.0 +0200
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 # Filename: calendarJudaic.py
 #
 # License: no warranty close + no license (public domain)
@@ -108,7 +108,7 @@
   h.get_hebrew_year_string()
   header = Template(template_for_header).substitute(
   substitutions_for_header)
-  print header
+  print(header)
 
   h.set_gdate(1, 1, year)
   julian = h.get_julian()
@@ -127,26 +127,26 @@
 parasha['diaspora'] = h.get_parasha_string(0)
 if holyday['Israel']:
   if holyday['Israel'] == holyday['diaspora']:
-print "%02d/%02d*  %s" % (month, day, holyday['Israel'])
+print("%02d/%02d*  %s" % (month, day, holyday['Israel']))
   else:
-print "%02d/%02d*  %s (Israel only)" % \
-(month, day, holyday['Israel'])
+print("%02d/%02d*  %s (Israel only)" % \
+(month, day, holyday['Israel']))
 elif holyday['diaspora']:
-  print "%02d/%02d*%s (diaspora only)" % \
-(month, day, holyday['diaspora'])
+  print("%02d/%02d*%s (diaspora only)" % \
+(month, day, holyday['diaspora']))
 if parasha['Israel']  and  parasha['Israel'] != 'none':
   if parasha['Israel'] == parasha['diaspora']:
-print "%02d/%02d*  Parshat %s" % \
-(month, day, parasha['Israel'])
+print("%02d/%02d*  Parshat %s" % \
+(month, day, parasha['Israel']))
   else:
-print "%02d/%02d*  %s (Israel only)" % \
-(month, day, parasha['Israel'])
+print("%02d/%02d*  %s (Israel only)" % \
+(month, day, parasha['Israel']))
 elif parasha['diaspora']  and  parasha['diaspora'] != 'none':
 # See http://bugs.debian.org/583092 why 'none' is required here.
-  print "%02d/%02d*Parshat %s (diaspora only)" % \
-(month, day, parasha['diaspora'])
+  print("%02d/%02d*Parshat %s (diaspora only)" % \
+(month, day, parasha['diaspora']))
 
-  print footer
+  print(footer)
 
   sys.exit()
 
diff -Nru bsdmainutils-11.1.2/debian/changelog 
bsdmainutils-11.1.2+nmu1/debian/changelog
--- bsdmainutils-11.1.2/debian/changelog2017-12-29 10:26:58.0 
+0100
+++ bsdmainutils-11.1.2+nmu1/debian/changelog   2019-10-24 22:13:06.0 
+0200
@@ -1,3 +1,12 @@
+bsdmainutils (11.1.2+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use 2to3 to convert debian/calendarJudaic.py to python3
+  * debian/rules: invoke calendarJudaic.py using python3
+  * debian/control: switch build-deps to python3{,-hdate}.
+
+ -- Andreas Henriksson   Thu, 24 Oct 2019 22:13:06 +0200
+
 bsdmainutils (11.1.2) unstable; urgency=medium
 
   * Switch build dependency back from libtinfo to libncurses. (Closes: #885622)
diff -Nru bsdmainutils-11.1.2/debian/control 
bsdmainutils-11.1.2+nmu1/debian/control
--- bsdmainutils-11.1.2/debian/control  2017-12-29 10:25:12.0 +0100
+++ bsdmainutils-11.1.2+nmu1/debian/control 2019-10-24 22:09:02.0 
+0200
@@ -3,7 +3,7 @@
 Priority: important
 Maintainer: Debian Bsdmainutils Team 
 Uploaders: Michael Meskes 
-Build-Depends: debhelper (>= 9), libncurses-dev, quilt (>= 0.40), 
python:native, python-hdate:native, libbsd-dev
+Build-Depends: debhelper (>= 9), libncurses-dev, quilt (>= 0.40), 
python3:native, python3-hdate:native, libbsd-dev
 Standards-Version: 4.1.2
 Vcs-Git: git://anonscm.debian.org/bsdmainutils/bsdmainutils.git
 Vcs-Browser: https://anonscm.debian.org/gitweb/?p=bsdmainutils/bsdmainutils.git
diff -Nru bsdmainutils-11.1.2/debian/rules bsdmainutils-11.1.2+nmu1/debian/rules
--- bsdmainutils-11.1.2/debian/rules2017-12-29 10:02:08.0 +0100
+++ bsdmainutils-11.1.2+nmu1/debian/rules   2019-10-24 22:12:55.0 
+0200
@@ -27,7 +27,7 @@
year=`expr $$currentyear + 5`; \
while [ $${year} -ne $${currentyear} ] ; do \
year=`expr $$year - 1`; \
-   python $(CURDIR)/debian/calendarJudaic.py $$year > 
$(CURDIR)/debian/calendars/calendar.judaic.$$year; \
+   python3 $(CURDIR)/debian/calendarJudaic.py