[packages/python-pyopenfst] - rediff patches - fix shebangs

baggins baggins at pld-linux.org
Thu Mar 11 22:28:17 CET 2021


commit 3e045e64fb5e29766896dcdb3cdb4fec17b3c74a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Mar 11 22:27:57 2021 +0100

    - rediff patches
    - fix shebangs

 pyopenfst-python3.patch |  9 +++++----
 pyopenfst-tests.patch   |  9 +++++----
 pyopenfst-update.patch  | 32 +++++++++++++++++---------------
 python-pyopenfst.spec   |  4 ++++
 4 files changed, 31 insertions(+), 23 deletions(-)
---
diff --git a/python-pyopenfst.spec b/python-pyopenfst.spec
index db71f8b..a033331 100644
--- a/python-pyopenfst.spec
+++ b/python-pyopenfst.spec
@@ -102,10 +102,14 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
+	$RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}/*
 %endif
 %if %{with python3}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python3}\1,' \
+	$RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}/*
 %endif
 
 %clean
diff --git a/pyopenfst-python3.patch b/pyopenfst-python3.patch
index 51a6ea6..439fac5 100644
--- a/pyopenfst-python3.patch
+++ b/pyopenfst-python3.patch
@@ -1,6 +1,7 @@
---- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_iterators.i.orig	2014-10-28 21:34:59.000000000 +0100
-+++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_iterators.i	2018-03-18 08:20:45.129703020 +0100
-@@ -12,7 +12,7 @@
+diff -urNp -x '*.orig' pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_iterators.i pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_iterators.i
+--- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_iterators.i	2014-10-28 21:34:59.000000000 +0100
++++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_iterators.i	2021-03-11 22:15:33.812391229 +0100
+@@ -12,7 +12,7 @@ class IteratorProxy(object):
          "Method to be overriden which returns the iterator's value"
          return self.itor
  
@@ -9,7 +10,7 @@
          if self.first:
              self.first = False
          else:
-@@ -20,6 +20,7 @@
+@@ -20,6 +20,7 @@ class IteratorProxy(object):
          if self.itor.Done():
              raise StopIteration
          return self.get()
diff --git a/pyopenfst-tests.patch b/pyopenfst-tests.patch
index 0517ebb..587ccf7 100644
--- a/pyopenfst-tests.patch
+++ b/pyopenfst-tests.patch
@@ -1,8 +1,9 @@
---- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/test-openfst1.py.orig	2018-03-17 20:33:29.360187559 +0100
-+++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/test-openfst1.py	2018-03-17 20:33:35.736854151 +0100
-@@ -11,6 +11,7 @@
+diff -urNp -x '*.orig' pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/test-openfst1.py pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/test-openfst1.py
+--- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/test-openfst1.py	2014-10-28 21:34:59.000000000 +0100
++++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/test-openfst1.py	2021-03-11 22:15:33.739058467 +0100
+@@ -10,6 +10,7 @@ class Creation(unittest.TestCase):
+         self.assertEquals(fst.NumStates(), 1)
          nst = fst.AddState()
-         self.assertEquals(nst, 1)
          fst.AddArc(st, 42, 69, 55, nst);
 +        fst.SetStart(0) # required for fst.Properties to to SEGV
          self.assertEquals(fst.NumArcs(st), 1)
diff --git a/pyopenfst-update.patch b/pyopenfst-update.patch
index e156589..17822e0 100644
--- a/pyopenfst-update.patch
+++ b/pyopenfst-update.patch
@@ -1,17 +1,7 @@
---- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_symtab.i.orig	2014-10-28 21:34:59.000000000 +0100
-+++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_symtab.i	2018-03-12 19:10:25.371843803 +0100
-@@ -19,7 +19,7 @@
-     SymbolTable *Copy() const;
-     %feature("docstring", "Read entries from a text file.");
-     static SymbolTable* ReadText(std::string const & filename,
--                                 bool allow_negative = false);
-+                                 const SymbolTableTextOptions &opts = SymbolTableTextOptions());
-     %feature("docstring", "Write entries to a text file.");
-     bool WriteText(std::string const & filename) const;
-     %feature("docstring", "Read entries from a binary file.");
---- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_properties.i.orig	2014-10-28 21:34:59.000000000 +0100
-+++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_properties.i	2018-03-12 19:02:13.431849424 +0100
-@@ -64,7 +64,7 @@
+diff -urNp -x '*.orig' pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_properties.i pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_properties.i
+--- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_properties.i	2014-10-28 21:34:59.000000000 +0100
++++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_properties.i	2021-03-11 22:15:33.655725783 +0100
+@@ -64,7 +64,7 @@ uint64 ComplementProperties(uint64 inpro
  uint64 ComposeProperties(uint64 inprops1, uint64 inprops2);
  uint64 ConcatProperties(uint64 inprops1, uint64 inprops2,
                          bool delayed = false);
@@ -20,7 +10,7 @@
  //uint64 DifferenceProperties(uint64 inprops1, uint64 inprops2);
  uint64 FactorWeightProperties(uint64 inprops);
  //uint64 IntersectProperties(uint64 inprops1, uint64 inprops2);
-@@ -75,7 +75,7 @@
+@@ -75,7 +75,7 @@ uint64 RelabelProperties(uint64 inprops)
  //                          ssize_t root,
  //                          bool epsilon_on_replace,
  //                          bool no_empty_fst);
@@ -29,3 +19,15 @@
  uint64 ReweightProperties(uint64 inprops);
  uint64 RmEpsilonProperties(uint64 inprops, bool delayed = false);
  uint64 SynchronizeProperties(uint64 inprops);
+diff -urNp -x '*.orig' pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_symtab.i pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_symtab.i
+--- pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507.org/openfst_symtab.i	2014-10-28 21:34:59.000000000 +0100
++++ pyopenfst-eb0c0f9af57bb597f9511e1cc69cbbefe50ff507/openfst_symtab.i	2021-03-11 22:15:33.655725783 +0100
+@@ -19,7 +19,7 @@ struct SymbolTable {
+     SymbolTable *Copy() const;
+     %feature("docstring", "Read entries from a text file.");
+     static SymbolTable* ReadText(std::string const & filename,
+-                                 bool allow_negative = false);
++                                 const SymbolTableTextOptions &opts = SymbolTableTextOptions());
+     %feature("docstring", "Write entries to a text file.");
+     bool WriteText(std::string const & filename) const;
+     %feature("docstring", "Read entries from a binary file.");
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyopenfst.git/commitdiff/3e045e64fb5e29766896dcdb3cdb4fec17b3c74a



More information about the pld-cvs-commit mailing list