From 210f134125db22e75327e76c9edd3a766e55004c Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 21 Nov 2021 15:57:51 +0900 Subject: [PATCH] 1.12.3 enable test --- .gitignore | 1 + ...viewer-utils-fix-logic-on-big-endian.patch | 102 ++++++++++++++++++ gnome-commander.spec | 25 ++++- sources | 2 +- 4 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 0001-unicode2utf8-viewer-utils-fix-logic-on-big-endian.patch diff --git a/.gitignore b/.gitignore index 2e34d75..dff499e 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ gnome-commander-1.2.8.7.tar.bz2 /gnome-commander-1.12.0.tar.xz /gnome-commander-1.12.1.tar.xz /gnome-commander-1.12.2.tar.xz +/gnome-commander-1.12.3.tar.xz diff --git a/0001-unicode2utf8-viewer-utils-fix-logic-on-big-endian.patch b/0001-unicode2utf8-viewer-utils-fix-logic-on-big-endian.patch new file mode 100644 index 0000000..f9e52d8 --- /dev/null +++ b/0001-unicode2utf8-viewer-utils-fix-logic-on-big-endian.patch @@ -0,0 +1,102 @@ +From dcaaf89d44ddb463e8be22583080f454fc61d2d9 Mon Sep 17 00:00:00 2001 +From: gnome-commander Fedora maintainer + +Date: Sun, 21 Nov 2021 11:21:29 +0900 +Subject: [PATCH] unicode2utf8(viewer-utils): fix logic on big endian + +--- + src/intviewer/inputmodes.cc | 2 +- + src/intviewer/viewer-utils.cc | 24 ++++++++++++------------ + src/intviewer/viewer-utils.h | 2 +- + 3 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/src/intviewer/inputmodes.cc b/src/intviewer/inputmodes.cc +index 269777e7..7a4d1b5f 100644 +--- a/src/intviewer/inputmodes.cc ++++ b/src/intviewer/inputmodes.cc +@@ -223,7 +223,7 @@ static void inputmode_ascii_activate(GVInputModesData *imd, const gchar *encodin + { + // these are defined in 'cp437.c' + unsigned int unicode = ascii_cp437_to_unicode[i]; +- unicode2utf8(unicode, (unsigned char*)&imd->ascii_charset_translation[i]); ++ unicode2utf8(unicode, &imd->ascii_charset_translation[i]); + } + g_free (imd->input_mode_name); + imd->input_mode_name = g_strdup ("CP437"); +diff --git a/src/intviewer/viewer-utils.cc b/src/intviewer/viewer-utils.cc +index 40f8819c..6d9c6e59 100644 +--- a/src/intviewer/viewer-utils.cc ++++ b/src/intviewer/viewer-utils.cc +@@ -29,36 +29,36 @@ + + using namespace std; + +-int unicode2utf8 (unsigned int unicode, unsigned char *out) ++int unicode2utf8 (unsigned int unicode, char_type *out) + { + int bytes_needed = 0; + if (unicode<0x80) + { + bytes_needed = 1; +- out[0] = (unsigned char)(unicode&0xFF); ++ *out = (unsigned char)(unicode&0xFF); + } + else + if (unicode<0x0800) + { + bytes_needed = 2; +- out[0] = (unsigned char)(unicode>>6 | 0xC0); +- out[1] = (unsigned char)((unicode&0x3F)| 0x80); ++ *out = (unsigned char)(unicode>>6 | 0xC0); ++ *out |= ((unsigned char)((unicode&0x3F)| 0x80) << 8); + } + else + if (unicode<0x10000) + { + bytes_needed = 3; +- out[0] = (unsigned char)((unicode>>12) | 0xE0); +- out[1] = (unsigned char)(((unicode>>6) & 0x3F) | 0x80); +- out[2] = (unsigned char)((unicode & 0x3F) | 0x80); ++ *out = (unsigned char)((unicode>>12) | 0xE0); ++ *out |= ((unsigned char)(((unicode>>6) & 0x3F) | 0x80) << 8); ++ *out |= ((unsigned char)((unicode & 0x3F) | 0x80) << 16); + } + else + { + bytes_needed = 4; +- out[0] = (unsigned char)((unicode>>18) | 0xE0); +- out[1] = (unsigned char)(((unicode>>12) & 0x3F) | 0x80); +- out[2] = (unsigned char)(((unicode>>6) & 0x3F) | 0x80); +- out[3] = (unsigned char)((unicode & 0x3F) | 0x80); ++ *out = (unsigned char)((unicode>>18) | 0xE0); ++ *out |= ((unsigned char)(((unicode>>12) & 0x3F) | 0x80) << 8); ++ *out |= ((unsigned char)(((unicode>>6) & 0x3F) | 0x80) << 16); ++ *out |= ((unsigned char)((unicode & 0x3F) | 0x80) << 24); + } + + return bytes_needed; +@@ -84,7 +84,7 @@ char_type *convert_utf8_to_chartype_array (const gchar *utf8text, /*out*/ int &a + { + unicode_char = g_utf8_get_char(pos); + +- unicode2utf8(unicode_char, (unsigned char*)&result[index]); ++ unicode2utf8(unicode_char, &result[index]); + + pos = g_utf8_next_char(pos); + if (!pos) +diff --git a/src/intviewer/viewer-utils.h b/src/intviewer/viewer-utils.h +index eb06fedc..c561e698 100644 +--- a/src/intviewer/viewer-utils.h ++++ b/src/intviewer/viewer-utils.h +@@ -26,7 +26,7 @@ + + #define GVIEWER_DEFAULT_PATH_PREFIX "/gnome-commander/internal_viewer/" + +-int unicode2utf8(unsigned int unicode, unsigned char *out); ++int unicode2utf8(unsigned int unicode, char_type *out); + char_type *convert_utf8_to_chartype_array(const gchar *utf8text, /*out*/ int &array_length); + + guint8 *mem_reverse(const guint8 *buffer, guint buflen); +-- +2.33.1 + diff --git a/gnome-commander.spec b/gnome-commander.spec index ca265ac..dc9a24f 100644 --- a/gnome-commander.spec +++ b/gnome-commander.spec @@ -40,8 +40,8 @@ %endif %global shortver 1.12 -%global fullver %{shortver}.2 -%global mainrel 2 +%global fullver %{shortver}.3 +%global mainrel 1 %if 0%{?use_release} >= 1 %global fedorarel %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}} @@ -86,6 +86,8 @@ Source1: gnome-commander.sh Source2: create-gcmd-git-bare-tarball.sh Source10: mimeedit-svn%{mimeedit_rev}.sh Patch1: gnome-commander-1.6.0-path-fedora-specific.patch +# Must send to be upstream +Patch101: 0001-unicode2utf8-viewer-utils-fix-logic-on-big-endian.patch BuildRequires: gcc-c++ %if 0%{?use_gcc_strict_sanitize} @@ -125,6 +127,9 @@ BuildRequires: make BuildRequires: %{_bindir}/git BuildRequires: %{_bindir}/appstream-util +# %%check +BuildRequires: gtest-devel + Requires: gnome-vfs2-smb Requires: meld Requires: gnome-icon-theme-legacy @@ -194,6 +199,7 @@ git commit -m "base" -q %patch1 -p1 -b .path git commit -m "Apply Fedora specific path configuration" -a +cat %PATCH101 | git am %if 0%{use_autotool} > 0 ( export NOCONFIGURE=1 ; sh autogen.sh ) @@ -323,6 +329,17 @@ popd %check appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml +%if 0%{?use_gitbare} +pushd %{name} +%endif + +pushd _builddir +make check + +%if 0%{?use_gitbare} +popd +%endif + %files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS @@ -350,6 +367,10 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdat %{_datadir}/pixmaps/%{name}/ %changelog +* Sun Nov 21 2021 Mamoru TASAKA - 4:1.12.3-1 +- 1.12.3 +- enable test + * Fri Aug 13 2021 Mamoru TASAKA - 4:1.12.2-2 - Drop old scrollkeeper stuff diff --git a/sources b/sources index add081b..1efd9b0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-commander-1.12.2.tar.xz) = 0f56450a09fcf8a73cc31e91564b133fd5fd199ea75c9376a2c329e070554c2c3ae4916f899940f92ddea5fff29656c9485a207dd22a28f1cda12a46f4cab32c +SHA512 (gnome-commander-1.12.3.tar.xz) = 7bdf29e9668b3eb40604db665d55d9300317f756a785ed5b6d5b6f5d684dc9a6c0fdcfeabd06cf522a9dbc9bbe904e575947d9eef771eab3dd813bd8e50dc5a9