r44075 - in /tools/gnome-pkg-tools: 1/rules/make-compat-desktop-file.mk debian/changelog debian/control.in debian/copyright debian/gnome-pkg-tools.install pkg-gnome-compat-desktop-file

laney at users.alioth.debian.org laney at users.alioth.debian.org
Thu Dec 18 15:31:02 UTC 2014


Author: laney
Date: Thu Dec 18 15:31:01 2014
New Revision: 44075

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=44075
Log:
pkg-gnome-compat-desktop-file: New script to provide copies of .desktop
files which have been renamed upstream, as a transitional measure until
the desktop file spec and parsers have a graceful way to handle renames.

Added:
    tools/gnome-pkg-tools/1/rules/make-compat-desktop-file.mk
    tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file   (with props)
Modified:
    tools/gnome-pkg-tools/debian/changelog
    tools/gnome-pkg-tools/debian/control.in
    tools/gnome-pkg-tools/debian/copyright
    tools/gnome-pkg-tools/debian/gnome-pkg-tools.install

Added: tools/gnome-pkg-tools/1/rules/make-compat-desktop-file.mk
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/1/rules/make-compat-desktop-file.mk?rev=44075&op=file
==============================================================================
--- tools/gnome-pkg-tools/1/rules/make-compat-desktop-file.mk	(added)
+++ tools/gnome-pkg-tools/1/rules/make-compat-desktop-file.mk	[utf-8] Thu Dec 18 15:31:01 2014
@@ -0,0 +1,2 @@
+$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
+	$(if $(DEB_MK_COMPAT_DESKTOP_$(cdbs_curpkg)), /usr/bin/pkg-gnome-compat-desktop-file $(DEB_MK_COMPAT_DESKTOP_$(cdbs_curpkg)))

Modified: tools/gnome-pkg-tools/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/debian/changelog?rev=44075&op=diff
==============================================================================
--- tools/gnome-pkg-tools/debian/changelog	[utf-8] (original)
+++ tools/gnome-pkg-tools/debian/changelog	[utf-8] Thu Dec 18 15:31:01 2014
@@ -1,6 +1,12 @@
 gnome-pkg-tools (0.19.5) UNRELEASED; urgency=medium
 
+  [ Julien Cristau ]
   * Fix dh_gnome_clean to only consider members of pkg-gnome for addition in Uploaders.
+
+  [ Iain Lane ]
+  * pkg-gnome-compat-desktop-file: New script to provide copies of .desktop
+    files which have been renamed upstream, as a transitional measure until
+    the desktop file spec and parsers have a graceful way to handle renames.
 
  -- Julien Cristau <jcristau at debian.org>  Mon, 29 Sep 2014 21:15:49 +0200
 

Modified: tools/gnome-pkg-tools/debian/control.in
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/debian/control.in?rev=44075&op=diff
==============================================================================
--- tools/gnome-pkg-tools/debian/control.in	[utf-8] (original)
+++ tools/gnome-pkg-tools/debian/control.in	[utf-8] Thu Dec 18 15:31:01 2014
@@ -12,7 +12,10 @@
 
 Package: gnome-pkg-tools
 Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}
+Depends: ${misc:Depends}, ${perl:Depends},
+         python3,
+         python3-gi,
+         gir1.2-glib-2.0
 Recommends: svn-buildpackage
 Multi-Arch: foreign
 Description: Tools for the Debian GNOME Packaging Team

Modified: tools/gnome-pkg-tools/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/debian/copyright?rev=44075&op=diff
==============================================================================
--- tools/gnome-pkg-tools/debian/copyright	[utf-8] (original)
+++ tools/gnome-pkg-tools/debian/copyright	[utf-8] Thu Dec 18 15:31:01 2014
@@ -21,3 +21,23 @@
  .
  On Debian systems, the complete text of the GNU General
  Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+Files: pkg-gnome-compat-desktop-file
+Copyright: 2014, Canonical Ltd
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-2'.

Modified: tools/gnome-pkg-tools/debian/gnome-pkg-tools.install
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/debian/gnome-pkg-tools.install?rev=44075&op=diff
==============================================================================
--- tools/gnome-pkg-tools/debian/gnome-pkg-tools.install	[utf-8] (original)
+++ tools/gnome-pkg-tools/debian/gnome-pkg-tools.install	[utf-8] Thu Dec 18 15:31:01 2014
@@ -2,6 +2,7 @@
 1                               usr/share/gnome-pkg-tools/
 control.header                  usr/share/gnome-pkg-tools/
 desktop-check-mime-types        usr/bin/
+pkg-gnome-compat-desktop-file   usr/bin/
 dh/dh_gnome                     usr/bin/
 dh/dh_gnome_clean               usr/bin/
 dh/gnome.pm                     usr/share/perl5/Debian/Debhelper/Sequence/

Added: tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file?rev=44075&op=file
==============================================================================
--- tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file	(added)
+++ tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file	[utf-8] Thu Dec 18 15:31:01 2014
@@ -0,0 +1,90 @@
+#!/usr/bin/python3
+# Copyright: © Canonical Ltd 2014
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+
+# You should have received a copy of the GNU General Public License along with
+# this package; if not, write to the Free Software Foundation, Inc., 51
+# Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Author: Iain Lane <iain.lane at canonical.com>
+
+# Many GNOME applications are switching to DBus activatable desktop files, with
+# names of the form org.gnome.foo.desktop. Renaming desktop files causes
+# problems including with launchers and mimetype associations. Until desktop
+# file parsers can handle this better, we should continue to provide the old
+# name. To avoid showing the same entry twice, we mark the new desktop file as
+# NoDisplay.
+
+from gi.repository import GLib
+
+import argparse
+import sys
+
+
+def try_remove_key(keyfile, group, key):
+    assert group is not None
+    assert key is not None
+    try:
+        keyfile.remove_key(group, key)
+    except GLib.Error:
+        return
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description='Make a compatibility desktop file')
+    parser.add_argument('currentfile', metavar='infile', nargs=1,
+                        help='The existing desktop file')
+    parser.add_argument('newfile', metavar='outfile', nargs=1,
+                        help='The output desktop file')
+    args = parser.parse_args()
+    old_keyfile = GLib.KeyFile.new()
+    new_keyfile = GLib.KeyFile.new()
+
+    try:
+        GLib.KeyFile.load_from_file(old_keyfile,
+                                    args.currentfile[0],
+                                    GLib.KeyFileFlags.KEEP_COMMENTS |
+                                    GLib.KeyFileFlags.KEEP_TRANSLATIONS)
+        GLib.KeyFile.load_from_file(new_keyfile,
+                                    args.currentfile[0],
+                                    GLib.KeyFileFlags.KEEP_COMMENTS |
+                                    GLib.KeyFileFlags.KEEP_TRANSLATIONS)
+    except GLib.Error as e:
+        print("Couldn't load: %s" % e, file=sys.stderr)
+        sys.exit(1)
+
+    try_remove_key(new_keyfile,
+                   GLib.KEY_FILE_DESKTOP_GROUP,
+                   "DBusActivatable")
+    try_remove_key(new_keyfile,
+                   GLib.KEY_FILE_DESKTOP_GROUP,
+                   "MimeType")
+    old_keyfile.set_value(GLib.KEY_FILE_DESKTOP_GROUP,
+                          "NoDisplay",
+                          "true")
+
+    try:
+        old_keyfile.save_to_file(args.currentfile[0])
+    except GLib.Error as e:
+        print("Couldn't save %s: %s" % (args.currentfile[0], e))
+        sys.exit(1)
+
+    try:
+        new_keyfile.save_to_file(args.newfile[0])
+    except GLib.Error as e:
+        print("Couldn't save %s: %s" % (args.newfile[0], e))
+        sys.exit(1)
+
+
+if __name__ == "__main__":
+    main()

Propchange: tools/gnome-pkg-tools/pkg-gnome-compat-desktop-file
------------------------------------------------------------------------------
    svn:executable = *




More information about the pkg-gnome-commits mailing list