Source: python-gmusicapi
Version: 12.1.1-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
python-gmusicapi could not be built reproducibly.

This is because the documentation embedded the build user's home
directory (via the XDG config directory).

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0001-reproducible-build.patch      1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/0001-reproducible-build.patch      2020-01-06 
11:17:34.809013127 +0000
@@ -0,0 +1,44 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2020-01-06
+
+--- python-gmusicapi-12.1.1.orig/gmusicapi/clients/mobileclient.py
++++ python-gmusicapi-12.1.1/gmusicapi/clients/mobileclient.py
+@@ -150,7 +150,7 @@ class Mobileclient(_OAuthClient):
+ 
+         return True
+ 
+-    def oauth_login(self, device_id, oauth_credentials=OAUTH_FILEPATH, 
locale='en_US'):
++    def oauth_login(self, device_id, oauth_credentials=None, locale='en_US'):
+         """Authenticates the mobileclient with pre-existing OAuth credentials.
+         Returns ``True`` on success, ``False`` on failure.
+ 
+@@ -178,6 +178,8 @@ class Mobileclient(_OAuthClient):
+           used to localize certain responses. This must be a locale supported
+           by Android. Defaults to ``'en_US'``.
+         """
++        if oauth_credentials is None:
++            oauth_credentials = OAUTH_FILEPATH
+         self._authtype = 'oauth'
+         session_login = partial(self._oauth_login, oauth_credentials)
+         return self._login(session_login, device_id, locale)
+--- python-gmusicapi-12.1.1.orig/gmusicapi/clients/musicmanager.py
++++ python-gmusicapi-12.1.1/gmusicapi/clients/musicmanager.py
+@@ -52,7 +52,7 @@ class Musicmanager(_OAuthClient):
+                                            validate,
+                                            verify_ssl)
+ 
+-    def login(self, oauth_credentials=OAUTH_FILEPATH,
++    def login(self, oauth_credentials=None,
+               uploader_id=None, uploader_name=None):
+         """Authenticates the Music Manager using OAuth.
+         Returns ``True`` on success, ``False`` on failure.
+@@ -103,6 +103,8 @@ class Musicmanager(_OAuthClient):
+         have been limits on deauthorizing devices in the past, so it's smart 
not to register
+         more devices than necessary.
+         """
++        if oauth_credentals is None:
++            oauth_credentials = OAUTH_FILEPATH
+ 
+         return (self._oauth_login(oauth_credentials) and
+                 self._perform_upauth(uploader_id, uploader_name))
--- a/debian/patches/series     1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series     2020-01-06 10:57:46.725512965 +0000
@@ -0,0 +1 @@
+0001-reproducible-build.patch

Reply via email to