Hello community, here is the log from the commit of package cinnamon for openSUSE:Factory checked in at 2019-08-06 15:12:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cinnamon (Old) and /work/SRC/openSUSE:Factory/.cinnamon.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cinnamon" Tue Aug 6 15:12:06 2019 rev:37 rq:721235 version:4.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/cinnamon/cinnamon.changes 2019-07-26 12:43:56.937838113 +0200 +++ /work/SRC/openSUSE:Factory/.cinnamon.new.4126/cinnamon.changes 2019-08-06 15:12:07.403737845 +0200 @@ -1,0 +2,21 @@ +Tue Aug 6 05:05:55 UTC 2019 - Marguerite Su <[email protected]> + +- add cinnamon-settings-4.2.3-tinycss2.patch(boo#) + * port GtkCssEditor class to rely on tinycss2, the + former tinycss is obsolete and doesn't exist on + openSUSE + +------------------------------------------------------------------- +Sun Jul 28 04:55:01 UTC 2019 - Marguerite Su <[email protected]> + +- Update to version 4.2.3: + * cinnamon-app-system.c: Fix a leak, nothing was freeing the + GPtrArrays for collecting apps with duplicate names. + * Privacy settings: Add missing import + * Sound settings: Make the module slightly taller + * menu applet: only update label on orientation change + * cinnamon-window-tracker: Add a window-app-changed signal + to notify the window list when a window<-> app association + changes. + +------------------------------------------------------------------- Old: ---- cinnamon-4.2.2.tar.gz New: ---- cinnamon-4.2.3.tar.gz cinnamon-settings-4.2.3-tinycss2.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cinnamon.spec ++++++ --- /var/tmp/diff_new_pack.8Ij4ZL/_old 2019-08-06 15:12:07.991737717 +0200 +++ /var/tmp/diff_new_pack.8Ij4ZL/_new 2019-08-06 15:12:07.991737717 +0200 @@ -18,7 +18,7 @@ %define _version 4.0.0 Name: cinnamon -Version: 4.2.2 +Version: 4.2.3 Release: 0 Summary: GNU/Linux Desktop featuring a traditional layout License: GPL-2.0-or-later AND LGPL-2.1-only @@ -41,6 +41,8 @@ Patch7: %{name}-fallback-icewm.patch # PATCH-FIX-OPENSUSE cinnamon-fix-typelib-false-positive.patch [email protected] -- remove false typelib(Webkit) dependency Patch8: %{name}-fix-typelib-false-positive.patch +# PATCH-FIx-UPSTREAM cinnamon-settings-4.2.3-tinycss2.patch +Patch9: %{name}-settings-4.2.3-tinycss2.patch BuildRequires: autoconf BuildRequires: autoconf-archive BuildRequires: automake @@ -96,6 +98,7 @@ Requires: python3-pexpect Requires: python3-pyinotify Requires: python3-python-pam +Requires: python3-tinycss2 Requires: v4l-tools Requires: wget Requires: xdg-user-dirs @@ -185,6 +188,7 @@ %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 cp -a %{SOURCE1} . for file in files%{_datadir}/%{name}/%{name}-settings/bin/*.py files%{_datadir}/%{name}/%{name}-looking-glass/*.py \ ++++++ cinnamon-4.2.2.tar.gz -> cinnamon-4.2.3.tar.gz ++++++ ++++ 3581 lines of diff (skipped) ++++++ cinnamon-fix-typelib-false-positive.patch ++++++ --- /var/tmp/diff_new_pack.8Ij4ZL/_old 2019-08-06 15:12:08.351737639 +0200 +++ /var/tmp/diff_new_pack.8Ij4ZL/_new 2019-08-06 15:12:08.351737639 +0200 @@ -1,13 +1,13 @@ -Index: cinnamon-4.2.2/js/ui/indicatorManager.js +Index: cinnamon-4.2.3/js/ui/indicatorManager.js =================================================================== ---- cinnamon-4.2.2.orig/js/ui/indicatorManager.js -+++ cinnamon-4.2.2/js/ui/indicatorManager.js -@@ -990,7 +990,7 @@ var IndicatorActor = class IndicatorActo +--- cinnamon-4.2.3.orig/js/ui/indicatorManager.js ++++ cinnamon-4.2.3/js/ui/indicatorManager.js +@@ -1055,7 +1055,7 @@ IndicatorActor.prototype = { - // FIXME: The Tooltips are an object and render in html format. To show the real tooltips + // FIXME: The Tooltips are an object and is render in html format. To show the real tooltips // (this._indicator.toolTip), we will need a good html parser. - // In the tooltips implementation, maybe imports.gi.WebKit and use Webkit.WebView and then loadData. + // In the tooltips implementation, maybe import gi.WebKit and use Webkit.WebView and then loadData. // So instead we will used the title as a tooltip. - getToolTip() { + getToolTip: function() { return this._indicator.title; ++++++ cinnamon-settings-4.2.3-tinycss2.patch ++++++ Index: cinnamon-4.2.3/files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py =================================================================== --- cinnamon-4.2.3.orig/files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py +++ cinnamon-4.2.3/files/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py @@ -3,8 +3,7 @@ import os.path import signal -import tinycss -from tinycss import tokenizer +import tinycss2 import gi gi.require_version("Gtk", "3.0") @@ -87,13 +86,37 @@ class GtkCssEditor: self._path = os.path.join(GLib.get_user_config_dir(), "gtk-3.0", "gtk.css") - - self.parser = tinycss.make_parser() + rules = [] try: - self.stylesheet = self.parser.parse_stylesheet_file(self._path) + stylesheet = tinycss2.parse_stylesheet_bytes(open(self._path, 'rb').read()) + for rs in stylesheet[0]: + if type(rs) == tinycss2.ast.ParseError: + continue + rules.append(rs) + self.stylesheet = rules except FileNotFoundError: - self.stylesheet = tinycss.css21.Stylesheet(rules=[], errors=[], encoding="utf-8") + self.stylesheet = rules + + def _serialize_selector(self, rule): + at_css = "" + if type(rule) == tinycss2.ast.AtRule: + at_css += "@" + rule.at_keyword + at_css += self._serialize_prelude(rule.prelude) + return at_css + + def _serialize_prelude(self, prelude): + at_css = "" + for cv in prelude: + if type(cv) == tinycss2.ast.WhitespaceToken: + at_css += " " + elif type(cv) == tinycss2.ast.HashToken: + at_css += "#" + cv.value + elif type(cv) == tinycss2.ast.FunctionBlock: + next + else: + at_css += cv.value + return at_css.strip() def get_ruleset(self, selector_css): """ @@ -101,21 +124,29 @@ class GtkCssEditor: If it isn't currently defined, returns an empty one. """ - for rs in self.stylesheet.rules: - if rs.selector.as_css() == selector_css: - return rs + idx = 0 + for rs in self.stylesheet: + if type(rs) == tinycss2.ast.AtRule or type(rs) == tinycss2.ast.QualifiedRule: + if self._serialize_selector(rs) == selector_css: + return rs, idx + idx += 1 - new_ruleset = tinycss.css21.RuleSet(tokenizer.tokenize_flat(selector_css), [], None, None) - self.stylesheet.rules.append(new_ruleset) + new_ruleset = tinycss2.parse_one_rule(selector_css + " {}", False) + self.stylesheet.append(new_ruleset) - return new_ruleset + return new_ruleset, len(self.stylesheet) - 1 def get_declaration(self, selector, decl_name): - rs = self.get_ruleset(selector) + rs, _ = self.get_ruleset(selector) + + declarations = tinycss2.parse_declaration_list(rs.content, True, True) - for declaration in rs.declarations: + for declaration in declarations: if decl_name == declaration.name: - return declaration.value[0].value + decl_value = "" + for component_value in declaration.value: + decl_value += component_value.serialize() + return decl_value return None @@ -124,41 +155,63 @@ class GtkCssEditor: # get modified, they become invalid (or I'm doing something wrong) self.remove_declaration(selector, decl_name) - rs = self.get_ruleset(selector) - - value_token = tokenizer.tokenize_flat(value_as_str) - - # Make a new declaration, add it to the ruleset - new_decl = tinycss.css21.Declaration(decl_name, value_token, None, None, None) + rs, idx = self.get_ruleset(selector) + # rs.content[0].value: the value of the WhitespaceToken is the actual indent + component_values = tinycss2.parse_component_value_list(rs.content[0].value + decl_name + ": " + value_as_str + ";") + for component_value in component_values: + self.stylesheet[idx].content.append(component_value) + + def _remove_declaration_from_content(self, declaration, content): + idx = 0 + ident_idx = 0 + found_ident = False + done = False + new_content = [] + for component_value in content: + idx += 1 + if len(content) != idx and type(content[idx]) == tinycss2.ast.IdentToken and content[idx].value == declaration.name and type(component_value) == tinycss2.ast.WhitespaceToken: + continue + if type(component_value) == tinycss2.ast.IdentToken and component_value.value == declaration.name: + found_ident = True + continue + if found_ident: + if type(component_value) == tinycss2.ast.LiteralToken: + if ident_idx == 0 or done == True: + done = False + continue + if len(declaration.value) - 1 == ident_idx and component_value == declaration.value[ident_idx]: + done = True + continue + if component_value == declaration.value[ident_idx] and content[idx] == declaration.value[ident_idx + 1]: + ident_idx += 1 + continue + new_content.append(component_value) - rs.declarations.append(new_decl) + return new_content def remove_declaration(self, selector, decl_name): - rs = self.get_ruleset(selector) + rs, idx = self.get_ruleset(selector) if not rs: return - for declaration in rs.declarations: + declarations = tinycss2.parse_declaration_list(rs.content, True, True) + + for declaration in declarations: if decl_name == declaration.name: - rs.declarations.remove(declaration) + new_content = self._remove_declaration_from_content(declaration, rs.content) - if len(rs.declarations) == 0: - self.stylesheet.rules.remove(rs) + if len(new_content) == 0: + self.stylesheet.remove(rs) + break + self.stylesheet[idx].content = new_content break def save_stylesheet(self): out = "" - - for rs in self.stylesheet.rules: - out += rs.selector.as_css() + " {\n" - - for decl in rs.declarations: - out += " " + decl.name + ": " + decl.value.as_css() + ";\n" - - out += "}\n" - + for rs in self.stylesheet: + out += rs.serialize() with open(self._path, "w+") as f: f.write(out)
