[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#987888: unblock: ibus-anthy/1.5.12-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: Boyuan Yang <byang@debian.org>, YOSHINO Yoshihito <yy.y.ja.jp@gmail.com>

Please unblock package ibus-anthy

(Please provide enough (but not too much) information to help
the release team to judge the request efficiently. E.g. by
filling in the sections below.)

[ Reason ]
Addition of very focused initial configuration helper script

[ Impact ]
Most novice users may think this package doesn't work.
(unless they read README.Debian carefully to manually activate
ibus-anthy.)

[ Tests ]

* piuparts: pass
* autopkgtest: not supported yet unfortunately.
  (This situation made me to request unblock)

[ Risks ]
Added code is simple addition of desktop file and shell script playing
with dconf command.  This is the same type of refinement used in ibus-mecab.

[ Checklist ]
  [X] all changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach binary debdiff against the package in testing
  [X] attach source debdiff against the package in testing

[ Other info ]
In retrospect, further refinement may have been possible.  I mean with
dconf, we could check for "('ibus', 'anthy')" instead of "ibus" so we
could install and activate this with "('ibus', 'mozc-jp')" etc.  But for
now, we shouldn't be too aggressive and settle with this modest
improvement.  After all, this is proven solution for ibus-mozc and
provides huge benefit to the end user.  Please understand GNOME desktop
default is ibus.  To input Japanese from keyboard, we need ibus-anthy or
ibus-mozc activated.  Automatic activation is vert desirable.

unblock ibus-anthy/1.5.12-2
[The following lists of changes regard files as different if they have
different names, permissions or owners.]

Files in second set of .debs but not in first
---------------------------------------------
-rw-r--r--  root/root   /etc/xdg/autostart/ibus-anthy-gnome-initial-setup.desktop
-rw-r--r--  root/root   DEBIAN/conffiles
-rwxr-xr-x  root/root   /usr/share/ibus-anthy/ibus-anthy-gnome-initial-setup.sh

Control files of package ibus-anthy: lines which differ (wdiff format)
----------------------------------------------------------------------
Installed-Size: [-8783-] {+8790+}
Version: [-1.5.12-1-] {+1.5.12-2+}

Control files of package ibus-anthy-dev: lines which differ (wdiff format)
--------------------------------------------------------------------------
Depends: ibus-anthy (= [-1.5.12-1)-] {+1.5.12-2)+}
Version: [-1.5.12-1-] {+1.5.12-2+}
diff -Nru ibus-anthy-1.5.12/debian/changelog ibus-anthy-1.5.12/debian/changelog
--- ibus-anthy-1.5.12/debian/changelog	2021-03-01 01:07:56.000000000 +0900
+++ ibus-anthy-1.5.12/debian/changelog	2021-03-31 13:04:00.000000000 +0900
@@ -1,3 +1,14 @@
+ibus-anthy (1.5.12-2) unstable; urgency=medium
+
+  [ Osamu Aoki ]
+  * Team upload.
+
+  [ YOSHINO Yoshihito ]
+  * d/ibus-anthy.install,d/ibus-anthy-gnome-initial-setup.{desktop,sh}:
+    Add autostart set-up script on GNOME desktop. (Closes: #983695)
+
+ -- Osamu Aoki <osamu@debian.org>  Wed, 31 Mar 2021 13:04:00 +0900
+
 ibus-anthy (1.5.12-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.desktop ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.desktop
--- ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.desktop	1970-01-01 09:00:00.000000000 +0900
+++ ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.desktop	2021-03-31 13:04:00.000000000 +0900
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=ibus-anthy GNOME Initial Setup
+Type=Application
+Exec=/usr/share/ibus-anthy/ibus-anthy-gnome-initial-setup.sh
+OnlyShowIn=GNOME;
+NoDisplay=true
+AutostartCondition=unless-exists ibus-anthy-gnome-initial-setup-done
diff -Nru ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.sh ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.sh
--- ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.sh	1970-01-01 09:00:00.000000000 +0900
+++ ibus-anthy-1.5.12/debian/ibus-anthy-gnome-initial-setup.sh	2021-03-31 13:04:00.000000000 +0900
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# If ibus-anthy is removed but not purged, keep hands off :-)
+dpkg-query -l ibus-anthy 2>/dev/null | grep -q ^ii || exit 0
+
+# If non-ibus IM framework is set-up (by im-config etc.), keep hands off :-)
+env | grep -E '^(XMODIFIERS|GTK_IM_MODULE|QT_IM_MODULE|CLUTTER_IM_MODULE)=' | grep -q ibus || exit 0
+
+mkdir -p ${XDG_DATA_HOME:-~/.local/share}
+exec >> ${XDG_DATA_HOME:-~/.local/share}/ibus-anthy-gnome-initial-setup.log 2>&1
+
+key=/org/gnome/desktop/input-sources/sources
+
+# Try to read the current value
+for i in $(seq 30); do
+	value=$(dconf read $key)
+	[ x != x"$value" ] && break; sleep 1
+done
+[ x != x"$value" ] || { echo "E: dconf read failed"; exit 1; }
+
+# Try to write the new value
+(
+	# If some ibus input method is already used, keep hands off :-)
+	echo "$value" | grep -F "('ibus', " && { echo "I: GNOME ibus already set-up. Doing nothing. Current: $value"; exit 0; }
+
+	echo "I: Current: $value"
+
+	value="[('ibus', 'anthy'), ${value#[}"
+	dconf write $key "$value" || { echo "E: dconf write failed. New: $value"; exit 1; }
+	echo "I: Done. New: $value"
+) && touch ${XDG_CONFIG_HOME:-~/.config}/ibus-anthy-gnome-initial-setup-done
diff -Nru ibus-anthy-1.5.12/debian/ibus-anthy.install ibus-anthy-1.5.12/debian/ibus-anthy.install
--- ibus-anthy-1.5.12/debian/ibus-anthy.install	2020-12-27 08:39:04.000000000 +0900
+++ ibus-anthy-1.5.12/debian/ibus-anthy.install	2021-03-31 13:04:00.000000000 +0900
@@ -8,3 +8,5 @@
 usr/share/ibus/*
 usr/share/icons/*
 usr/share/locale/*
+debian/ibus-anthy-gnome-initial-setup.sh usr/share/ibus-anthy/
+debian/ibus-anthy-gnome-initial-setup.desktop /etc/xdg/autostart/

Reply to: