Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/wgetpaste/, app-text/wgetpaste/files/
Date: Mon, 26 Aug 2019 23:14:41
Message-Id: 1566861170.dead0ce4020de9e4d2cc394b122f2ac03346010b.sbraz@gentoo
1 commit: dead0ce4020de9e4d2cc394b122f2ac03346010b
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 26 23:11:34 2019 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 26 23:12:50 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dead0ce4
7
8 app-text/wgetpaste: backport upstream's patch to fix bpaste.net
9
10 Package-Manager: Portage-2.3.71, Repoman-2.3.16
11 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
12
13 .../files/wgetpaste-2.29-fix-bpaste.patch | 40 ++++++++++++++++++++++
14 app-text/wgetpaste/wgetpaste-2.29-r1.ebuild | 29 ++++++++++++++++
15 2 files changed, 69 insertions(+)
16
17 diff --git a/app-text/wgetpaste/files/wgetpaste-2.29-fix-bpaste.patch b/app-text/wgetpaste/files/wgetpaste-2.29-fix-bpaste.patch
18 new file mode 100644
19 index 00000000000..0af9a6f855d
20 --- /dev/null
21 +++ b/app-text/wgetpaste/files/wgetpaste-2.29-fix-bpaste.patch
22 @@ -0,0 +1,40 @@
23 +From 6175f89cb618fef83882ed86ab049a7fd1035770 Mon Sep 17 00:00:00 2001
24 +From: =?UTF-8?q?Bo=20=C3=98rsted=20Andresen?= <zlin@×××××××.org>
25 +Date: Tue, 23 Jul 2019 00:16:19 +0200
26 +Subject: [PATCH] Fix handling of bpaste urls.
27 +
28 +---
29 + wgetpaste | 9 +++++++--
30 + 1 file changed, 7 insertions(+), 2 deletions(-)
31 +
32 +diff --git a/wgetpaste b/wgetpaste
33 +index 585fcd9..99eb7f1 100755
34 +--- a/wgetpaste
35 ++++ b/wgetpaste
36 +@@ -181,7 +181,8 @@ xml+cheetah xml+django xml+evoque xml+lasso xml+mako xml+myghty xml+php xml+erb
37 + xml+velocity xml xquery xslt xtend yaml"
38 + EXPIRATIONS_pinnwand="1day 1week 1month never"
39 + POST_pinnwand="submit=Paste! % % lexer expiry % code"
40 +-REGEX_RAW_pinnwand='s|^\(https\?://[^/]*/\)show\(/[[:alnum:]]*/\?\)$|\1raw\2|'
41 ++REGEX_LOC_pinnwand="\(/show/[^ ]*\).*$|https://bpaste.net\1"
42 ++REGEX_RAW_pinnwand='s|^\(https\?://[^/]*/\)show\(/[^ ]*/\?\)$|\1raw\2|'
43 +
44 + ### errors
45 + die() {
46 +@@ -550,11 +551,15 @@ postdata() {
47 +
48 + # get url from response from server
49 + geturl() {
50 +- local regex
51 ++ local regex location
52 + regex=REGEX_URL_$ENGINE
53 ++ location=REGEX_LOC_$ENGINE
54 + if [[ -n ${!regex} ]]; then
55 + [[ needstdout = $1 ]] && return 0
56 + sed -n -e "${!regex}" <<< "$*"
57 ++ elif [[ -n ${!location} ]]; then
58 ++ [[ needstdout = $1 ]] && return 1
59 ++ sed -n -e "s|^.*Location: ${!location}|p" <<< "$*"
60 + else
61 + [[ needstdout = $1 ]] && return 1
62 + sed -n -e 's|^.*Location: \(https\{0,1\}://[^ ]*\).*$|\1|p' <<< "$*"
63
64 diff --git a/app-text/wgetpaste/wgetpaste-2.29-r1.ebuild b/app-text/wgetpaste/wgetpaste-2.29-r1.ebuild
65 new file mode 100644
66 index 00000000000..175617a320c
67 --- /dev/null
68 +++ b/app-text/wgetpaste/wgetpaste-2.29-r1.ebuild
69 @@ -0,0 +1,29 @@
70 +# Copyright 1999-2019 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI="7"
74 +
75 +DESCRIPTION="Command-line interface to various pastebins"
76 +HOMEPAGE="http://wgetpaste.zlin.dk/"
77 +SRC_URI="http://wgetpaste.zlin.dk/${P}.tar.bz2"
78 +
79 +LICENSE="public-domain"
80 +SLOT="0"
81 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
82 +IUSE="+ssl"
83 +
84 +DEPEND=""
85 +RDEPEND="net-misc/wget[ssl?]"
86 +
87 +PATCHES=( "${FILESDIR}/${P}-fix-bpaste.patch" )
88 +
89 +src_prepare() {
90 + sed -i -e "s:/etc:\"${EPREFIX}\"/etc:g" wgetpaste || die
91 + default
92 +}
93 +
94 +src_install() {
95 + dobin ${PN}
96 + insinto /usr/share/zsh/site-functions
97 + doins _wgetpaste
98 +}