[sugar] Add patch to create gnome keyring if it doesn't exist

Peter Robinson pbrobinson at fedoraproject.org
Sat May 5 10:45:27 UTC 2012


commit b869103a90fcf2d1a39978d8ac5cddb6402b29b9
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Sat May 5 11:45:16 2012 +0100

    Add patch to create gnome keyring if it doesn't exist

 sugar-gnomekeyring.patch |   31 +++++++++++++++++++++++++++++++
 sugar.spec               |    7 ++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/sugar-gnomekeyring.patch b/sugar-gnomekeyring.patch
new file mode 100644
index 0000000..756ac9a
--- /dev/null
+++ b/sugar-gnomekeyring.patch
@@ -0,0 +1,31 @@
+diff --git a/bin/sugar.in b/bin/sugar.in
+index 12098db..df27143 100644
+--- a/bin/sugar.in
++++ b/bin/sugar.in
+@@ -62,6 +62,26 @@ export LANGUAGE="${LANGUAGE:-${LANG}}"
+ # Set Sugar's telepathy accounts directory
+ export MC_ACCOUNT_DIR=$HOME/.sugar/$SUGAR_PROFILE/accounts
+
++# Check if the keyring exists and create a default
++# unencrypted keyring (OLPC #10290)
++keyring_path=$HOME/.gnome2/keyrings
++if [ ! -e $keyring_path/login.keyring ] &&
++    [ ! -e $keyring_path/default.keyring ]; then
++    mkdir -p $keyring_path
++    echo 'default' > $keyring_path/default
++    TIME=$(/bin/date +%s)
++    cat >> $keyring_path/default.keyring.tmp <<EOF
++[keyring]
++display-name=default
++ctime=$TIME
++mtime=$TIME
++lock-on-idle=false
++lock-timeout=0
++EOF
++
++mv $keyring_path/default.keyring{.tmp,}
++fi
++
+ # Workaround until gnome-keyring-daemon lets dbus activate it
+ # https://bugzilla.gnome.org/show_bug.cgi?id=628302
+ if test "$SUGAR_EMULATOR" = "yes" -a "$(type gnome-keyring-daemon)"; then
diff --git a/sugar.spec b/sugar.spec
index 78a2f83..3ac8dc5 100644
--- a/sugar.spec
+++ b/sugar.spec
@@ -3,11 +3,12 @@
 Summary: Constructionist learning platform
 Name: sugar
 Version: 0.96.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://sugarlabs.org/
 License: GPLv2+
 Group: User Interface/Desktops
 Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2
+Patch0: sugar-gnomekeyring.patch
 
 BuildRequires: gettext
 BuildRequires: GConf2-devel
@@ -66,6 +67,7 @@ multiple instances of sugar.
 
 %prep
 %setup -q
+%patch0 -p1 -b .keyring
 
 %build
 %configure
@@ -146,6 +148,9 @@ fi
 %{_datadir}/icons/hicolor/scalable/apps/sugar-xo.svg
 
 %changelog
+* Sat May  5 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 0.96.1-2
+- Add patch to create gnome keyring if it doesn't exist
+
 * Mon Apr 30 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 0.96.1-1
 - 0.96.1 stable release
 


More information about the scm-commits mailing list