3.7.1 bump
This commit is contained in:
parent
245fc04929
commit
ca57e0a891
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
recode-3.6.tar.gz
|
||||
/recode-3.7.1.tar.gz
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- recode-3.6/lib/gettext.c.orig 2005-03-07 12:18:30.000000000 +0100
|
||||
+++ recode-3.6/lib/gettext.c 2005-03-07 12:23:14.000000000 +0100
|
||||
@@ -1668,8 +1668,6 @@
|
||||
# if !defined HAVE_GETCWD
|
||||
char *getwd ();
|
||||
# define getcwd(buf, max) getwd (buf)
|
||||
-# else
|
||||
-char *getcwd ();
|
||||
# endif
|
||||
# ifndef HAVE_STPCPY
|
||||
static char *stpcpy PARAMS ((char *dest, const char *src));
|
109
recode-3.7.1-Port-other-tests-to-Python-3.patch
Normal file
109
recode-3.7.1-Port-other-tests-to-Python-3.patch
Normal file
@ -0,0 +1,109 @@
|
||||
From 1f041f1a47cb9862bcc26dc9a2273529eb7b9e31 Mon Sep 17 00:00:00 2001
|
||||
From: perl-Git-CPAN-Patch Owner <perl-Git-CPAN-Patch-owner@fedoraproject.org>
|
||||
Date: Fri, 16 Aug 2019 12:43:18 +0200
|
||||
Subject: [PATCH] Port other tests to Python 3
|
||||
|
||||
---
|
||||
tests/pytest | 8 ++++----
|
||||
tests/t50_methods.py | 8 ++++----
|
||||
tests/t90_bigauto.py | 4 ++--
|
||||
3 files changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/tests/pytest b/tests/pytest
|
||||
index 4489592..8e39d2a 100755
|
||||
--- a/tests/pytest
|
||||
+++ b/tests/pytest
|
||||
@@ -41,7 +41,7 @@ least one such failed test, the return status of this program is non-zero.
|
||||
|
||||
__metaclass__ = type
|
||||
import inspect, os, sys, time, traceback
|
||||
-from StringIO import StringIO
|
||||
+from io import StringIO
|
||||
|
||||
# How many displayable characters in an output line.
|
||||
WIDTH = 79
|
||||
@@ -155,7 +155,7 @@ class Main:
|
||||
else:
|
||||
text = u' ' + text
|
||||
write(text + u'\n')
|
||||
- except Exit, exception:
|
||||
+ except Exit as exception:
|
||||
if not self.verbose:
|
||||
write(u'\n')
|
||||
write(u'\n* %s *\n' % str(exception))
|
||||
@@ -270,7 +270,7 @@ class Main:
|
||||
if minimum is not None:
|
||||
collection.append((minimum, name, objet, False))
|
||||
elif name.startswith(u'test_') and inspect.isfunction(objet):
|
||||
- code = objet.func_code
|
||||
+ code = objet.__code__
|
||||
collection.append((code.co_firstlineno, name, objet,
|
||||
bool(code.co_flags & 32)))
|
||||
if not collection:
|
||||
@@ -316,7 +316,7 @@ class Main:
|
||||
# FIXME: Should likely do class setup here.
|
||||
try:
|
||||
for counter, arguments in enumerate(function()):
|
||||
- collection.append((prefix + u'/' + unicode(counter + 1),
|
||||
+ collection.append((prefix + u'/' + str(counter + 1),
|
||||
arguments[0], arguments[1:]))
|
||||
except Skipped:
|
||||
return
|
||||
diff --git a/tests/t50_methods.py b/tests/t50_methods.py
|
||||
index 66da2e6..f0d5b6f 100644
|
||||
--- a/tests/t50_methods.py
|
||||
+++ b/tests/t50_methods.py
|
||||
@@ -5,7 +5,7 @@ from __main__ import py
|
||||
|
||||
import os, sys
|
||||
input_name = '%s/../COPYING' % os.path.dirname(sys.argv[0])
|
||||
-input = file(input_name, 'rb').read()
|
||||
+input = open(input_name, 'rb').read()
|
||||
|
||||
def test_1():
|
||||
|
||||
@@ -65,7 +65,7 @@ def validate(request, sequence, mode):
|
||||
command = ('$R --quiet --force --sequence=%s < %s %s'
|
||||
'| $R --quiet --force --sequence=%s %s..%s'
|
||||
% (sequence, input_name, request, sequence, after, before))
|
||||
- print command
|
||||
+ print(command)
|
||||
output = common.external_output(command)
|
||||
elif mode == 'squash':
|
||||
file(common.run.work, 'wb').write(input)
|
||||
@@ -74,8 +74,8 @@ def validate(request, sequence, mode):
|
||||
command2 = ('$R --quiet --force --sequence=%s %s..%s %s'
|
||||
% (sequence, after, before, common.run.work))
|
||||
|
||||
- print command1
|
||||
- print command2
|
||||
+ print(command1)
|
||||
+ print(command2)
|
||||
common.external_output(command1)
|
||||
common.external_output(command2)
|
||||
output = file(common.run.work, 'rb').read()
|
||||
diff --git a/tests/t90_bigauto.py b/tests/t90_bigauto.py
|
||||
index 861cce6..46d4cd4 100644
|
||||
--- a/tests/t90_bigauto.py
|
||||
+++ b/tests/t90_bigauto.py
|
||||
@@ -57,7 +57,7 @@ class Test:
|
||||
# consider as a single test, one "before" against all "after"s.
|
||||
# However, without a Recode module, we do not know how many
|
||||
# "before"s exist, and the skip count is then rather small.
|
||||
- print before
|
||||
+ print(before)
|
||||
for after in self.charsets:
|
||||
if after is not before:
|
||||
request = Recode.Request(self.outer)
|
||||
@@ -97,7 +97,7 @@ class Report:
|
||||
line = readline()
|
||||
if line:
|
||||
if len(line[:-lensep].split(':', 1)) != 2:
|
||||
- print '*', line,
|
||||
+ print('*', line)
|
||||
type, shrunk_to = line[:-lensep].split(':', 1)
|
||||
if type == 'Shrunk to':
|
||||
steps = self.get_steps(shrunk_to)
|
||||
--
|
||||
2.23.0.rc2
|
||||
|
40
recode-3.7.1-Rename-coliding-hash-functions.patch
Normal file
40
recode-3.7.1-Rename-coliding-hash-functions.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 170857800f2a84b4cdb8fefe9a698efe5509837a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Fri, 16 Aug 2019 09:29:54 +0200
|
||||
Subject: [PATCH] Rename coliding hash functions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Ported from Fedora recode patch:
|
||||
|
||||
commit 5cd1d43a39e4679ed265efcdf4bdc3da517e3de5 (tag: recode-3_6-16)
|
||||
Author: Bill Nottingham <notting@fedoraproject.org>
|
||||
Date: Fri May 27 02:52:25 2005 +0000
|
||||
|
||||
auto-import recode-3.6-16 on branch devel from recode-3.6-16.src.rpm
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
lib/hash.h | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/lib/hash.h b/lib/hash.h
|
||||
index 562f5e6..65d967e 100644
|
||||
--- a/lib/hash.h
|
||||
+++ b/lib/hash.h
|
||||
@@ -24,6 +24,11 @@
|
||||
#ifndef HASH_H_
|
||||
# define HASH_H_
|
||||
|
||||
+#define hash_lookup recode_hash_lookup
|
||||
+#define hash_delete recode_hash_delete
|
||||
+#define hash_free recode_hash_free
|
||||
+#define hash_insert recode_hash_insert
|
||||
+
|
||||
# include <stdio.h>
|
||||
# include <stdbool.h>
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
220
recode-3.7.1-python-3-compatibility.patch
Normal file
220
recode-3.7.1-python-3-compatibility.patch
Normal file
@ -0,0 +1,220 @@
|
||||
From 98a1eff200a60d81f404b2874db24a88ee2a592f Mon Sep 17 00:00:00 2001
|
||||
From: Shlomi Fish <shlomif@shlomifish.org>
|
||||
Date: Tue, 25 Jun 2019 12:23:39 +0300
|
||||
Subject: [PATCH] python 3 compatibility.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
See https://github.com/rrthomas/recode/issues/15 .
|
||||
|
||||
Petr Pisar: Ported to 3.7.1 from py3-take2 branch of
|
||||
<https://github.com/shlomif/recode>:
|
||||
|
||||
commit 04aefb26fa080c8e9d6ba7a136a8ae263727fba8
|
||||
Author: Shlomi Fish <shlomif@shlomifish.org>
|
||||
Date: Tue Jun 25 12:23:39 2019 +0300
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
tables.py | 59 +++++++++++++++++++++++++++++++++++--------------------
|
||||
1 file changed, 38 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/tables.py b/tables.py
|
||||
index 2604dfe..51752a6 100755
|
||||
--- a/tables.py
|
||||
+++ b/tables.py
|
||||
@@ -43,6 +43,16 @@ When `-F' and `-n' are used, process Alain's tables.
|
||||
|
||||
import re, sys
|
||||
|
||||
+def to_unicode(s):
|
||||
+ import six
|
||||
+ if isinstance(s, six.text_type):
|
||||
+ return s
|
||||
+ try:
|
||||
+ s = six.text_type(s, 'utf-8')
|
||||
+ except UnicodeDecodeError as err:
|
||||
+ s = six.text_type(s, 'utf-8', 'ignore')
|
||||
+ return s
|
||||
+
|
||||
# Character constants.
|
||||
REPLACEMENT_CHARACTER = 0xFFFD
|
||||
NOT_A_CHARACTER = 0xFFFF
|
||||
@@ -127,7 +137,7 @@ class Main:
|
||||
self.mnemonics = Mnemonics()
|
||||
self.mnemonics.digest_mnemonics_ds(input)
|
||||
break
|
||||
- if input.match('Network Working Group +K\. Simonsen$'):
|
||||
+ if input.match('Network Working Group +K\\. Simonsen$'):
|
||||
if (self.charnames
|
||||
and self.charnames.do_sources
|
||||
and not French_option):
|
||||
@@ -201,12 +211,15 @@ class Charnames(Options):
|
||||
|
||||
def digest_french(self, input):
|
||||
self.preset_french()
|
||||
- fold_table = range(256)
|
||||
- for before, after in map(
|
||||
- None,
|
||||
+ fold_table = list(range(256))
|
||||
+ def myord(c):
|
||||
+ if isinstance(c, int):
|
||||
+ return c
|
||||
+ return ord(c)
|
||||
+ for before, after in zip(
|
||||
u'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÂÇÈÉÊÎÏÑÔÖÛ'.encode('ISO-8859-1'),
|
||||
u'abcdefghijklmnopqrstuvwxyzàâçèéêîïñôöû'.encode('ISO-8859-1')):
|
||||
- fold_table[ord(before)] = ord(after)
|
||||
+ fold_table[myord(before)] = myord(after)
|
||||
folding = ''.join(map(chr, fold_table))
|
||||
ignorables = (
|
||||
u'<commande>'.encode('ISO-8859-1'),
|
||||
@@ -314,6 +327,8 @@ class Charnames(Options):
|
||||
if len(text) > self.max_length:
|
||||
self.max_length = len(text)
|
||||
for word in text.split():
|
||||
+ word = to_unicode(word)
|
||||
+ assert isinstance(word, str)
|
||||
self.code_map[word] = self.code_map.get(word, 0) + 1
|
||||
|
||||
def presort_word(self, word):
|
||||
@@ -334,18 +349,18 @@ class Charnames(Options):
|
||||
# the second cycling faster from 1 to 255.
|
||||
if run.verbose:
|
||||
sys.stdout.write(' sorting words...')
|
||||
- pairs = map(self.presort_word, self.code_map.keys())
|
||||
+ pairs = list(map(self.presort_word, self.code_map.keys()))
|
||||
pairs.sort()
|
||||
- words = map(lambda pair: pair[1], pairs)
|
||||
+ words = list(map(lambda pair: pair[1], pairs))
|
||||
pairs = None
|
||||
if run.verbose:
|
||||
sys.stdout.write(' %d of them\n' % len(words))
|
||||
count = len(words)
|
||||
- singles = (255 * 255 - count) / 254
|
||||
+ singles = (255 * 255 - count) // 254
|
||||
# Transmit a few values for further usage by the C code.
|
||||
if run.verbose:
|
||||
sys.stdout.write(' sorting names...')
|
||||
- ucs2_table = self.charname_map.keys()
|
||||
+ ucs2_table = list(self.charname_map.keys())
|
||||
ucs2_table.sort()
|
||||
if run.verbose:
|
||||
sys.stdout.write(' %d of them\n' % len(ucs2_table))
|
||||
@@ -366,12 +381,14 @@ class Charnames(Options):
|
||||
word = words[counter]
|
||||
write(' %-28s/* \\%0.3o */\n'
|
||||
% ('"%s",' % re.sub('"', r'\"', word), char1))
|
||||
+ assert isinstance(word, str)
|
||||
self.code_map[words[counter]] = char1
|
||||
char1 += 1
|
||||
for counter in range(singles, count):
|
||||
word = words[counter]
|
||||
write(' %-28s/* \\%0.3o\\%0.3o */\n'
|
||||
% ('"%s",' % re.sub('"', r'\"', word, 1), char1, char2))
|
||||
+ assert isinstance(word, str)
|
||||
self.code_map[words[counter]] = 256 * char1 + char2
|
||||
if char2 == 255:
|
||||
char1 += 1
|
||||
@@ -397,7 +414,7 @@ class Charnames(Options):
|
||||
if code < 256:
|
||||
write('\\%0.3o' % code)
|
||||
else:
|
||||
- write('\\%0.3o\\%0.3o' % (code / 256, code % 256))
|
||||
+ write('\\%0.3o\\%0.3o' % (code // 256, code % 256))
|
||||
else:
|
||||
sys.stdout.write('??? %s\n' % word)
|
||||
write('"},\n')
|
||||
@@ -540,7 +557,7 @@ class Mnemonics(Options):
|
||||
continue
|
||||
if len(line) == 3:
|
||||
continue
|
||||
- if input.begins(' \.\.\.'):
|
||||
+ if input.begins(' \\.\\.\\.'):
|
||||
continue
|
||||
if line == ' Presentation forms\n':
|
||||
continue
|
||||
@@ -667,7 +684,7 @@ class Mnemonics(Options):
|
||||
'static const struct entry table[TABLE_LENGTH] =\n'
|
||||
' {\n')
|
||||
count = 0
|
||||
- indices = self.mnemonic_map.keys()
|
||||
+ indices = list(self.mnemonic_map.keys())
|
||||
indices.sort()
|
||||
for ucs2 in indices:
|
||||
text = self.mnemonic_map[ucs2]
|
||||
@@ -681,7 +698,7 @@ class Mnemonics(Options):
|
||||
'static const unsigned short inverse[TABLE_LENGTH] =\n'
|
||||
' {')
|
||||
count = 0
|
||||
- keys = inverse_map.keys()
|
||||
+ keys = list(inverse_map.keys())
|
||||
keys.sort()
|
||||
for text in keys:
|
||||
if count % 10 == 0:
|
||||
@@ -744,7 +761,7 @@ class Strips(Options):
|
||||
def digest_rfc1345(self, input):
|
||||
self.init_write_data()
|
||||
# Informal canonical order of presentation.
|
||||
- CHARSET, REM, ALIAS, ESC, BITS, CODE = range(6)
|
||||
+ CHARSET, REM, ALIAS, ESC, BITS, CODE = list(range(6))
|
||||
charset = None
|
||||
skip = False
|
||||
while True:
|
||||
@@ -956,7 +973,7 @@ class Strips(Options):
|
||||
if input.search('\032'):
|
||||
# Old MS-DOS C-z !!
|
||||
break
|
||||
- match = input.match('0x([0-9A-F]+)\t0x([0-9A-F]+)\t\#')
|
||||
+ match = input.match('0x([0-9A-F]+)\t0x([0-9A-F]+)\t#')
|
||||
if match:
|
||||
self.table[int(match.group(1), 16)] = int(match.group(2), 16)
|
||||
else:
|
||||
@@ -1125,7 +1142,7 @@ class Strips(Options):
|
||||
write = Output('fr-%s' % self.TEXINFO, noheader=True).write
|
||||
else:
|
||||
write = Output(self.TEXINFO, noheader=True).write
|
||||
- charsets = self.remark_map.keys()
|
||||
+ charsets = list(self.remark_map.keys())
|
||||
charsets.sort()
|
||||
for charset in charsets:
|
||||
write('\n'
|
||||
@@ -1161,12 +1178,12 @@ class Input:
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
- self.input = file(name)
|
||||
+ self.input = open(name, "rb")
|
||||
self.line_count = 0
|
||||
sys.stdout.write("Reading %s\n" % name)
|
||||
|
||||
def readline(self):
|
||||
- self.line = self.input.readline()
|
||||
+ self.line = to_unicode(self.input.readline())
|
||||
self.line_count += 1
|
||||
return self.line
|
||||
|
||||
@@ -1184,16 +1201,16 @@ class Input:
|
||||
return self.line[:len(text)] == text
|
||||
|
||||
def match(self, pattern):
|
||||
- return re.match(pattern, self.line)
|
||||
+ return re.match(pattern, to_unicode(self.line))
|
||||
|
||||
def search(self, pattern):
|
||||
- return re.search(pattern, self.line)
|
||||
+ return re.search(pattern, to_unicode(self.line))
|
||||
|
||||
class Output:
|
||||
|
||||
def __init__(self, name, noheader=False):
|
||||
self.name = name
|
||||
- self.write = file(name, 'w').write
|
||||
+ self.write = open(name, 'w').write
|
||||
sys.stdout.write("Writing %s\n" % name)
|
||||
if not noheader:
|
||||
self.write("""\
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- recode-3.6.orig/configure.in 2001-01-03 16:50:54.000000000 +0100
|
||||
+++ recode-3.6/configure.in 2012-07-23 14:15:28.000000000 +0200
|
||||
@@ -15,7 +15,7 @@
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_ISC_POSIX
|
||||
-AM_C_PROTOTYPES
|
||||
+dnl AM_C_PROTOTYPES
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
ad_AC_PROG_FLEX
|
||||
--- recode-3.6.orig/src/Makefile.am 2000-12-06 17:36:12.000000000 +0100
|
||||
+++ recode-3.6/src/Makefile.am 2012-07-23 14:47:07.000000000 +0200
|
||||
@@ -17,7 +17,7 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
-AUTOMAKE_OPTIONS = gnits ansi2knr
|
||||
+AUTOMAKE_OPTIONS = gnits
|
||||
bin_PROGRAMS = recode
|
||||
lib_LTLIBRARIES = librecode.la
|
||||
man_MANS = recode.1
|
@ -1,11 +0,0 @@
|
||||
--- src/recodext.h.orig 2008-01-16 13:15:39.000000000 +0100
|
||||
+++ src/recodext.h 2008-01-16 13:16:47.000000000 +0100
|
||||
@@ -218,7 +218,7 @@
|
||||
enum recode_symbol_type type : 3;
|
||||
|
||||
/* Non zero if this one should be ignored. */
|
||||
- bool ignore : 2;
|
||||
+ bool ignore : 1;
|
||||
};
|
||||
|
||||
struct recode_surface_list
|
@ -1,16 +0,0 @@
|
||||
--- recode-3.6-orig/m4/flex.m4 2000-06-28 16:39:06.000000000 +0200
|
||||
+++ recode-3.6/m4/flex.m4 2010-07-07 12:23:49.000000000 +0200
|
||||
@@ -8,11 +8,8 @@
|
||||
dnl Look for flex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
|
||||
AC_DEFUN(ad_AC_PROG_FLEX,
|
||||
[AC_CHECK_PROGS(LEX, flex, missing)
|
||||
-if test "$LEX" = missing; then
|
||||
+AS_IF([test "$LEX" = missing], [
|
||||
LEX="\$(top_srcdir)/$ac_aux_dir/missing flex"
|
||||
LEX_OUTPUT_ROOT=lex.yy
|
||||
AC_SUBST(LEX_OUTPUT_ROOT)dnl
|
||||
-else
|
||||
- AC_PROG_LEX
|
||||
- AC_DECL_YYTEXT
|
||||
-fi])
|
||||
+])])
|
@ -1,12 +0,0 @@
|
||||
diff -up recode-3.6/src/names.c.printf recode-3.6/src/names.c
|
||||
--- recode-3.6/src/names.c.printf 2000-12-06 20:41:29.000000000 +0100
|
||||
+++ recode-3.6/src/names.c 2013-12-18 12:48:42.578052395 +0100
|
||||
@@ -892,7 +892,7 @@ list_concise_charset (RECODE_OUTER outer
|
||||
if (ucs2 >= 0)
|
||||
printf (format, code);
|
||||
else if (mnemonic || counter2 != 112)
|
||||
- printf (blanks);
|
||||
+ printf ("%s", blanks);
|
||||
|
||||
if (mnemonic)
|
||||
printf (counter2 == 112 ? " %s\n" : " %-3s", mnemonic);
|
@ -1,51 +0,0 @@
|
||||
diff -u -r recode-3.6.orig/src/common.h recode-3.6/src/common.h
|
||||
--- recode-3.6.orig/src/common.h 2000-06-28 20:40:15.000000000 +0200
|
||||
+++ recode-3.6/src/common.h 2017-10-03 13:52:09.904644383 +0200
|
||||
@@ -56,13 +56,14 @@
|
||||
# define RETSIGTYPE void
|
||||
#endif
|
||||
|
||||
-#if DIFF_HASH
|
||||
-# ifdef HAVE_LIMITS_H
|
||||
-# include <limits.h>
|
||||
-# endif
|
||||
-# ifndef CHAR_BIT
|
||||
-# define CHAR_BIT 8
|
||||
-# endif
|
||||
+#ifdef HAVE_LIMITS_H
|
||||
+# include <limits.h>
|
||||
+#endif
|
||||
+#ifndef CHAR_BIT
|
||||
+# define CHAR_BIT 8
|
||||
+#endif
|
||||
+#ifndef PATH_MAX
|
||||
+# define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
|
||||
diff -u -r recode-3.6.orig/src/main.c recode-3.6/src/main.c
|
||||
--- recode-3.6.orig/src/main.c 2000-12-06 20:44:59.000000000 +0100
|
||||
+++ recode-3.6/src/main.c 2017-10-03 14:32:51.274017940 +0200
|
||||
@@ -847,7 +847,7 @@
|
||||
for (; optind < argc; optind++)
|
||||
{
|
||||
const char *input_name;
|
||||
- char output_name[200]; /* FIXME: dangerous limit */
|
||||
+ char output_name[PATH_MAX];
|
||||
FILE *file;
|
||||
struct stat file_stat;
|
||||
struct utimbuf file_utime;
|
||||
@@ -871,7 +871,12 @@
|
||||
|
||||
/* FIXME: Scott Schwartz <schwartz@bio.cse.psu.edu> writes:
|
||||
"There's no reason to think that that name is unique." */
|
||||
-
|
||||
+ // To avoid overflows, the size of the array pointed by destination (output_name)
|
||||
+ // shall be long enough to contain the same C string as source
|
||||
+ // (including the terminating null character).
|
||||
+ if (strlen(input_name) >= PATH_MAX) {
|
||||
+ error (EXIT_FAILURE, 0, "input_name reach the PATH_MAX limit");
|
||||
+ }
|
||||
strcpy (output_name, input_name);
|
||||
#if DOSWIN_OR_OS2
|
||||
for (cursor = output_name + strlen (output_name);
|
68
recode.patch
68
recode.patch
@ -1,68 +0,0 @@
|
||||
--- recode-3.6.orig/src/libiconv.c
|
||||
+++ recode-3.6/src/libiconv.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Conversion of files between different charsets and surfaces.
|
||||
- Copyright © 1999, 2000 Free Software Foundation, Inc.
|
||||
+ Copyright © 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Contributed by François Pinard <pinard@iro.umontreal.ca>, 1999,
|
||||
and Bruno Haible <haible@clisp.cons.org>, 2000.
|
||||
|
||||
@@ -195,12 +195,17 @@
|
||||
memcpy() doesn't do here, because the regions might overlap.
|
||||
memmove() isn't worth it, because we rarely have to move more
|
||||
than 12 bytes. */
|
||||
- if (input > input_buffer && input_left > 0)
|
||||
+ cursor = input_buffer;
|
||||
+ if (input_left > 0)
|
||||
{
|
||||
- cursor = input_buffer;
|
||||
- do
|
||||
- *cursor++ = *input++;
|
||||
- while (--input_left > 0);
|
||||
+ if (input > input_buffer)
|
||||
+ {
|
||||
+ do
|
||||
+ *cursor++ = *input++;
|
||||
+ while (--input_left > 0);
|
||||
+ }
|
||||
+ else
|
||||
+ cursor += input_left;
|
||||
}
|
||||
}
|
||||
|
||||
--- recode-3.6.orig/src/request.c
|
||||
+++ recode-3.6/src/request.c
|
||||
@@ -1073,7 +1073,7 @@
|
||||
if (task->output.cursor + 4 >= task->output.limit)
|
||||
{
|
||||
RECODE_OUTER outer = task->request->outer;
|
||||
- size_t old_size = task->output.limit - task->output.buffer;
|
||||
+ size_t old_size = task->output.cursor - task->output.buffer;
|
||||
size_t new_size = task->output.cursor + 4 - task->output.buffer;
|
||||
|
||||
/* FIXME: Rethink about how the error should be reported. */
|
||||
--- recode-3.6.orig/src/task.c
|
||||
+++ recode-3.6/src/task.c
|
||||
@@ -1198,6 +1198,8 @@
|
||||
else
|
||||
success = transform_mere_copy (subtask);
|
||||
|
||||
+ task->output = subtask->output;
|
||||
+
|
||||
if (subtask->input.name && *subtask->input.name)
|
||||
fclose (subtask->input.file);
|
||||
if (subtask->output.name && *subtask->output.name)
|
||||
--- recode-3.6.orig/src/hash.h
|
||||
+++ recode-3.6/src/hash.h
|
||||
@@ -21,6 +21,11 @@
|
||||
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
|
||||
obstacks instead of malloc, and recompile `hash.c' with same setting. */
|
||||
|
||||
+#define hash_lookup recode_hash_lookup
|
||||
+#define hash_delete recode_hash_delete
|
||||
+#define hash_free recode_hash_free
|
||||
+#define hash_insert recode_hash_insert
|
||||
+
|
||||
#ifndef PARAMS
|
||||
# if PROTOTYPES || __STDC__
|
||||
# define PARAMS(Args) Args
|
2
recode.rpmlintrc
Normal file
2
recode.rpmlintrc
Normal file
@ -0,0 +1,2 @@
|
||||
from Config import *
|
||||
addFilter("spelling-error .* iconv");
|
173
recode.spec
173
recode.spec
@ -1,84 +1,169 @@
|
||||
Summary: Conversion between character sets and surfaces
|
||||
Name: recode
|
||||
Version: 3.6
|
||||
Release: 50%{?dist}
|
||||
License: GPLv2+
|
||||
Url: http://recode.progiciels-bpi.ca/
|
||||
Source: http://recode.progiciels-bpi.ca/archives/recode-%{version}.tar.gz
|
||||
Patch0: recode.patch
|
||||
Patch1: recode-3.6-getcwd.patch
|
||||
Patch2: recode-bool-bitfield.patch
|
||||
Patch3: recode-flex-m4.patch
|
||||
Patch4: recode-automake.patch
|
||||
Patch5: recode-format-security.patch
|
||||
Patch6: recode-longfilename.patch
|
||||
# Use valgrind in tests. Very slow. Some leaks in Python.
|
||||
%bcond_with recode_enables_valgrind_test
|
||||
# Use Python3 for tests. Not yet fully ported.
|
||||
%bcond_with recode_enables_python3_test
|
||||
|
||||
Name: recode
|
||||
Version: 3.7.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Conversion between character sets and surfaces
|
||||
# COPYING: GPLv3 text
|
||||
# COPYING-LIB: LGPLv2 text
|
||||
# doc/recode.info: OFSFDL
|
||||
# doc/recode.texi: OFSFDL
|
||||
# lib/error.h: GPLv3+
|
||||
# lib/strerror-override.c: GPLv3+
|
||||
# lib/vasnprintf.c: GPLv3+
|
||||
# src/ansellat1.l: BSD
|
||||
# src/lat1asci.c: GPLv3+
|
||||
# src/merged.c: BSD
|
||||
# src/recode.h: LGPLv3+
|
||||
# src/ucs.c: LGPLv3+
|
||||
## Not in any binary package
|
||||
# build-aux/bootstrap.in: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
|
||||
# build-aux/compile: GPLv2+ with exceptions
|
||||
# build-aux/config.guess: GPLv3+ with exceptions
|
||||
# build-aux/config.rpath: FSFULLR
|
||||
# build-aux/config.sub: GPLv3+ with exceptions
|
||||
# build-aux/depcomp: GPLv2+ with exceptions
|
||||
# build-aux/extract-trace: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
|
||||
# build-aux/funclib.sh: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
|
||||
# build-aux/inline-source: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
|
||||
# build-aux/install-sh: MIT
|
||||
# build-aux/ltmain.sh: GPLv2+ with exceptions and GPLv3+ with exceptions
|
||||
# and GPLv3+
|
||||
# build-aux/mdate-sh: GPLv2+ with exceptions
|
||||
# build-aux/missing: GPLv2+ with exceptions
|
||||
# build-aux/options-parser: MIT or GPLv3+ (bundled gnulib-modules/bootstrap)
|
||||
# build-aux/texinfo.tex: GPLv3+ with exceptions
|
||||
# config.rpath: FSFULLR
|
||||
# configure: FSFUL and GPLv2+ with exceptions
|
||||
# doc/Makefile.am: GPLv3+
|
||||
# doc/Makefile.in: FSFULLR and GPLv3+
|
||||
# doc/texinfo.tex: GPLv2+ with exceptions
|
||||
# INSTALL: FSFAP
|
||||
# ltconfig: GPLv2+ with exceptions
|
||||
# Makefile.am: GPLv3+
|
||||
# m4/gettext.m4: FSFULLR
|
||||
# m4/gnulib-cache.m4: GPLv3+ with exceptions
|
||||
# m4/libtool.m4: GPLv2+ with exceptions and FSFUL
|
||||
# m4/mbstate_t.m4: FSFULLR
|
||||
# m4/minmax.m4: FSFULLR
|
||||
# m4/ssize_t.m4: FSFULLR
|
||||
# m4/sys_stat_h.m4: FSFULLR
|
||||
# tables.py: GPLv3+
|
||||
# tests/Makefile.am: GPLv3+
|
||||
# tests/Makefile.in: FSFULLR and GPLv3+
|
||||
# tests/Recode.pyx: GPLv3+
|
||||
License: GPLv3+ and LGPLv3+ and BSD and OFSFDL
|
||||
URL: https://github.com/rrthomas/recode
|
||||
Source: %{url}/releases/download/v%{version}/recode-%{version}.tar.gz
|
||||
# Make internal hash function identifiers unique
|
||||
Patch0: recode-3.7.1-Rename-coliding-hash-functions.patch
|
||||
# 1/2 Adapt tests to Python3, unfinished,
|
||||
# <https://github.com/rrthomas/recode/issues/15>
|
||||
Patch1: recode-3.7.1-python-3-compatibility.patch
|
||||
# 2/2 Adapt tests to Python3, unfinished,
|
||||
# <https://github.com/rrthomas/recode/issues/15>
|
||||
Patch2: recode-3.7.1-Port-other-tests-to-Python-3.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext-devel
|
||||
# help2man not used
|
||||
BuildRequires: make
|
||||
BuildRequires: libtool
|
||||
BuildRequires: texinfo
|
||||
|
||||
# Tests:
|
||||
%if %{with recode_enables_python3_test}
|
||||
BuildRequires: python3-devel
|
||||
%else
|
||||
BuildRequires: python2-devel
|
||||
%endif
|
||||
%if %{with recode_enables_valgrind_test}
|
||||
# Optional tests:
|
||||
BuildRequires: valgrind
|
||||
%endif
|
||||
|
||||
%description
|
||||
The `recode' converts files between character sets and usages.
|
||||
It recognizes or produces nearly 150 different character sets
|
||||
and is able to transliterate files between almost any pair. When exact
|
||||
transliteration are not possible, it may get rid of the offending
|
||||
characters or fall back on approximations. Most RFC 1345 character sets
|
||||
are supported.
|
||||
The recode tool and library convert files between character sets and usages.
|
||||
It recognizes or produces over 200 different character sets (or about 300 if
|
||||
combined with an iconv library) and transliterates files between almost any
|
||||
pair. When exact transliteration are not possible, it gets rid of the
|
||||
offending characters or falls back on approximations.
|
||||
|
||||
%package devel
|
||||
Summary: Header files for development using recode
|
||||
Summary: Header files for development using recode library
|
||||
# Header files are LGPLv3+
|
||||
License: LGPLv3+
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
The `recode' library converts files between character sets and usages.
|
||||
The library recognizes or produces nearly 150 different character sets
|
||||
and is able to transliterate files between almost any pair. When exact
|
||||
transliteration are not possible, it may get rid of the offending
|
||||
characters or fall back on approximations. Most RFC 1345 character sets
|
||||
are supported.
|
||||
This package provides deader files for recode library.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1 -b .getcwd
|
||||
%patch2 -p0
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
rm m4/libtool.m4
|
||||
rm acinclude.m4
|
||||
%if %{with recode_enables_python3_test}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%endif
|
||||
autoreconf -fi
|
||||
|
||||
%build
|
||||
autoreconf -fiv
|
||||
%configure --disable-static
|
||||
make %{?_smp_mflags}
|
||||
%if %{with recode_enables_python3_test}
|
||||
export PYTHON=%{__python3}
|
||||
%else
|
||||
export PYTHON=%{__python2}
|
||||
%endif
|
||||
%configure \
|
||||
--without-dmalloc \
|
||||
--disable-gcc-warnings \
|
||||
--enable-largefile \
|
||||
--enable-nls \
|
||||
--disable-rpath \
|
||||
--enable-shared \
|
||||
--disable-static \
|
||||
%if %{with recode_enables_valgrind_test}
|
||||
--enable-valgrind-tests
|
||||
%else
|
||||
--disable-valgrind-tests
|
||||
%endif
|
||||
%{make_build}
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
%{make_install}
|
||||
%find_lang %{name}
|
||||
|
||||
# remove unpackaged file from the buildroot
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
rm -r $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
|
||||
# remove libtool archives
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
rm $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
|
||||
%files -f %{name}.lang
|
||||
%doc AUTHORS COPYING* ChangeLog NEWS README THANKS TODO
|
||||
%license COPYING COPYING-LIB
|
||||
# Changelog is not helpful
|
||||
%doc AUTHORS NEWS README THANKS TODO
|
||||
%{_mandir}/*/*
|
||||
%{_infodir}/recode.info*
|
||||
%{_bindir}/*
|
||||
%{_libdir}/*.so.0*
|
||||
%{_libdir}/librecode.so.0
|
||||
%{_libdir}/librecode.so.0.*
|
||||
|
||||
%files devel
|
||||
%{_libdir}/*.so
|
||||
%{_includedir}/*
|
||||
|
||||
%changelog
|
||||
* Fri Aug 16 2019 Petr Pisar <ppisar@redhat.com> - 3.7.1-1
|
||||
- 3.7.1 bump (bug #1379055)
|
||||
- License changed to GPLv3+ and LGPLv3+ and BSD and OFSFDL
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-50
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user