This could be fixed by fixing #760341 so that pastebinit defaults to
paste.debian.net The root cause of that is lsb-release doesn't support
Python 3, breaking the distro detection.

The attached patch works around that by using platform to detect the
distribution instead.

Thanks,

-- Andrew Starr-Bochicchio

   Ubuntu Developer <https://launchpad.net/~andrewsomething>
   Debian Developer <http://qa.debian.org/developer.php?login=asb>
   PGP/GPG Key ID: D53FDCB1
From c8d33415abf8d07b3b2bcb41bb088a03b882a7cb Mon Sep 17 00:00:00 2001
From: Andrew Starr-Bochicchio <a...@debian.org>
Date: Mon, 16 Feb 2015 12:45:05 -0500
Subject: [PATCH] detect_distro_with_python3.patch: Use platform instead of
 lsb_release to detect the distro as lsb_release is not available under Python
 3 (Closes: #760341). pastebinit will now default to using paste.debian.net on
 Debian (Closes: #778336).

---
 debian/changelog                                | 11 +++++++++++
 debian/patches/detect_distro_with_python3.patch | 15 +++++++++++++++
 debian/patches/series                           |  1 +
 3 files changed, 27 insertions(+)
 create mode 100644 debian/patches/detect_distro_with_python3.patch

diff --git a/debian/changelog b/debian/changelog
index 7de6407..c2d3758 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+pastebinit (1.4-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * detect_distro_with_python3.patch: Use platform instead of
+    lsb_release to detect the distro as lsb_release is not
+    available under Python 3 (Closes: #760341). pastebinit
+    will now default to using paste.debian.net on Debian
+    (Closes: #778336).
+
+ -- Andrew Starr-Bochicchio <a...@debian.org>  Mon, 16 Feb 2015 12:40:55 -0500
+
 pastebinit (1.4-3) unstable; urgency=low
 
   * bump debhelper to version 9
diff --git a/debian/patches/detect_distro_with_python3.patch b/debian/patches/detect_distro_with_python3.patch
new file mode 100644
index 0000000..e0737c3
--- /dev/null
+++ b/debian/patches/detect_distro_with_python3.patch
@@ -0,0 +1,15 @@
+Index: pastebinit/pastebinit
+===================================================================
+--- pastebinit.orig/pastebinit	2015-02-16 12:37:04.434846203 -0500
++++ pastebinit/pastebinit	2015-02-16 12:39:22.709104460 -0500
+@@ -37,8 +37,8 @@
+ 
+ # Now try to override it with a distributor pastebin
+ try:
+-    import lsb_release
+-    release = lsb_release.get_distro_information()['ID'].lower()
++    import platform
++    release = platform.linux_distribution()[0].lower()
+     if release == 'debian':
+         defaultPB = "http://paste.debian.net";
+     elif release == 'fedora':
diff --git a/debian/patches/series b/debian/patches/series
index 986704d..b17e68f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 upstream-r205_r201.patch
 increase_timeout.patch
+detect_distro_with_python3.patch
-- 
2.1.0

Reply via email to