From e380e4a200731b1b9167157a17b823f33766f9d2 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Thu, 3 May 2012 19:05:07 -0400 Subject: [PATCH] aur/pianobar to 2012.04.24-1 --- aur/pianobar/PKGBUILD | 13 +++++--- aur/pianobar/protocol-fix.patch | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 aur/pianobar/protocol-fix.patch diff --git a/aur/pianobar/PKGBUILD b/aur/pianobar/PKGBUILD index 9b52f71c0..220312bb4 100644 --- a/aur/pianobar/PKGBUILD +++ b/aur/pianobar/PKGBUILD @@ -3,20 +3,25 @@ plugrel=1 pkgname=pianobar -pkgver=2012.01.10 +pkgver=2012.04.24 pkgrel=2 pkgdesc="console-based frontend for Pandora (official version)" url="http://6xq.net/0017" arch=('i686' 'x86_64') license=('MIT') depends=('libao' 'faad2' 'libmad' 'gnutls') -source=(http://6xq.net/media/00/16/pianobar-$pkgver.tar.bz2) - +source=(http://6xq.net/media/00/16/pianobar-$pkgver.tar.bz2 + protocol-fix.patch) +sha256sums=('1286005b14ef58ea5b7baece054e772761e6351fdeceadd3a69e0a7c8b9bf28e' + '39f30666783d28ccb0bdfe985738bb06c9545e6f0f42e3eba905da2d202de2f7') _builddir="$pkgname-$pkgver" build() { cd "$_builddir" + # temporary fix from https://gist.github.com/2500616/654f1869da5698696ce60cb8a7fe3cae0f4dfd25 + patch -p 1 -i ../protocol-fix.patch + make } @@ -26,5 +31,3 @@ package() { make DESTDIR=$pkgdir PREFIX=/usr install install -vDm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } - -md5sums=('448c57d65c71158674e8b30a8cfa217e') diff --git a/aur/pianobar/protocol-fix.patch b/aur/pianobar/protocol-fix.patch new file mode 100644 index 000000000..bf2fc7c33 --- /dev/null +++ b/aur/pianobar/protocol-fix.patch @@ -0,0 +1,58 @@ +diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c +index 342e4ec..b70477e 100644 +--- a/src/libpiano/piano.c ++++ b/src/libpiano/piano.c +@@ -42,7 +42,7 @@ THE SOFTWARE. + #include "crypt.h" + #include "config.h" + +-#define PIANO_PROTOCOL_VERSION "33" ++#define PIANO_PROTOCOL_VERSION "34" + #define PIANO_RPC_HOST "www.pandora.com" + #define PIANO_RPC_PORT "80" + #define PIANO_RPC_PATH "/radio/xmlrpc/v" PIANO_PROTOCOL_VERSION "?" +@@ -272,6 +272,7 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, + "" + "listener.authenticateListener" + "%lu" ++ "" + /* user */ + "%s" + /* password */ +diff --git a/src/main.c b/src/main.c +index 43f3ffc..9a637cf 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -77,10 +77,31 @@ static bool BarMainLoginUser (BarApp_t *app) { + WaitressReturn_t wRet; + PianoRequestDataLogin_t reqData; + bool ret; ++ WaitressHandle_t waithSync; ++ char *syncTime; ++ unsigned long int syncTimeInt; ++ ++ /* skip sync step by fetching time from somewhere else */ ++ WaitressInit (&waithSync); ++ WaitressSetUrl (&waithSync, "http://ridetheclown.com/s2/synctime.php"); ++ if (app->settings.proxy != NULL && strlen (app->settings.proxy) > 0) { ++ WaitressSetProxy (&waithSync, app->settings.proxy); ++ } ++ wRet = WaitressFetchBuf (&waithSync, &syncTime); ++ WaitressFree (&waithSync); ++ if (wRet != WAITRESS_RET_OK) { ++ BarUiMsg (&app->settings, MSG_ERR, "Unable to sync: %s\n", ++ WaitressErrorToStr (wRet)); ++ return false; ++ } ++ ++ syncTimeInt = strtoul (syncTime, NULL, 0); ++ app->ph.timeOffset = time (NULL) - syncTimeInt; ++ free (syncTime); + + reqData.user = app->settings.username; + reqData.password = app->settings.password; +- reqData.step = 0; ++ reqData.step = 1; + + BarUiMsg (&app->settings, MSG_INFO, "Login... "); + ret = BarUiPianoCall (app, PIANO_REQUEST_LOGIN, &reqData, &pRet, &wRet);