diff options
author | manish <manish@robbie.oficina.paraguayeduca.org> | 2011-01-18 03:04:40 (GMT) |
---|---|---|
committer | manish <manish@robbie.oficina.paraguayeduca.org> | 2011-01-18 03:04:40 (GMT) |
commit | 3c2790abdd589957c36ece2e34f429a8c14823ef (patch) | |
tree | f94b4e1da82306adf2a72a759f35127b66491cdc | |
parent | a69619a4da09e35b738d6a03fa4d01c1af082e6d (diff) |
Backport 0.90 fixes (thanks to alsroot)
17 files changed, 1115 insertions, 2 deletions
diff --git a/rpms/sugar-toolkit/sugar-toolkit-1-4-Not-able-to-access-files-on-external-device-from-within-an-activity-on-new-system-d.l.o-10218.patch b/rpms/sugar-toolkit/sugar-toolkit-1-4-Not-able-to-access-files-on-external-device-from-within-an-activity-on-new-system-d.l.o-10218.patch new file mode 100644 index 0000000..213e63d --- /dev/null +++ b/rpms/sugar-toolkit/sugar-toolkit-1-4-Not-able-to-access-files-on-external-device-from-within-an-activity-on-new-system-d.l.o-10218.patch @@ -0,0 +1,46 @@ +From patchwork Sat Jan 15 17:07:16 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar-toolkit, + 1/4] Not able to access files on external device from within an + activity on new system d.l.o #10218 +Date: Sat, 15 Jan 2011 22:07:16 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 573 +Message-Id: <1295111239-22177-2-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Simon Schampijer <simon@schampijer.de> + +The error we were seeing was that the '(env.get_profile_path(), +'data'))' does not exist yet at system start. Symlinks are created +there when accessing data on an external device. The directory +gets created when an activity like Browse or Terminal has been +run for the first time or you start Read for the first time by +resuming the file on the external device. + +http://dev.laptop.org/ticket/10218 + +--- +src/sugar/datastore/datastore.py | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py +index 1618cef..656afcc 100644 +--- a/src/sugar/datastore/datastore.py ++++ b/src/sugar/datastore/datastore.py +@@ -250,9 +250,11 @@ class RawObject(object): + # to create hardlinks to jobject files + # and w/o this, it wouldn't work since we have file from mounted device + if self._file_path is None: ++ data_path = os.path.join(env.get_profile_path(), 'data') + self._file_path = tempfile.mktemp( +- prefix='rawobject', +- dir=os.path.join(env.get_profile_path(), 'data')) ++ prefix='rawobject', dir=data_path) ++ if not os.path.exists(data_path): ++ os.makedirs(data_path) + os.symlink(self.object_id, self._file_path) + return self._file_path + diff --git a/rpms/sugar-toolkit/sugar-toolkit-2-4-Do-not-break-if-the-string-contains-no-conversion-specifier-2354.patch b/rpms/sugar-toolkit/sugar-toolkit-2-4-Do-not-break-if-the-string-contains-no-conversion-specifier-2354.patch new file mode 100644 index 0000000..6a2545a --- /dev/null +++ b/rpms/sugar-toolkit/sugar-toolkit-2-4-Do-not-break-if-the-string-contains-no-conversion-specifier-2354.patch @@ -0,0 +1,44 @@ +From patchwork Sat Jan 15 17:07:17 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar-toolkit, + 2/4] Do not break if the string contains no conversion specifier #2354 +Date: Sat, 15 Jan 2011 22:07:17 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 574 +Message-Id: <1295111239-22177-3-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Simon Schampijer <simon@schampijer.de> + +--- +src/sugar/util.py | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/src/sugar/util.py b/src/sugar/util.py +index b947c0a..3625f21 100644 +--- a/src/sugar/util.py ++++ b/src/sugar/util.py +@@ -271,10 +271,17 @@ def timestamp_to_elapsed_string(timestamp, max_levels=2): + if key in _i18n_timestamps_cache: + time_period += _i18n_timestamps_cache[key] + else: +- translation = gettext.dngettext('sugar-toolkit', +- name_singular, +- name_plural, +- elapsed_units) % elapsed_units ++ tmp = gettext.dngettext('sugar-toolkit', ++ name_singular, ++ name_plural, ++ elapsed_units) ++ # FIXME: This is a hack so we don't crash when a translation ++ # doesn't contain the expected number of placeholders (#2354) ++ try: ++ translation = tmp % elapsed_units ++ except TypeError: ++ translation = tmp ++ + _i18n_timestamps_cache[key] = translation + time_period += translation + diff --git a/rpms/sugar-toolkit/sugar-toolkit-3-4-bundlebuilder-install-mimetypes.xml-and-associated-icon-2262.patch b/rpms/sugar-toolkit/sugar-toolkit-3-4-bundlebuilder-install-mimetypes.xml-and-associated-icon-2262.patch new file mode 100644 index 0000000..ee3a6f6 --- /dev/null +++ b/rpms/sugar-toolkit/sugar-toolkit-3-4-bundlebuilder-install-mimetypes.xml-and-associated-icon-2262.patch @@ -0,0 +1,37 @@ +From patchwork Sat Jan 15 17:07:18 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar-toolkit, + 3/4] bundlebuilder: install mimetypes.xml and associated icon #2262 +Date: Sat, 15 Jan 2011 22:07:18 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 575 +Message-Id: <1295111239-22177-4-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Simon Schampijer <simon@schampijer.de> + +As we do create the ActivityBundle in the config of the bundlebuilder +we can use the code from the activitybundle as well to install +the mime type. + +Reviewed-By: Sascha Silbe <sascha-pgp@silbe.org> + +--- +src/sugar/activity/bundlebuilder.py | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py +index 0c37d7f..4c3b8fd 100644 +--- a/src/sugar/activity/bundlebuilder.py ++++ b/src/sugar/activity/bundlebuilder.py +@@ -239,6 +239,8 @@ class Installer(object): + + shutil.copy(source, dest) + ++ self.config.bundle.install_mime_type(self.config.source_dir) ++ + + def cmd_dev(config, args): + '''Setup for development''' diff --git a/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch b/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch new file mode 100644 index 0000000..0ad36b1 --- /dev/null +++ b/rpms/sugar-toolkit/sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch @@ -0,0 +1,40 @@ +From patchwork Sat Jan 15 17:07:19 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar-toolkit, + 4/4] XoColor: don't choke if passed the wrong type (SL#1408) +Date: Sat, 15 Jan 2011 22:07:19 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 576 +Message-Id: <1295111239-22177-5-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Sascha Silbe <sascha-pgp@silbe.org> + +Color data is stored in the Journal as a JSON dump, so we can get back +arbitrary types. XoColor already checks the color string for validity and +handles invalid strings gracefully, so it makes sense to enhance this to +invalid types as well. + +Acked-by: Simon Schampijer <simon@schampijer.de> + +--- +src/sugar/graphics/xocolor.py | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/src/sugar/graphics/xocolor.py b/src/sugar/graphics/xocolor.py +index fd329cb..036d695 100644 +--- a/src/sugar/graphics/xocolor.py ++++ b/src/sugar/graphics/xocolor.py +@@ -209,6 +209,10 @@ colors = [ + + + def _parse_string(color_string): ++ if not isinstance(color_string, (str, unicode)): ++ logging.error('Invalid color string: %r', color_string) ++ return None ++ + if color_string == 'white': + return ['#ffffff', '#414141'] + elif color_string == 'insensitive': diff --git a/rpms/sugar-toolkit/sugar-toolkit.spec b/rpms/sugar-toolkit/sugar-toolkit.spec index 341051a..b74bf52 100644 --- a/rpms/sugar-toolkit/sugar-toolkit.spec +++ b/rpms/sugar-toolkit/sugar-toolkit.spec @@ -3,7 +3,7 @@ Summary: Sugar toolkit Name: sugar-toolkit Version: 0.88.1 -Release: 4.11dxo%{?dist} +Release: 4.12dxo%{?dist} URL: http://wiki.laptop.org/go/Sugar Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2 Source1: macros.sugar @@ -43,6 +43,12 @@ Patch501: namingalert_being_optional.patch Patch601: Fix-typo-in-except-block.patch Patch602: Parse-activity-dependencies.patch +#Fixes from 0.90 +patch701: sugar-toolkit-1-4-Not-able-to-access-files-on-external-device-from-within-an-activity-on-new-system-d.l.o-10218.patch +patch702: sugar-toolkit-2-4-Do-not-break-if-the-string-contains-no-conversion-specifier-2354.patch +patch703: sugar-toolkit-3-4-bundlebuilder-install-mimetypes.xml-and-associated-icon-2262.patch +patch704: sugar-toolkit-4-4-XoColor-don-t-choke-if-passed-the-wrong-type-SL-1408.patch + License: LGPLv2+ Group: System Environment/Libraries Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -103,6 +109,11 @@ to interact with system services like presence and the datastore. %patch601 -p1 %patch602 -p1 +%patch701 -p1 +%patch702 -p1 +%patch703 -p1 +%patch704 -p1 + %build %configure make %{?_smp_mflags} V=1 @@ -130,6 +141,9 @@ rm -rf %{buildroot} %{_sysconfdir}/rpm/macros.sugar %changelog +* Thu Jan 17 2011 Anish Mangal <anish@sugarlabs.org> - 0.88.1-4.12 +- 0.90 fixes backported + * Mon Jan 14 2011 Anish Mangal <anish@sugarlabs.org> - 0.88.1-4.11 - Checks to prevent installation of incompatible activities (Patch601, Patch602) diff --git a/rpms/sugar/sugar-01-11-Add-missing-import-in-jarabe.model.network-2106.patch b/rpms/sugar/sugar-01-11-Add-missing-import-in-jarabe.model.network-2106.patch new file mode 100644 index 0000000..adfb8bc --- /dev/null +++ b/rpms/sugar/sugar-01-11-Add-missing-import-in-jarabe.model.network-2106.patch @@ -0,0 +1,35 @@ +From patchwork Sat Jan 15 14:10:40 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar,01/11] Add missing import in jarabe.model.network (#2106) +Date: Sat, 15 Jan 2011 19:10:40 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 562 +Message-Id: <1295100650-21516-2-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: fran <fran@unknown> + +This was breaking sugar-control-panel invocations making it impossible +to deregister from the school server. + +http://bugs.sugarlabs.org/ticket/2106 +http://dev.laptop.org/ticket/10261 + +--- +src/jarabe/model/network.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py +index 5632624..d0c17e4 100644 +--- a/src/jarabe/model/network.py ++++ b/src/jarabe/model/network.py +@@ -24,6 +24,7 @@ import os + import time + + import dbus ++import dbus.service + import gobject + import ConfigParser + import gconf diff --git a/rpms/sugar/sugar-02-11-Sugar-gconf-settings-breaks-mouse-buttons-behaviour-in-gnome-session-1544.patch b/rpms/sugar/sugar-02-11-Sugar-gconf-settings-breaks-mouse-buttons-behaviour-in-gnome-session-1544.patch new file mode 100644 index 0000000..66c9300 --- /dev/null +++ b/rpms/sugar/sugar-02-11-Sugar-gconf-settings-breaks-mouse-buttons-behaviour-in-gnome-session-1544.patch @@ -0,0 +1,31 @@ +From patchwork Sat Jan 15 14:10:41 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, + 02/11] Sugar gconf settings breaks mouse buttons behaviour in gnome + session #1544 +Date: Sat, 15 Jan 2011 19:10:41 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 563 +Message-Id: <1295100650-21516-3-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +--- + bin/sugar-session | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + + +diff --git a/bin/sugar-session b/bin/sugar-session +index 750e4b8..0501311 100755 +--- a/bin/sugar-session ++++ b/bin/sugar-session +@@ -236,7 +236,7 @@ def main(): + + client = gconf.client_get_default() + client.set_string('/apps/metacity/general/mouse_button_modifier', +- 'disabled') ++ '<Super>') + + timezone = client.get_string('/desktop/sugar/date/timezone') + if timezone is not None and timezone: diff --git a/rpms/sugar/sugar-03-11-Journal-show-error-message-on-write-failure-1842.patch b/rpms/sugar/sugar-03-11-Journal-show-error-message-on-write-failure-1842.patch new file mode 100644 index 0000000..a0818e6 --- /dev/null +++ b/rpms/sugar/sugar-03-11-Journal-show-error-message-on-write-failure-1842.patch @@ -0,0 +1,136 @@ +From patchwork Sat Jan 15 14:10:42 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar,03/11] Journal:show error message on write failure: #1842 +Date: Sat, 15 Jan 2011 19:10:42 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 564 +Message-Id: <1295100650-21516-4-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org +Cc: anishmangal2002 <anishmangal2002@gmail.com> + +From: anishmangal2002 <anishmangal2002@gmail.com> + +volumestoolbar.py now catches the IOError and ValueError +exceptions and emits 'volume-error'signal. This signal is +caught in journalactivity.py which displays the error as +an ErrorAlert message. + +Signed-off-by: anishmangal2002 <anishmangal2002@gmail.com> + +--- +src/jarabe/journal/journalactivity.py | 13 +++++-------- + src/jarabe/journal/volumestoolbar.py | 28 +++++++++++++++++----------- + 2 files changed, 22 insertions(+), 19 deletions(-) + +diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py +index 52a677e..5d74ae9 100644 +--- a/src/jarabe/journal/journalactivity.py ++++ b/src/jarabe/journal/journalactivity.py +@@ -142,15 +142,13 @@ class JournalActivity(JournalWindow): + self._critical_space_alert = None + self._check_available_space() + +- def _alert_notify_cb(self, gobject, strerror, severity): +- alert = ErrorAlert() +- alert.props.title= severity +- alert.props.msg = strerror +- alert.connect('response', self._alert_response_cb) ++ def __alert_notify_cb(self, gobject, strerror, severity): ++ alert = ErrorAlert(title=severity, msg=strerror) ++ alert.connect('response', self.__alert_response_cb) + self.add_alert(alert) + alert.show() + +- def _alert_response_cb(self, alert, response_id): ++ def __alert_response_cb(self, alert, response_id): + self.remove_alert(alert) + + def __realize_cb(self, window): +@@ -176,8 +174,7 @@ class JournalActivity(JournalWindow): + self._volumes_toolbar = VolumesToolbar() + self._volumes_toolbar.connect('volume-changed', + self.__volume_changed_cb) +- self._volumes_toolbar.connect('volume-error', self._alert_notify_cb, +- 'Error') ++ self._volumes_toolbar.connect('volume-error', self.__alert_notify_cb) + self._main_view.pack_start(self._volumes_toolbar, expand=False) + + search_toolbar = self._main_toolbox.search_toolbar +diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py +index 36e22d7..dd6fcec 100644 +--- a/src/jarabe/journal/volumestoolbar.py ++++ b/src/jarabe/journal/volumestoolbar.py +@@ -15,6 +15,7 @@ + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + import logging ++import os + from gettext import gettext as _ + + import gobject +@@ -40,7 +41,7 @@ class VolumesToolbar(gtk.Toolbar): + ([str])), + 'volume-error': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, +- ([str])) ++ ([str, str])) + } + + def __init__(self): +@@ -107,7 +108,7 @@ class VolumesToolbar(gtk.Toolbar): + button = VolumeButton(mount) + button.props.group = self._volume_buttons[0] + button.connect('toggled', self._button_toggled_cb) +- button.connect('volume-error', self._volume_error_cb) ++ button.connect('volume-error', self.__volume_error_cb) + position = self.get_item_index(self._volume_buttons[-1]) + 1 + self.insert(button, position) + button.show() +@@ -117,8 +118,8 @@ class VolumesToolbar(gtk.Toolbar): + if len(self.get_children()) > 1: + self.show() + +- def _volume_error_cb(self, button, strerror): +- self.emit('volume-error', strerror) ++ def __volume_error_cb(self, button, strerror, severity): ++ self.emit('volume-error', strerror, severity) + + def _button_toggled_cb(self, button): + if button.props.active: +@@ -157,7 +158,7 @@ class BaseButton(RadioToolButton): + __gsignals__ = { + 'volume-error': (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, +- ([str])) ++ ([str, str])) + } + + def __init__(self, mount_point): +@@ -174,14 +175,19 @@ class BaseButton(RadioToolButton): + info, timestamp): + object_id = selection_data.data + metadata = model.get(object_id) ++ file_path = model.get_file(metadata['uid']) ++ if not file_path or not os.path.exists(file_path): ++ logging.warn('File does not exist') ++ self.emit('volume-error', _('Entries without a file cannot' ++ ' be copied'), _('Warning')) ++ return ++ + try: + model.copy(metadata, self.mount_point) +- except IOError as (errno, strerror): +- logging.error('BaseButton._drag_data_received_cb: IOError: %s; %s' % (errno, strerror)) +- self.emit('volume-error', strerror) +- except ValueError as (strerror): +- logging.error('BaseButton._drag_data_received_cb: ValueError: %s' % (strerror)) +- self.emit('volume-error', strerror) ++ except IOError: ++ logging.exception('BaseButton._drag_data_received_cb: Error' ++ 'while copying') ++ self.emit('volume-error', _('Input/Output error'), _('Error')) + + class VolumeButton(BaseButton): + def __init__(self, mount): diff --git a/rpms/sugar/sugar-04-11-Journal-Alert-if-an-error-occures-when-copying-to-devices-in-the-detail-view-1842.patch b/rpms/sugar/sugar-04-11-Journal-Alert-if-an-error-occures-when-copying-to-devices-in-the-detail-view-1842.patch new file mode 100644 index 0000000..b72bfb5 --- /dev/null +++ b/rpms/sugar/sugar-04-11-Journal-Alert-if-an-error-occures-when-copying-to-devices-in-the-detail-view-1842.patch @@ -0,0 +1,129 @@ +From patchwork Sat Jan 15 14:10:43 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, + 04/11] Journal: Alert if an error occures when copying to devices in + the detail view #1842 +Date: Sat, 15 Jan 2011 19:10:43 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 565 +Message-Id: <1295100650-21516-5-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Simon Schampijer <simon@schampijer.de> + +Includes better error messages for both cases +(detail view and dragging in main view). + +--- +src/jarabe/journal/journalactivity.py | 9 +++++---- + src/jarabe/journal/journaltoolbox.py | 22 +++++++++++++++++++++- + src/jarabe/journal/volumestoolbar.py | 16 +++++++++------- + 3 files changed, 35 insertions(+), 12 deletions(-) + +diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py +index 5d74ae9..d022d97 100644 +--- a/src/jarabe/journal/journalactivity.py ++++ b/src/jarabe/journal/journalactivity.py +@@ -142,8 +142,8 @@ class JournalActivity(JournalWindow): + self._critical_space_alert = None + self._check_available_space() + +- def __alert_notify_cb(self, gobject, strerror, severity): +- alert = ErrorAlert(title=severity, msg=strerror) ++ def __volume_error_cb(self, gobject, message, severity): ++ alert = ErrorAlert(title=severity, msg=message) + alert.connect('response', self.__alert_response_cb) + self.add_alert(alert) + alert.show() +@@ -174,7 +174,7 @@ class JournalActivity(JournalWindow): + self._volumes_toolbar = VolumesToolbar() + self._volumes_toolbar.connect('volume-changed', + self.__volume_changed_cb) +- self._volumes_toolbar.connect('volume-error', self.__alert_notify_cb) ++ self._volumes_toolbar.connect('volume-error', self.__volume_error_cb) + self._main_view.pack_start(self._volumes_toolbar, expand=False) + + search_toolbar = self._main_toolbox.search_toolbar +@@ -185,7 +185,8 @@ class JournalActivity(JournalWindow): + self._secondary_view = gtk.VBox() + + self._detail_toolbox = DetailToolbox() +- entry_toolbar = self._detail_toolbox.entry_toolbar ++ self._detail_toolbox.entry_toolbar.connect('volume-error', ++ self.__volume_error_cb) + + self._detail_view = DetailView() + self._detail_view.connect('go-back-clicked', self.__go_back_clicked_cb) +diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py +index 03afb4e..8f5e376 100644 +--- a/src/jarabe/journal/journaltoolbox.py ++++ b/src/jarabe/journal/journaltoolbox.py +@@ -363,6 +363,11 @@ class DetailToolbox(Toolbox): + self.entry_toolbar.show() + + class EntryToolbar(gtk.Toolbar): ++ __gsignals__ = { ++ 'volume-error': (gobject.SIGNAL_RUN_FIRST, ++ gobject.TYPE_NONE, ++ ([str, str])) ++ } + def __init__(self): + gtk.Toolbar.__init__(self) + +@@ -432,7 +437,22 @@ class EntryToolbar(gtk.Toolbar): + misc.resume(self._metadata, service_name) + + def _copy_menu_item_activate_cb(self, menu_item, mount_point): +- model.copy(self._metadata, mount_point) ++ file_path = model.get_file(self._metadata['uid']) ++ ++ if not file_path or not os.path.exists(file_path): ++ logging.warn('Entries without a file cannot be copied.') ++ self.emit('volume-error', ++ _('Entries without a file cannot be copied.'), ++ _('Warning')) ++ return ++ ++ try: ++ model.copy(self._metadata, mount_point) ++ except IOError, e: ++ logging.exception('Error while copying the entry. %s', e.strerror) ++ self.emit('volume-error', ++ _('Error while copying the entry. %s') % e.strerror, ++ _('Error')) + + def _refresh_copy_palette(self): + palette = self._copy.get_palette() +diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py +index dd6fcec..54d051b 100644 +--- a/src/jarabe/journal/volumestoolbar.py ++++ b/src/jarabe/journal/volumestoolbar.py +@@ -177,17 +177,19 @@ class BaseButton(RadioToolButton): + metadata = model.get(object_id) + file_path = model.get_file(metadata['uid']) + if not file_path or not os.path.exists(file_path): +- logging.warn('File does not exist') +- self.emit('volume-error', _('Entries without a file cannot' +- ' be copied'), _('Warning')) ++ logging.warn('Entries without a file cannot be copied.') ++ self.emit('volume-error', ++ _('Entries without a file cannot be copied.'), ++ _('Warning')) + return + + try: + model.copy(metadata, self.mount_point) +- except IOError: +- logging.exception('BaseButton._drag_data_received_cb: Error' +- 'while copying') +- self.emit('volume-error', _('Input/Output error'), _('Error')) ++ except IOError, e: ++ logging.exception('Error while copying the entry. %s', e.strerror) ++ self.emit('volume-error', ++ _('Error while copying the entry. %s') % e.strerror, ++ _('Error')) + + class VolumeButton(BaseButton): + def __init__(self, mount): diff --git a/rpms/sugar/sugar-05-11-Fix-typo.patch b/rpms/sugar/sugar-05-11-Fix-typo.patch new file mode 100644 index 0000000..05c8513 --- /dev/null +++ b/rpms/sugar/sugar-05-11-Fix-typo.patch @@ -0,0 +1,30 @@ +From patchwork Sat Jan 15 14:10:44 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar,05/11] Fix typo +Date: Sat, 15 Jan 2011 19:10:44 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 566 +Message-Id: <1295100650-21516-6-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> + +--- +src/jarabe/model/network.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py +index d0c17e4..dd9a061 100644 +--- a/src/jarabe/model/network.py ++++ b/src/jarabe/model/network.py +@@ -251,7 +251,7 @@ def frequency_to_channel(frequency): + 2472: 13} + if frequency not in ftoc: + logging.warning("The frequency %s can not be mapped to a channel, " \ +- "defaulting to channel 1.", frequncy) ++ "defaulting to channel 1.", frequency) + return 1 + return ftoc[frequency] + diff --git a/rpms/sugar/sugar-06-11-Remove-separator-in-Journal-toolbar-2446-Gary-C.-Martin.patch b/rpms/sugar/sugar-06-11-Remove-separator-in-Journal-toolbar-2446-Gary-C.-Martin.patch new file mode 100644 index 0000000..aca2906 --- /dev/null +++ b/rpms/sugar/sugar-06-11-Remove-separator-in-Journal-toolbar-2446-Gary-C.-Martin.patch @@ -0,0 +1,51 @@ +From patchwork Sat Jan 15 14:10:45 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, + 06/11] Remove separator in Journal toolbar #2446 (Gary C. Martin) +Date: Sat, 15 Jan 2011 19:10:45 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 570 +Message-Id: <1295100650-21516-7-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Simon Schampijer <simon@schampijer.de> + +Search field fills available toolbar space now + +--- +src/jarabe/journal/journaltoolbox.py | 13 ------------- + 1 files changed, 0 insertions(+), 13 deletions(-) + +diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py +index 8f5e376..0bd274b 100644 +--- a/src/jarabe/journal/journaltoolbox.py ++++ b/src/jarabe/journal/journaltoolbox.py +@@ -110,8 +110,6 @@ class SearchToolbar(gtk.Toolbar): + self.insert(tool_item, -1) + tool_item.show() + +- self._add_separator(expand=True) +- + self._list_view_button = ListViewButton() + # TODO: Connect when Grid View is implemented + #self._list_view.connect('toggled', self.__view_button_toggled_cb) +@@ -166,17 +164,6 @@ class SearchToolbar(gtk.Toolbar): + with_search.connect('changed', self._combo_changed_cb) + return with_search + +- def _add_separator(self, expand=False): +- separator = gtk.SeparatorToolItem() +- separator.props.draw = False +- if expand: +- separator.set_expand(True) +- else: +- separator.set_size_request(style.GRID_CELL_SIZE, +- style.GRID_CELL_SIZE) +- self.insert(separator, -1) +- separator.show() +- + def _add_widget(self, widget, expand=False): + tool_item = gtk.ToolItem() + tool_item.set_expand(expand) diff --git a/rpms/sugar/sugar-07-11-Journal-list-view-don-t-choke-on-invalid-or-incomplete-metadata-SL-1408.patch b/rpms/sugar/sugar-07-11-Journal-list-view-don-t-choke-on-invalid-or-incomplete-metadata-SL-1408.patch new file mode 100644 index 0000000..0cc68be --- /dev/null +++ b/rpms/sugar/sugar-07-11-Journal-list-view-don-t-choke-on-invalid-or-incomplete-metadata-SL-1408.patch @@ -0,0 +1,97 @@ +From patchwork Sat Jan 15 14:10:46 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, 07/11] Journal list view: don't choke on invalid or incomplete + metadata (SL#1408) +Date: Sat, 15 Jan 2011 19:10:46 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 567 +Message-Id: <1295100650-21516-8-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Sascha Silbe <sascha-pgp@silbe.org> + +Metadata can get corrupted by crashes or malformed by buggy activities. +We should do our best to display the parts that are usable and certainly +never mess up the entire Journal. + +Acked-by: Simon Schampijer <simon@schampijer.de> + +--- +src/jarabe/journal/listmodel.py | 51 ++++++++++++++++++++++++++++---------- + 1 files changed, 37 insertions(+), 14 deletions(-) + +diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py +index c07d9e1..a22c5ea 100644 +--- a/src/jarabe/journal/listmodel.py ++++ b/src/jarabe/journal/listmodel.py +@@ -142,11 +142,16 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): + xo_color = misc.get_icon_color(metadata) + self._cached_row.append(xo_color) + +- title = gobject.markup_escape_text(metadata.get('title', None)) +- self._cached_row.append('<b>%s</b>' % title) +- +- timestamp = int(metadata.get('timestamp', 0)) +- self._cached_row.append(util.timestamp_to_elapsed_string(timestamp)) ++ title = gobject.markup_escape_text(metadata.get('title', ++ _('Untitled'))) ++ self._cached_row.append('<b>%s</b>' % (title, )) ++ ++ try: ++ timestamp = float(metadata.get('timestamp', 0)) ++ except (TypeError, ValueError): ++ self._cached_row.append(_('Unknown')) ++ else: ++ self._cached_row.append(util.timestamp_to_elapsed_string(timestamp)) + + ctime = metadata.get('ctime') + if ctime: +@@ -158,19 +163,37 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): + size = int(metadata.get('filesize', 0)) + self._cached_row.append(util.format_size(size)) + +- self._cached_row.append(int(metadata.get('progress', 100))) +- +- if metadata.get('buddies', ''): +- buddies = simplejson.loads(metadata['buddies']).values() +- else: ++ try: ++ progress = int(float(metadata.get('progress', 100))) ++ except (TypeError, ValueError): ++ progress = 100 ++ self._cached_row.append(progress) ++ ++ buddies = [] ++ if metadata.get('buddies'): ++ try: ++ buddies = simplejson.loads(metadata['buddies']).values() ++ except simplejson.decoder.JSONDecodeError, exception: ++ logging.warning('Cannot decode buddies for %r: %s', ++ metadata['uid'], exception) ++ ++ if not isinstance(buddies, list): ++ logging.warning('Content of buddies for %r is not a list: %r', ++ metadata['uid'], buddies) + buddies = [] + + for n_ in xrange(0, 3): + if buddies: +- nick, color = buddies.pop(0) +- self._cached_row.append((nick, XoColor(color))) +- else: +- self._cached_row.append(None) ++ try: ++ nick, color = buddies.pop(0) ++ except (AttributeError, ValueError), exception: ++ logging.warning('Malformed buddies for %r: %s', ++ metadata['uid'], exception) ++ else: ++ self._cached_row.append((nick, XoColor(color))) ++ continue ++ ++ self._cached_row.append(None) + + return self._cached_row[column] + diff --git a/rpms/sugar/sugar-08-11-Journal-details-view-don-t-choke-on-invalid-timestamp-SL-1590-SL-2208.patch b/rpms/sugar/sugar-08-11-Journal-details-view-don-t-choke-on-invalid-timestamp-SL-1590-SL-2208.patch new file mode 100644 index 0000000..30fe984 --- /dev/null +++ b/rpms/sugar/sugar-08-11-Journal-details-view-don-t-choke-on-invalid-timestamp-SL-1590-SL-2208.patch @@ -0,0 +1,98 @@ +From patchwork Sat Jan 15 14:10:47 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, 08/11] Journal details view: don't choke on invalid timestamp + (SL#1590, SL#2208) +Date: Sat, 15 Jan 2011 19:10:47 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 568 +Message-Id: <1295100650-21516-9-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Sascha Silbe <sascha-pgp@silbe.org> + +Metadata can get corrupted by crashes or malformed by buggy activities. +We should do our best to display the parts that are usable. + +Acked-by: Simon Schampijer <simon@schampijer.de> + +--- +src/jarabe/journal/expandedentry.py | 13 +++++++++---- + src/jarabe/journal/listmodel.py | 1 + + src/jarabe/journal/misc.py | 26 ++++++++++++++++++-------- + 3 files changed, 28 insertions(+), 12 deletions(-) + +diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py +index 725c0f9..9775901 100644 +--- a/src/jarabe/journal/expandedentry.py ++++ b/src/jarabe/journal/expandedentry.py +@@ -280,10 +280,15 @@ class ExpandedEntry(hippo.CanvasBox): + + def _format_date(self): + if 'timestamp' in self._metadata: +- timestamp = float(self._metadata['timestamp']) +- return time.strftime('%x', time.localtime(timestamp)) +- else: +- return _('No date') ++ try: ++ timestamp = float(self._metadata['timestamp']) ++ except (ValueError, TypeError): ++ logging.warning('Invalid timestamp for %r: %r', ++ self._metadata['uid'], ++ self._metadata['timestamp']) ++ else: ++ return time.strftime('%x', time.localtime(timestamp)) ++ return _('No date') + + def _create_buddy_list(self): + +diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py +index a22c5ea..396213b 100644 +--- a/src/jarabe/journal/listmodel.py ++++ b/src/jarabe/journal/listmodel.py +@@ -15,6 +15,7 @@ + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + import logging ++from gettext import gettext as _ + + import simplejson + import gobject +diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py +index 710cb15..4a2211f 100644 +--- a/src/jarabe/journal/misc.py ++++ b/src/jarabe/journal/misc.py +@@ -87,14 +87,24 @@ def get_icon_name(metadata): + + def get_date(metadata): + """ Convert from a string in iso format to a more human-like format. """ +- if metadata.has_key('timestamp'): +- timestamp = float(metadata['timestamp']) +- return util.timestamp_to_elapsed_string(timestamp) +- elif metadata.has_key('mtime'): +- ti = time.strptime(metadata['mtime'], "%Y-%m-%dT%H:%M:%S") +- return util.timestamp_to_elapsed_string(time.mktime(ti)) +- else: +- return _('No date') ++ if 'timestamp' in metadata: ++ try: ++ timestamp = float(metadata['timestamp']) ++ except (TypeError, ValueError): ++ logging.warning('Invalid timestamp: %r', metadata['timestamp']) ++ else: ++ return util.timestamp_to_elapsed_string(timestamp) ++ ++ if 'mtime' in metadata: ++ try: ++ ti = time.strptime(metadata['mtime'], '%Y-%m-%dT%H:%M:%S') ++ except (TypeError, ValueError): ++ logging.warning('Invalid mtime: %r', metadata['mtime']) ++ else: ++ return util.timestamp_to_elapsed_string(time.mktime(ti)) ++ ++ return _('No date') ++ + + def get_bundle(metadata): + try: diff --git a/rpms/sugar/sugar-09-11-datastore.write-expects-a-DSObject-not-an-id.patch b/rpms/sugar/sugar-09-11-datastore.write-expects-a-DSObject-not-an-id.patch new file mode 100644 index 0000000..a0735c4 --- /dev/null +++ b/rpms/sugar/sugar-09-11-datastore.write-expects-a-DSObject-not-an-id.patch @@ -0,0 +1,30 @@ +From patchwork Sat Jan 15 14:10:48 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar,09/11] datastore.write expects a DSObject, not an id +Date: Sat, 15 Jan 2011 19:10:48 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 569 +Message-Id: <1295100650-21516-10-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> + +--- +src/jarabe/frame/activitiestray.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py +index 3a80ac0..3c2326c 100644 +--- a/src/jarabe/frame/activitiestray.py ++++ b/src/jarabe/frame/activitiestray.py +@@ -544,7 +544,7 @@ class IncomingTransferButton(BaseTransferButton): + progress = file_transfer.props.transferred_bytes / \ + file_transfer.file_size + self._ds_object.metadata['progress'] = str(progress * 100) +- datastore.write(self._ds_object.object_id, update_mtime=False) ++ datastore.write(self._ds_object, update_mtime=False) + + def __reply_handler_cb(self): + logging.debug('__reply_handler_cb %r', self._object_id) diff --git a/rpms/sugar/sugar-10-11-Fix-more-sugar.datastore-breakage.patch b/rpms/sugar/sugar-10-11-Fix-more-sugar.datastore-breakage.patch new file mode 100644 index 0000000..4c04480 --- /dev/null +++ b/rpms/sugar/sugar-10-11-Fix-more-sugar.datastore-breakage.patch @@ -0,0 +1,50 @@ +From patchwork Sat Jan 15 14:10:49 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar,10/11] Fix more sugar.datastore breakage +Date: Sat, 15 Jan 2011 19:10:49 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 571 +Message-Id: <1295100650-21516-11-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> + +--- +src/jarabe/frame/activitiestray.py | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py +index 3c2326c..370572c 100644 +--- a/src/jarabe/frame/activitiestray.py ++++ b/src/jarabe/frame/activitiestray.py +@@ -529,12 +529,12 @@ class IncomingTransferButton(BaseTransferButton): + logging.debug('__notify_state_cb COMPLETED') + self._ds_object.metadata['progress'] = '100' + self._ds_object.file_path = file_transfer.destination_path +- datastore.write(self._ds_jobject, transfer_ownership=True, ++ datastore.write(self._ds_object, transfer_ownership=True, + reply_handler=self.__reply_handler_cb, + error_handler=self.__error_handler_cb) + elif file_transfer.props.state == filetransfer.FT_STATE_CANCELLED: + logging.debug('__notify_state_cb CANCELLED') +- object_id = self._jobject.object_id ++ object_id = self._ds_object.object_id + if object_id is not None: + self._ds_object.destroy() + datastore.delete(object_id) +@@ -547,10 +547,11 @@ class IncomingTransferButton(BaseTransferButton): + datastore.write(self._ds_object, update_mtime=False) + + def __reply_handler_cb(self): +- logging.debug('__reply_handler_cb %r', self._object_id) ++ logging.debug('__reply_handler_cb %r', self._ds_object.object_id) + + def __error_handler_cb(self, error): +- logging.debug('__error_handler_cb %r %s', self._object_id, error) ++ logging.debug('__error_handler_cb %r %s', self._ds_object.object_id, ++ error) + + def __dismiss_clicked_cb(self, palette): + self.remove() diff --git a/rpms/sugar/sugar-11-11-fix-journal-scan-of-external-media-dev.laptop.org-10140.patch b/rpms/sugar/sugar-11-11-fix-journal-scan-of-external-media-dev.laptop.org-10140.patch new file mode 100644 index 0000000..d2f7d6a --- /dev/null +++ b/rpms/sugar/sugar-11-11-fix-journal-scan-of-external-media-dev.laptop.org-10140.patch @@ -0,0 +1,217 @@ +From patchwork Sat Jan 15 14:10:50 2011 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [sugar, 11/11] fix journal scan of external media, + dev.laptop.org #10140 +Date: Sat, 15 Jan 2011 19:10:50 -0000 +From: Aleksey Lim <alsroot@member.fsf.org> +X-Patchwork-Id: 572 +Message-Id: <1295100650-21516-12-git-send-email-alsroot@member.fsf.org> +To: dextrose@lists.sugarlabs.org + +From: James Cameron <quozl@laptop.org> + +Update the progress bar regularly and prevent the UI from stalling +during a scan. Avoid following recursive symlinks, and symlinks that +point outside the filesystem being scanned. Do not check for MIME type +if file is excluded for other filter reasons. Do not report permission +denied errors. + +Tested-By: Sascha Silbe <sascha-pgp@silbe.org> +Reviewed-By: Sascha Silbe <sascha-pgp@silbe.org> +Acked-By: Simon Schampijer <simon@laptop.org> + +--- +src/jarabe/journal/model.py | 136 ++++++++++++++++++++++++++++--------------- + 1 files changed, 90 insertions(+), 46 deletions(-) + +diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py +index c44882f..98b7f09 100644 +--- a/src/jarabe/journal/model.py ++++ b/src/jarabe/journal/model.py +@@ -1,4 +1,4 @@ +-# Copyright (C) 2007-2008, One Laptop Per Child ++# Copyright (C) 2007-2010, One Laptop per Child + # + # 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 +@@ -16,10 +16,11 @@ + + import logging + import os ++import errno + from datetime import datetime + import time + import shutil +-from stat import S_IFMT, S_IFDIR, S_IFREG ++from stat import S_IFLNK, S_IFMT, S_IFDIR, S_IFREG + import re + from operator import itemgetter + +@@ -224,7 +225,9 @@ class InplaceResultSet(BaseResultSet): + BaseResultSet.__init__(self, query, page_size) + self._mount_point = mount_point + self._file_list = None +- self._pending_directories = 0 ++ self._pending_directories = [] ++ self._visited_directories = [] ++ self._pending_files = [] + self._stopped = False + + query_text = query.get('query', '') +@@ -251,7 +254,10 @@ class InplaceResultSet(BaseResultSet): + + def setup(self): + self._file_list = [] +- self._recurse_dir(self._mount_point) ++ self._pending_directories = [self._mount_point] ++ self._visited_directories = [] ++ self._pending_files = [] ++ gobject.idle_add(self._scan) + + def stop(self): + self._stopped = True +@@ -291,62 +297,100 @@ class InplaceResultSet(BaseResultSet): + + return entries, total_count + +- def _recurse_dir(self, dir_path): +- self._pending_directories += 1 +- gobject.idle_add(self._idle_recurse_dir, dir_path) ++ def _scan(self): ++ if self._stopped: ++ return False + +- def _idle_recurse_dir(self, dir_path): +- try: +- self._real_recurse_dir(dir_path) +- finally: +- self._pending_directories -= 1 +- if self._pending_directories == 0: +- self.setup_ready() ++ self.progress.send(self) + +- def _real_recurse_dir(self, dir_path): +- if self._stopped: +- return ++ if self._pending_files: ++ self._scan_a_file() ++ return True ++ ++ if self._pending_directories: ++ self._scan_a_directory() ++ return True ++ ++ self.setup_ready() ++ self._visited_directories = [] ++ return False ++ ++ def _scan_a_file(self): ++ full_path = self._pending_files.pop(0) + + try: +- dirs = os.listdir(dir_path) +- except Exception: +- logging.exception('Error reading directory %r', dir_path) +- dirs = [] ++ stat = os.lstat(full_path) ++ except OSError, e: ++ if e.errno != errno.ENOENT: ++ logging.exception( ++ 'Error reading metadata of file %r', full_path) ++ return ++ ++ if S_IFMT(stat.st_mode) == S_IFLNK: ++ try: ++ link = os.readlink(full_path) ++ except OSError, e: ++ logging.exception( ++ 'Error reading target of link %r', full_path) ++ return ++ ++ if not os.path.abspath(link).startswith(self._mount_point): ++ return + +- for entry in dirs: +- if entry.startswith('.'): +- continue +- full_path = dir_path + '/' + entry + try: + stat = os.stat(full_path) +- if S_IFMT(stat.st_mode) == S_IFDIR: +- self._recurse_dir(full_path) + +- elif S_IFMT(stat.st_mode) == S_IFREG: +- add_to_list = True ++ except OSError, e: ++ if e.errno != errno.ENOENT: ++ logging.exception( ++ 'Error reading metadata of linked file %r', full_path) ++ return ++ ++ if S_IFMT(stat.st_mode) == S_IFDIR: ++ id_tuple = stat.st_ino, stat.st_dev ++ if not id_tuple in self._visited_directories: ++ self._visited_directories.append(id_tuple) ++ self._pending_directories.append(full_path) ++ return + +- if self._regex is not None and \ +- not self._regex.match(full_path): +- add_to_list = False ++ if S_IFMT(stat.st_mode) != S_IFREG: ++ return ++ ++ if self._regex is not None and \ ++ not self._regex.match(full_path): ++ return ++ ++ if self._date_start is not None and stat.st_mtime < self._date_start: ++ return ++ ++ if self._date_end is not None and stat.st_mtime > self._date_end: ++ return + +- if None not in [self._date_start, self._date_end] and \ +- (stat.st_mtime < self._date_start or +- stat.st_mtime > self._date_end): +- add_to_list = False ++ if self._mime_types: ++ mime_type = gio.content_type_guess(filename=full_path) ++ if mime_type not in self._mime_types: ++ return + +- if self._mime_types: +- mime_type = gio.content_type_guess(filename=full_path) +- if mime_type not in self._mime_types: +- add_to_list = False ++ file_info = (full_path, stat, int(stat.st_mtime), stat.st_size) ++ self._file_list.append(file_info) + +- if add_to_list: +- file_info = (full_path, stat, int(stat.st_mtime), stat.st_size) +- self._file_list.append(file_info) ++ return + +- self.progress.send(self) ++ def _scan_a_directory(self): ++ dir_path = self._pending_directories.pop(0) + +- except Exception: +- logging.exception('Error reading file %r', full_path) ++ try: ++ entries = os.listdir(dir_path) ++ except OSError, e: ++ if e.errno != errno.EACCES: ++ logging.exception('Error reading directory %r', dir_path) ++ return ++ ++ for entry in entries: ++ if entry.startswith('.'): ++ continue ++ self._pending_files.append(dir_path + '/' + entry) ++ return + + def _get_file_metadata(path, stat): + client = gconf.client_get_default() diff --git a/rpms/sugar/sugar.spec b/rpms/sugar/sugar.spec index 020b1ae..14d001d 100644 --- a/rpms/sugar/sugar.spec +++ b/rpms/sugar/sugar.spec @@ -3,7 +3,7 @@ Summary: Constructionist learning platform Name: sugar Version: 0.88.1 -Release: 5.44dxo%{?dist} +Release: 5.45dxo%{?dist} URL: http://sugarlabs.org/ Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2 @@ -110,6 +110,19 @@ patch1301: globalkey_for_touchpad_device_icon.patch patch1401: Let-call-the-frame-from-arbitrary-code-avoiding-curcular-imports.patch patch1402: Check-for-required-activity-deps-before-installing.patch +#0.90 bugfix backports +patch1501: sugar-01-11-Add-missing-import-in-jarabe.model.network-2106.patch +patch1502: sugar-02-11-Sugar-gconf-settings-breaks-mouse-buttons-behaviour-in-gnome-session-1544.patch +patch1503: sugar-03-11-Journal-show-error-message-on-write-failure-1842.patch +patch1504: sugar-04-11-Journal-Alert-if-an-error-occures-when-copying-to-devices-in-the-detail-view-1842.patch +patch1505: sugar-05-11-Fix-typo.patch +patch1506: sugar-06-11-Remove-separator-in-Journal-toolbar-2446-Gary-C.-Martin.patch +patch1507: sugar-07-11-Journal-list-view-don-t-choke-on-invalid-or-incomplete-metadata-SL-1408.patch +patch1508: sugar-08-11-Journal-details-view-don-t-choke-on-invalid-timestamp-SL-1590-SL-2208.patch +patch1509: sugar-09-11-datastore.write-expects-a-DSObject-not-an-id.patch +patch1510: sugar-10-11-Fix-more-sugar.datastore-breakage.patch +patch1511: sugar-11-11-fix-journal-scan-of-external-media-dev.laptop.org-10140.patch + License: GPLv2+ Group: User Interface/Desktops Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -266,6 +279,18 @@ multiple instances of sugar. %patch1401 -p1 %patch1402 -p1 +%patch1501 -p1 +%patch1502 -p1 +%patch1503 -p1 +%patch1504 -p1 +%patch1505 -p1 +%patch1506 -p1 +%patch1507 -p1 +%patch1508 -p1 +%patch1509 -p1 +%patch1510 -p1 +%patch1511 -p1 + %build autoreconf %configure @@ -342,6 +367,9 @@ rm -rf %{buildroot} %{_datadir}/icons/hicolor/scalable/apps/sugar-xo.svg %changelog +* Mon Jan 17 2011 Anish Mangal <anish@sugarlabs.org> - 0.88.1-5.45 +- 0.90 bugfix backports + * Thu Jan 14 2011 Anish Mangal <anish@sugarlabs.org> - 0.88.1-5.44 - Checks to prevent installation of incompatible activities |