Resolves: #1963072 Fix covscan

- Delete postscripts
This commit is contained in:
Takao Fujiwara 2021-05-26 22:17:01 +09:00
parent 4323f33317
commit 8b0e38d0a1
2 changed files with 211 additions and 12 deletions

View File

@ -135,3 +135,208 @@ index bff3078..1d18d19 100755
-- --
2.28.0 2.28.0
From 84f080278a7351a26df441429bd58e5931944c32 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 27 Apr 2021 19:56:07 +0900
Subject: [PATCH] Fix covscan result
- Fix double quote not to re-splitting elements
- Fix deprecated GObject private
- Fix section variable initialization
- Fix dlg variable condition assignment
---
engine/python2/ibus-engine-anthy.in | 4 ++--
engine/python3/ibus-engine-anthy.in | 4 ++--
gir/anthygcontext.c | 4 ++--
setup/python2/ibus-setup-anthy.in | 4 ++--
setup/python2/main.py | 8 +++++---
setup/python3/ibus-setup-anthy.in | 4 ++--
setup/python3/main.py | 6 ++++--
7 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/engine/python2/ibus-engine-anthy.in b/engine/python2/ibus-engine-anthy.in
index f663165..07b99fe 100644
--- a/engine/python2/ibus-engine-anthy.in
+++ b/engine/python2/ibus-engine-anthy.in
@@ -5,7 +5,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -25,4 +25,4 @@
export IBUS_PREFIX=@prefix@
export IBUS_ANTHY_PKGDATADIR=@datarootdir@/@PACKAGE@
export LIBEXECDIR=@libexecdir@
-exec @ENV_IBUS_ENGINE@ @PYTHON@ @datarootdir@/@PACKAGE@/engine/main.py $@
+exec @ENV_IBUS_ENGINE@ @PYTHON@ @datarootdir@/@PACKAGE@/engine/main.py "$@"
diff --git a/engine/python3/ibus-engine-anthy.in b/engine/python3/ibus-engine-anthy.in
index f663165..07b99fe 100644
--- a/engine/python3/ibus-engine-anthy.in
+++ b/engine/python3/ibus-engine-anthy.in
@@ -5,7 +5,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -25,4 +25,4 @@
export IBUS_PREFIX=@prefix@
export IBUS_ANTHY_PKGDATADIR=@datarootdir@/@PACKAGE@
export LIBEXECDIR=@libexecdir@
-exec @ENV_IBUS_ENGINE@ @PYTHON@ @datarootdir@/@PACKAGE@/engine/main.py $@
+exec @ENV_IBUS_ENGINE@ @PYTHON@ @datarootdir@/@PACKAGE@/engine/main.py "$@"
diff --git a/gir/anthygcontext.c b/gir/anthygcontext.c
index b342579..7698d4d 100644
--- a/gir/anthygcontext.c
+++ b/gir/anthygcontext.c
@@ -1,7 +1,7 @@
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* vim:set et sts=4: */
/* ibus-anthy - The Anthy engine for IBus
- * Copyright (c) 2012-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (c) 2012-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (c) 2012 Peng Huang <shawn.p.huang@gmail.com>
* Copyright (c) 2012-2013 Red Hat, Inc.
*
@@ -29,7 +29,7 @@ extern int anthy_do_set_personality (const char *id);
#include "anthygcontext.h"
#define ANTHY_GCONTEXT_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), ANTHY_TYPE_GCONTEXT, AnthyGContextPrivate))
+ ((AnthyGContextPrivate *)anthy_gcontext_get_instance_private (o))
struct _AnthyGContextPrivate {
anthy_context_t context;
diff --git a/setup/python2/ibus-setup-anthy.in b/setup/python2/ibus-setup-anthy.in
index b936d2c..81c9dfc 100644
--- a/setup/python2/ibus-setup-anthy.in
+++ b/setup/python2/ibus-setup-anthy.in
@@ -4,7 +4,7 @@
# ibus-tmpl - The Input Bus template project
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -22,4 +22,4 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
export IBUS_LOCALEDIR=@localedir@
-exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py $@
+exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py "$@"
diff --git a/setup/python2/main.py b/setup/python2/main.py
index 4e6b15b..f870ee5 100644
--- a/setup/python2/main.py
+++ b/setup/python2/main.py
@@ -4,7 +4,7 @@
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -1253,7 +1253,7 @@ class AnthySetup(object):
model_combobox = combobox.get_model()
method = model_combobox[id][1]
type = user_data
- section_base = None
+ section = None
key = input.get_text()
value = output.get_text()
left_text = left.get_text()
@@ -1308,7 +1308,7 @@ class AnthySetup(object):
l, i = tv.get_selection().get_selected()
type = l[i][0]
key = l[i][1]
- section_base = None
+ section = None
if type == 'romaji':
section = 'romaji-typing-rule'
elif type == 'kana':
@@ -1379,6 +1379,7 @@ class AnthySetup(object):
def on_btn_dict_add_clicked(self, widget):
file = None
id = None
+ dlg = None
if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"),
@@ -1394,6 +1395,7 @@ class AnthySetup(object):
_("_OK"), Gtk.ResponseType.OK)
dlg.add_buttons(*buttons)
+ assert(dlg != None), 'Button name is undefined.'
vbox = self.__builder.get_object('dict:add_extra_vbox')
if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
# Need to init for the second time
diff --git a/setup/python3/ibus-setup-anthy.in b/setup/python3/ibus-setup-anthy.in
index b936d2c..81c9dfc 100644
--- a/setup/python3/ibus-setup-anthy.in
+++ b/setup/python3/ibus-setup-anthy.in
@@ -4,7 +4,7 @@
# ibus-tmpl - The Input Bus template project
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -22,4 +22,4 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
export IBUS_LOCALEDIR=@localedir@
-exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py $@
+exec @PYTHON@ @prefix@/share/ibus-anthy/setup/main.py "$@"
diff --git a/setup/python3/main.py b/setup/python3/main.py
index 7e16093..6641f7f 100644
--- a/setup/python3/main.py
+++ b/setup/python3/main.py
@@ -1246,7 +1246,7 @@ class AnthySetup(object):
model_combobox = combobox.get_model()
method = model_combobox[id][1]
type = user_data
- section_base = None
+ section = None
key = input.get_text()
value = output.get_text()
left_text = left.get_text()
@@ -1301,7 +1301,7 @@ class AnthySetup(object):
l, i = tv.get_selection().get_selected()
type = l[i][0]
key = l[i][1]
- section_base = None
+ section = None
if type == 'romaji':
section = 'romaji-typing-rule'
elif type == 'kana':
@@ -1372,6 +1372,7 @@ class AnthySetup(object):
def on_btn_dict_add_clicked(self, widget):
file = None
id = None
+ dlg = None
if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
dlg = Gtk.FileChooserDialog(title=_("Open Dictionary File"),
@@ -1387,6 +1388,7 @@ class AnthySetup(object):
_("_OK"), Gtk.ResponseType.OK)
dlg.add_buttons(*buttons)
+ assert (dlg != None), 'Button name is undefined.'
vbox = self.__builder.get_object('dict:add_extra_vbox')
if Gtk.Buildable.get_name(widget) == 'dict:btn_add':
# Need to init for the second time
--
2.28.0

View File

@ -18,7 +18,7 @@
Name: ibus-anthy Name: ibus-anthy
Version: 1.5.12 Version: 1.5.12
Release: 5%{?dist} Release: 6%{?dist}
Summary: The Anthy engine for IBus input platform Summary: The Anthy engine for IBus input platform
License: GPLv2+ License: GPLv2+
URL: https://github.com/ibus/ibus/wiki URL: https://github.com/ibus/ibus/wiki
@ -120,16 +120,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libanthygobject-%{sub_version}.la
desktop-file-validate \ desktop-file-validate \
$RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup-anthy.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup-anthy.desktop
%post
/sbin/ldconfig
[ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || :
%postun
/sbin/ldconfig
[ -x %{_bindir}/ibus ] && \
%{_bindir}/ibus write-cache --system &>/dev/null || :
%files -f %{name}.lang %files -f %{name}.lang
%doc AUTHORS COPYING README %doc AUTHORS COPYING README
# dir {python2_sitearch}/ibus # dir {python2_sitearch}/ibus
@ -137,13 +127,13 @@ desktop-file-validate \
%{_libdir}/girepository-1.0/Anthy*.typelib %{_libdir}/girepository-1.0/Anthy*.typelib
%{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.engine.anthy.gschema.xml %{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.engine.anthy.gschema.xml
%dir %{_datadir}/ibus-anthy %dir %{_datadir}/ibus-anthy
%{_datadir}/applications/ibus-setup-anthy.desktop
%{_datadir}/ibus-anthy/dicts %{_datadir}/ibus-anthy/dicts
%{_datadir}/icons/hicolor/scalable/apps/ibus-anthy.svg %{_datadir}/icons/hicolor/scalable/apps/ibus-anthy.svg
%files python %files python
%{_libexecdir}/ibus-*-anthy %{_libexecdir}/ibus-*-anthy
%{_datadir}/metainfo/*.metainfo.xml %{_datadir}/metainfo/*.metainfo.xml
%{_datadir}/applications/ibus-setup-anthy.desktop
%{_datadir}/ibus-anthy/engine %{_datadir}/ibus-anthy/engine
%{_datadir}/ibus-anthy/setup %{_datadir}/ibus-anthy/setup
%{_datadir}/ibus/component/* %{_datadir}/ibus/component/*
@ -160,6 +150,10 @@ desktop-file-validate \
%{_datadir}/installed-tests/%{name} %{_datadir}/installed-tests/%{name}
%changelog %changelog
* Tue Apr 27 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.12-6
- Fix covscan. Related: rhbz#1963072
- Delete postscripts
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.12-5 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.12-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937