[libkgapi] 0.4.0-5
Rex Dieter
rdieter at fedoraproject.org
Wed Jun 20 16:09:24 UTC 2012
commit b25223ed8b60468d5ff2755a391cfec15a3b1728
Author: Rex Dieter <rdieter at fedoraproject.org>
Date: Wed Jun 20 11:12:31 2012 -0500
0.4.0-5
- -devel: tighten subpkg dep via %_isa, Req: kdepimlibs-devel
- Parsing token page failed (kde#301240)
libkgapi-0.4.0-auth_token.patch | 40 +++++++++++++++++++++++++++++++++++++++
libkgapi.spec | 18 ++++++++++++++--
2 files changed, 55 insertions(+), 3 deletions(-)
---
diff --git a/libkgapi-0.4.0-auth_token.patch b/libkgapi-0.4.0-auth_token.patch
new file mode 100644
index 0000000..d91c93d
--- /dev/null
+++ b/libkgapi-0.4.0-auth_token.patch
@@ -0,0 +1,40 @@
+commit 5c92e2fb5ced528a20fd1d8723fd7a8d7ba686a3
+Author: Dan Vrátil <dan at progdan.cz>
+Date: Wed Jun 6 00:36:46 2012 +0200
+
+ Parse OAuth code from page title instead of body
+
+ The OAuth code used for obtaining access tokens is provided
+ in webpage <title> as a string. The title is guaranteed not to change
+ syntax, while the body of the page, from which we were parsing the token
+ before, can change anytime, which breaks the authentication process.
+
+ BUG: 301240
+ FIXED-IN: 0.4.1
+
+diff --git a/libkgapi/ui/authwidget_p.cpp b/libkgapi/ui/authwidget_p.cpp
+index 57d914c..55e77cb 100644
+--- a/libkgapi/ui/authwidget_p.cpp
++++ b/libkgapi/ui/authwidget_p.cpp
+@@ -147,13 +147,18 @@ void AuthWidgetPrivate::webviewFinished()
+ }
+
+ if (url.host() == "accounts.google.com" && url.path() == "/o/oauth2/approval") {
+- QWebElement el = webview->page()->mainFrame()->findFirstElement("textarea");
+- if (el.isNull()) {
++ QString title = webview->title();
++ QString token;
++
++ if (title.startsWith(QLatin1String("success"), Qt::CaseInsensitive)) {
++ int pos = title.indexOf(QLatin1String("code="));
++ /* Skip the 'code=' string as well */
++ token = title.mid (pos + 5);
++ } else {
+ emitError(KGAPI::AuthError, i18n("Parsing token page failed."));
+ return;
+ }
+
+- QString token = el.toInnerXml();
+ if (token.isEmpty()) {
+ emitError(KGAPI::AuthError, i18n("Failed to obtain token."));
+ return;
diff --git a/libkgapi.spec b/libkgapi.spec
index 60cb51a..8eddd79 100644
--- a/libkgapi.spec
+++ b/libkgapi.spec
@@ -2,7 +2,7 @@
Name: libkgapi
Version: 0.4.0
#Release: 1.20120530git%%{git_commit}%%{?dist}
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Library to access to Google services
Group: Development/Libraries
@@ -21,6 +21,10 @@ URL: http://www.progdan.cz/2012/05/libkgoogle-libkgapi
#Source0: %%{name}-%%{version}-git%%{git_commit}.tar.gz
Source0: http://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.bz2
+## upstream patches
+# https://projects.kde.org/projects/kdereview/libkgoogle/repository/revisions/5c92e2fb5ced528a20fd1d8723fd7a8d7ba686a3
+Patch100: libkgapi-0.4.0-auth_token.patch
+
BuildRequires: kdepimlibs-devel
BuildRequires: kdelibs4-devel
BuildRequires: pkgconfig(QJson)
@@ -28,7 +32,7 @@ BuildRequires: pkgconfig(QJson)
Obsoletes: libkgoogle < 0.3.2
Provides: libkgoogle = %{version}-%{release}
-%{?_kde4_macros_api:Requires: kde4-macros(api) = %{_kde4_macros_api} }
+%{?_kde4_version:Requires: kdepimlibs%{?_isa} >= %{_kde4_version}}
%description
Library to access to Google services, this package is needed by kdepim-runtime
@@ -38,7 +42,8 @@ to build akonadi-google resources.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: kdepimlibs-devel
Obsoletes: libkgoogle-devel < 0.3.2
Provides: libkgoogle-devel = %{version}-%{release}
%description devel
@@ -49,6 +54,8 @@ resources.
%prep
%setup -q
+%patch100 -p1 -b .auth_token
+
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
@@ -79,6 +86,11 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%changelog
+* Wed Jun 20 2012 Rex Dieter <rdieter at fedoraproject.org>
+- 0.4.0-5
+- -devel: tighten subpkg dep via %%_isa, Req: kdepimlibs-devel
+- Parsing token page failed (kde#301240)
+
* Sun Jun 10 2012 Rex Dieter <rdieter at fedoraproject.org> 0.4.0-4
- -devel: track files closer
- pkgconfig-style deps
More information about the scm-commits
mailing list