[fpaste] Add a patch to make private url default and to use expire option

Athmane Madjoudj athmane at fedoraproject.org
Thu Feb 28 23:52:20 UTC 2013


commit bca35abdd33d220159d1052a59e0e4a1f69c183d
Author: Athmane Madjoudj <athmane at fedoraproject.org>
Date:   Fri Mar 1 00:49:43 2013 +0100

    Add a patch to make private url default and to use expire option

 fpaste-default-private-and-use-expire-option.patch |   22 ++++++++++++++++++++
 fpaste.spec                                        |    8 ++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/fpaste-default-private-and-use-expire-option.patch b/fpaste-default-private-and-use-expire-option.patch
new file mode 100644
index 0000000..175065c
--- /dev/null
+++ b/fpaste-default-private-and-use-expire-option.patch
@@ -0,0 +1,22 @@
+--- fpaste.orig	2013-02-28 18:39:13.000000000 +0100
++++ fpaste	2013-02-28 18:35:20.000000000 +0100
+@@ -81,7 +81,7 @@
+     if len(author) > 30:
+         author = author[0:30-3] + "..."
+ 
+-    params = urllib.urlencode({'paste_lang': options.lang, 'paste_data': text, 'api_submit': 'true', 'mode': 'json'})
++    params = urllib.urlencode({'paste_lang': options.lang, 'paste_data': text, 'paste_private':'yes', 'paste_expire': options.expires, 'api_submit': 'true', 'mode': 'json'})
+     pasteSizeKiB = len(params)/1024.0
+ 
+     if pasteSizeKiB >= 512:   # 512KiB appears to be the current hard limit (20110404); old limit was 16MiB
+@@ -116,8 +116,8 @@
+     id = [i[1]["id"] for i in response.iteritems()].pop()
+ #        for k,j in i.iteritems():
+ #            print j, k
+-
+-    url = "{0}{1}".format(FPASTE_URL, id)
++    private_hash = [i[1]["hash"] for i in response.iteritems()].pop()
++    url = "{0}{1}/{2}".format(FPASTE_URL, id, private_hash)
+     return url
+ 
+ #    url = f.geturl()
diff --git a/fpaste.spec b/fpaste.spec
index f5f62bc..5217da7 100644
--- a/fpaste.spec
+++ b/fpaste.spec
@@ -1,6 +1,6 @@
 Name:		fpaste
 Version:	0.3.7.1
-Release:	5%{?dist}
+Release:	6%{?dist}
 Summary:	A simple tool for pasting info onto fpaste.org
 BuildArch:	noarch
 Group:		Applications/Internet
@@ -17,6 +17,8 @@ Patch0:     %{name}-0.3.7.1-fedora-production.patch
 # https://fedorahosted.org/fpaste/ticket/6
 Patch1:     %{name}-0.3.7.1-remove-smolt-code.patch
 
+Patch2:     %{name}-default-private-and-use-expire-option.patch
+
 %description
 It is often useful to be able to easily paste text to the Fedora
 Pastebin at http://fpaste.org and this simple script will do that
@@ -31,6 +33,7 @@ be unable to paste something into the pastebin
 # Patching order is important
 %patch0 -p1
 %patch1
+%patch2
 
 %build
 #nothing required
@@ -50,6 +53,9 @@ rm -rf %{buildroot}
 %{_mandir}/man1/fpaste.1.gz
 
 %changelog
+* Fri Mar 01 2013 Athmane Madjoudj <athmane at fedoraproject.org> 0.3.7.1-6
+- Add a patch to make private url default and use expire option.
+
 * Fri Feb 01 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.3.7.1-5
 - Update patch to point to fedora fpaste production environment
 


More information about the scm-commits mailing list