diff options
author | Bernie Innocenti <bernie@codewiz.org> | 2010-07-30 20:00:25 (GMT) |
---|---|---|
committer | Bernie Innocenti <bernie@codewiz.org> | 2010-07-30 20:02:36 (GMT) |
commit | ab6d7d72fceb32b0a084cd877cfb89de391b440b (patch) | |
tree | b6090a8a0bcd78d70f1a7720e4cebacc0b9e00d7 /rpms | |
parent | c02ce86047dee69245d6ddca14e855c5cc8aa71e (diff) |
sugar: add patches from esteban & tch
Diffstat (limited to 'rpms')
-rwxr-xr-x[-rw-r--r--] | rpms/sugar/backup-0001-Volumes-Backup-and-Restore.patch | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | rpms/sugar/backup-0002-Journal-XS-backup-and-restore.patch | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | rpms/sugar/backup-0005-save-lease.patch | 2 | ||||
-rw-r--r-- | rpms/sugar/discard_network_connections.patch | 46 | ||||
-rw-r--r-- | rpms/sugar/journal-0001-Processdialog-prerequisite-check-support.patch | 89 | ||||
-rw-r--r-- | rpms/sugar/journal-0002-reindex.patch | 122 | ||||
-rw-r--r-- | rpms/sugar/journal-0003-reindex-translations.patch | 34 | ||||
-rw-r--r-- | rpms/sugar/sugar.spec | 12 |
8 files changed, 305 insertions, 4 deletions
diff --git a/rpms/sugar/backup-0001-Volumes-Backup-and-Restore.patch b/rpms/sugar/backup-0001-Volumes-Backup-and-Restore.patch index 0cafc79..489b185 100644..100755 --- a/rpms/sugar/backup-0001-Volumes-Backup-and-Restore.patch +++ b/rpms/sugar/backup-0001-Volumes-Backup-and-Restore.patch @@ -99,7 +99,7 @@ index 0000000..4f3ec8a + os.makedirs(backup_path) + +#datastore.freeze() -+subprocess.call(['pkill', '-9', '-f', 'python.*datastore-service']) ++#subprocess.call(['pkill', '-9', '-f', 'python.*datastore-service']) + +result = 0 +try: @@ -461,7 +461,7 @@ index 0000000..8217973 + + def __init__(self, volume_path): + ProcessDialog.__init__(self, 'journal-backup-volume', \ -+ [volume_path, misc.get_backup_identifier()]) ++ [volume_path, misc.get_backup_identifier()], restart_after=False) + + self._resetup_information(volume_path) + diff --git a/rpms/sugar/backup-0002-Journal-XS-backup-and-restore.patch b/rpms/sugar/backup-0002-Journal-XS-backup-and-restore.patch index 3fb69a1..3fb69a1 100644..100755 --- a/rpms/sugar/backup-0002-Journal-XS-backup-and-restore.patch +++ b/rpms/sugar/backup-0002-Journal-XS-backup-and-restore.patch diff --git a/rpms/sugar/backup-0005-save-lease.patch b/rpms/sugar/backup-0005-save-lease.patch index 6aa278f..bea2937 100644..100755 --- a/rpms/sugar/backup-0005-save-lease.patch +++ b/rpms/sugar/backup-0005-save-lease.patch @@ -31,7 +31,7 @@ index 4f3ec8a..fe13004 100644 + open(os.path.join(volume_path, 'lease.sig'), 'a+').write(lease_content) + #datastore.freeze() - subprocess.call(['pkill', '-9', '-f', 'python.*datastore-service']) + #subprocess.call(['pkill', '-9', '-f', 'python.*datastore-service']) -- 1.6.0.4 diff --git a/rpms/sugar/discard_network_connections.patch b/rpms/sugar/discard_network_connections.patch new file mode 100644 index 0000000..8a0943c --- /dev/null +++ b/rpms/sugar/discard_network_connections.patch @@ -0,0 +1,46 @@ +From: Daniel Castelo + +diff -u -r -N sugar-0.88.1-copy/extensions/cpsection/network/model.py sugar-0.88.1/extensions/cpsection/network/model.py +--- sugar-0.88.1-copy/extensions/cpsection/network/model.py 2010-02-20 14:47:08.000000000 -0200 ++++ sugar-0.88.1/extensions/cpsection/network/model.py 2010-07-28 19:55:53.067894000 -0300 +@@ -15,10 +15,15 @@ + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + # + ++import logging ++import os ++ + import dbus + from gettext import gettext as _ + import gconf + ++from sugar import env ++ + _NM_SERVICE = 'org.freedesktop.NetworkManager' + _NM_PATH = '/org/freedesktop/NetworkManager' + _NM_IFACE = 'org.freedesktop.NetworkManager' +@@ -116,7 +121,15 @@ + def clear_networks(): + """Clear saved passwords and network configurations. + """ +- pass ++ profile_path = env.get_profile_path() ++ config_path = os.path.join(profile_path, 'nm', 'connections.cfg') ++ config_file = open(config_path, 'w') ++ try: ++ config_file.write('') ++ except: ++ logging.exception('Can not write %s', config_path) ++ f.close() ++ return 1 + + def get_publish_information(): + client = gconf.client_get_default() +diff -u -r -N sugar-0.88.1-copy/extensions/cpsection/network/view.py sugar-0.88.1/extensions/cpsection/network/view.py +--- sugar-0.88.1-copy/extensions/cpsection/network/view.py 2010-02-20 14:47:08.000000000 -0200 ++++ sugar-0.88.1/extensions/cpsection/network/view.py 2010-07-28 19:54:18.746893000 -0300 +@@ -248,3 +248,4 @@ + + def __network_configuration_reset_cb(self, widget): + self._model.clear_networks() ++ self.needs_restart = True diff --git a/rpms/sugar/journal-0001-Processdialog-prerequisite-check-support.patch b/rpms/sugar/journal-0001-Processdialog-prerequisite-check-support.patch new file mode 100644 index 0000000..8a6df3c --- /dev/null +++ b/rpms/sugar/journal-0001-Processdialog-prerequisite-check-support.patch @@ -0,0 +1,89 @@ +From 7f2cd2fefc6bd4cf118dbc880ac4b3b6f180f2b1 Mon Sep 17 00:00:00 2001 +From: Martin Abente <mabente@paraguayeduca.org> +Date: Thu, 29 Jul 2010 17:20:45 -0400 +Subject: [PATCH] Processdialog prerequisite check support +Organization: Paraguay Educa + +--- + src/jarabe/journal/processdialog.py | 23 ++++++++++++++++++++--- + 1 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/src/jarabe/journal/processdialog.py b/src/jarabe/journal/processdialog.py +index 08c6d11..181174d 100644 +--- a/src/jarabe/journal/processdialog.py ++++ b/src/jarabe/journal/processdialog.py +@@ -48,6 +48,7 @@ class ProcessDialog(gtk.Window): + self._start_message = _('Running') + self._failed_message = _('Failed') + self._finished_message = _('Finished') ++ self._prerequisite_message = ('Prerequisites were not met') + + self.set_border_width(style.LINE_WIDTH) + width = gtk.gdk.screen_width() +@@ -125,7 +126,7 @@ class ProcessDialog(gtk.Window): + + self._close_button = gtk.Button() + self._close_button.set_image(icon) +- self._close_button.set_label(_('Cancel')) ++ self._close_button.set_label(_('Close')) + self._close_button.connect('clicked', self.__close_cb) + self._close_button.show() + +@@ -165,12 +166,18 @@ class ProcessDialog(gtk.Window): + self.destroy() + + def __start_cb(self, button): +- self._process_management.do_process([self._process_script] + self._process_params) ++ if self._check_prerequisites(): ++ self._process_management.do_process([self._process_script] + self._process_params) ++ else: ++ self._set_status_failed(self, error_message=self._prerequisite_message) + + def __restart_cb(self, button): + session_manager = get_session_manager() + session_manager.logout() + ++ def _check_prerequisites(self): ++ return True ++ + def _set_status_started(self, model, data=None): + self._message.set_markup(self._start_message) + +@@ -199,12 +206,13 @@ class ProcessDialog(gtk.Window): + else: + self._close_button.show() + +- def _set_status_failed(self, model, error_message=''): ++ def _set_status_failed(self, model=None, error_message=''): + self._message.set_markup('%s %s' % (self._failed_message, error_message)) + + self._progress_bar.hide() + self._start_button.show() + self._close_button.show() ++ self._restart_button.hide() + + logging.error(error_message) + +@@ -246,6 +254,11 @@ class VolumeRestoreDialog(ProcessDialog): + self._message.set_markup('%s %s.\n\n' % (_('Journal content will be restored from'), volume_path) + \ + '<big><b>%s</b> %s</big>' % (_('Warning:'), _('Current Journal content will be deleted!'))) + ++ self._prerequisite_message = _(', please close all the running activities.') ++ ++ def _check_prerequisites(self): ++ return len(shell.get_model()) <= 1 ++ + class XSBackupDialog(ProcessDialog): + + def __init__(self, xs_hostname): +@@ -276,3 +289,7 @@ class XSRestoreDialog(ProcessDialog): + + self._message.set_text('%s %s.' % (_('Journal content will be restored from'), xs_hostname)) + ++ self._prerequisite_message = _(', please close all the running activities.') ++ ++ def _check_prerequisites(self): ++ return len(shell.get_model()) <= 1 +-- +1.6.0.4 + diff --git a/rpms/sugar/journal-0002-reindex.patch b/rpms/sugar/journal-0002-reindex.patch new file mode 100644 index 0000000..656856d --- /dev/null +++ b/rpms/sugar/journal-0002-reindex.patch @@ -0,0 +1,122 @@ +diff --git a/bin/Makefile.am b/bin/Makefile.am +index 8cc87b5..b0be3d9 100644 +--- a/bin/Makefile.am ++++ b/bin/Makefile.am +@@ -7,7 +7,8 @@ python_scripts = \ + sugar-session \ + sugar-ui-check \ + journal-backup-volume \ +- journal-restore-volume ++ journal-restore-volume \ ++ journal-reindex + + bin_SCRIPTS = \ + sugar \ +diff --git a/bin/journal-reindex b/bin/journal-reindex +new file mode 100644 +index 0000000..29e64ff +--- /dev/null ++++ b/bin/journal-reindex +@@ -0,0 +1,39 @@ ++#!/usr/bin/env python ++# Copyright (C) 2010, Plan Ceibal <comunidad@plan.ceibal.edu.uy> ++# ++# 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 3 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 program. If not, see <http://www.gnu.org/licenses/>. ++# ++ ++import os ++import subprocess ++from gettext import gettext as _ ++from sugar import env ++import logging ++ ++logging.debug('Reindex started') ++ ++reindex_file = os.path.join(env.get_profile_path(), 'datastore/index_updated') ++ ++subprocess.call(['pkill', '-9', '-f', 'python.*datastore-service']) ++ ++if os.path.exists(reindex_file): ++ result = 0 ++ try: ++ os.remove(reindex_file) ++ except Exception, e: ++ logging.error(_('Reindex failed: %s'), str(e)) ++ result = 1 ++ ++logging.debug('Reindex finished') ++exit(result) +diff --git a/src/jarabe/journal/processdialog.py b/src/jarabe/journal/processdialog.py +index 181174d..f5f9c5d 100644 +--- a/src/jarabe/journal/processdialog.py ++++ b/src/jarabe/journal/processdialog.py +@@ -293,3 +293,22 @@ class XSRestoreDialog(ProcessDialog): + + def _check_prerequisites(self): + return len(shell.get_model()) <= 1 ++ ++class ReindexDialog(ProcessDialog): ++ def __init__(self): ++ ProcessDialog.__init__(self, 'journal-reindex') ++ self._resetup_information() ++ ++ def _resetup_information(self): ++ self._start_message = '%s.' % (_('Please wait, repair journal content')) ++ ++ self._finished_message = _('The journal content has been reindexed.') ++ ++ self._title.set_markup('<big><b>%s</b></big>' % _('Repair')) ++ ++ self._message.set_text('%s.' % (_('Journal content will be reindexed'))) ++ ++ self._prerequisite_message = _(', please close all the running activities.') ++ ++ def _check_prerequisites(self): ++ return len(shell.get_model()) <= 1 +diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py +index f6e5456..95c41a8 100644 +--- a/src/jarabe/view/palettes.py ++++ b/src/jarabe/view/palettes.py +@@ -33,7 +33,7 @@ from sugar.graphics.xocolor import XoColor + from sugar.activity import activityfactory + from sugar.activity.activityhandle import ActivityHandle + +-from jarabe.journal.processdialog import VolumeBackupDialog, VolumeRestoreDialog, XSBackupDialog, XSRestoreDialog ++from jarabe.journal.processdialog import VolumeBackupDialog, VolumeRestoreDialog, XSBackupDialog, XSRestoreDialog, ReindexDialog + from jarabe.model import shell + from jarabe.view import launcher + from jarabe.view.viewsource import setup_view_source +@@ -188,6 +188,22 @@ class JournalPalette(BasePalette): + self.menu.append(menu_item) + menu_item.show() + ++ menu_item_reindex = MenuItem(_('Repair')) ++ ++ icon_reindex = Icon(icon_name='journal-reindex', ++ icon_size=gtk.ICON_SIZE_MENU) ++ menu_item_reindex.set_image(icon_reindex) ++ icon_reindex.show() ++ ++ menu_item_reindex.connect('activate', self.__reindex_activate_cb) ++ self.menu.append(menu_item_reindex) ++ menu_item_reindex.show() ++ ++ def __reindex_activate_cb(self, menu_item): ++ dialog = ReindexDialog() ++ dialog.show() ++ ++ + def __open_activate_cb(self, menu_item): + self._home_activity.get_window().activate(gtk.get_current_event_time()) + diff --git a/rpms/sugar/journal-0003-reindex-translations.patch b/rpms/sugar/journal-0003-reindex-translations.patch new file mode 100644 index 0000000..a753641 --- /dev/null +++ b/rpms/sugar/journal-0003-reindex-translations.patch @@ -0,0 +1,34 @@ +diff -u -r -N sugar-0.88.1.original/po/es.po sugar-0.88.1/po/es.po +--- sugar-0.88.1.original/po/es.po 2010-07-29 11:56:19.126759310 -0300 ++++ sugar-0.88.1/po/es.po 2010-07-29 12:36:42.310734269 -0300 +@@ -1411,6 +1411,30 @@ + msgid "View source: %r" + msgstr "Ver código fuente: %r" + ++#: ../src/jarabe/view/palettes.py:201 ++msgid "Repair" ++msgstr "Reparar" ++ ++#: ../src/jarabe/journal/processdialog.py:286 ++msgid "Please wait, repair journal content" ++msgstr "Espere por favor, reparando el contenido del Diario" ++ ++#: ../src/jarabe/journal/processdialog.py:288 ++msgid "The journal content has been reindexed." ++msgstr "El contenido del Diario se ha reindexado." ++ ++#: ../src/jarabe/journal/processdialog.py:292 ++msgid "Journal content will be repaired" ++msgstr "El contenido del Diario será reparado" ++ ++#: ../bin/jorunal-reindex:32 ++msgid "Reindex failed: %s" ++msgstr "Falló al reindexar: %s" ++ ++#: ../bin/jorunal-reindex:35 ++msgid "File does not exist." ++msgstr "No existe el archivo." ++ + #~ msgid "Cannot obtain data needed for registration." + #~ msgstr "No se puede obtener datos necesarios para el registro" + diff --git a/rpms/sugar/sugar.spec b/rpms/sugar/sugar.spec index 0b234b1..37fc88d 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.23dxr%{?dist} +Release: 5.24dxo%{?dist} URL: http://sugarlabs.org/ Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2 @@ -30,6 +30,8 @@ Patch16: journal-xobundle-removal-wont-remove-installed-one.patch Patch18: disconnect-icon-in-wifi-palette-1736.patch Patch19: improve-activity-updater-icon.patch Patch20: indicate-inactive-state-in-mesh-device-icon.patch +Patch21: discard_network_connections.patch +#Patch22: sl1814-consolidate-activity-launch-entry-point.patch # Andres' journal filesize enhancement Patch101: sizelist-0001-Journal-Retrieve-filesize-from-the-datastore.patch @@ -49,6 +51,9 @@ Patch202: backup-0002-Journal-XS-backup-and-restore.patch #Patch203: backup-0003-Journal-documents-volume-button.patch #Patch204: backup-0004-es-translations.patch Patch205: backup-0005-save-lease.patch +Patch206: journal-0001-Processdialog-prerequisite-check-support.patch +Patch207: journal-0002-reindex.patch +Patch208: journal-0003-reindex-translations.patch # experimental patches Patch500: sl2006-touchpad-device-on-frame.patch @@ -145,6 +150,8 @@ multiple instances of sugar. %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 +#%patch22 -p1 %patch101 -p1 %patch102 -p1 @@ -162,6 +169,9 @@ multiple instances of sugar. #%patch203 -p1 #%patch204 -p1 %patch205 -p1 +%patch206 -p1 +%patch207 -p1 +%patch208 -p1 %patch500 -p1 %patch501 -p1 |