Обновлен wgetpaste

atratsevskiy
Mike Khiretskiy 10 years ago
parent 6b6d16d8e2
commit b89ece5d9c

@ -1 +1,2 @@
DIST wgetpaste-2.22.tar.bz2 10842 SHA256 a903d4b93e487046226ad77037a28cb5f6cf2465bf212e5edf568c4135f6fe05 SHA512 4a9fd56b1d4924a863d10af38721469ac0116cb05b5e5e79f5ecf149ba2af69acf79a30bc66450b9363b2fa7116b20222073dc8d7bc1e7dbab79981e6ce80396 WHIRLPOOL c25fc58c0e0a01b0960ebb07e270c7c8136d1589f16eae9c1e94c614260b479abdbf5255d60d9ebe477c5acd201f0e598f69a3501cd127fb7f42e9a80b443d77
DIST wgetpaste-2.25.tar.bz2 11107 SHA256 6a7e078e6607f4fe819fc52857a601630ec0f7d2ee855d3b1cd7e75a904c40f4 SHA512 c3cd56f32311c77ce5ac970f0cd6b2e8285cac3caaf61669237ac707ed3b9aab285fbe9dee6260ea13b8df41a22acfaa3b8439298560ab68c3a568d60557d82e WHIRLPOOL ad64e1d45cb49dd70a2b33e49e81f255b304def9e4b8d8c29ac4b4161fb7cc290574686a0488a731cd36f339fde0f78da90ad439f1b771b8d5bd2f2df9cd67c3

@ -0,0 +1,189 @@
diff --git wgetpaste wgetpaste
index be8dbc7..65bb757 100755
--- wgetpaste
+++ wgetpaste
@@ -6,6 +6,8 @@
VERSION="2.25"
+DEFAULT_SERVICE="calculate"
+
# don't inherit LANGUAGE from the env
unset LANGUAGE
@@ -14,7 +16,7 @@ E=$'\e'
N=$'\n'
### services
-SERVICES="bpaste ca codepad dpaste gists poundpython"
+SERVICES="bpaste ca codepad dpaste gists poundpython calculate"
# bpaste
ENGINE_bpaste=lodgeit
URL_bpaste="http://bpaste.net/"
@@ -42,6 +44,17 @@ URL_poundpython="http://paste.pound-python.org/"
ENGINE_tinyurl=tinyurl
URL_tinyurl="http://tinyurl.com/ api-create.php"
REGEX_RAW_tinyurl='s|^\(http://[^/]*/\)\([[:alnum:]]*\)$|\1\2|'
+# calculate
+ENGINE_calculate=calculate
+if [[ "$LANG" =~ 'ru_RU' ]]; then
+ URL_calculate="http://pastebin.calculate-linux.ru"
+else
+ URL_calculate="http://pastebin.calculate-linux.org"
+fi
+DEFAULT_LANGUAGE_calculate="Text"
+DEFAULT_PARENT_calculate=""
+DEFAULT_PRIVATE_calculate=0
+SIZE_calculate="25000 25%kB"
### engines
# ca
@@ -52,12 +65,12 @@ LANGUAGE_COUNT_ca=0
EXPIRATIONS_ca="Never 5%minutes 10%minutes 15%minutes 30%minutes 45%minutes 1%hour 2%hours \
4%hours 8%hours 12%hours 1%day 2%days 3%days 1%week 2%weeks 3%weeks 1%month 2%months \
3%months 4%months 5%months 6%months 1%year"
-POST_ca="s=Submit+Post name description type expiry % content"
+POST_ca="s=Submit+Post name description type expiry % % % content"
REGEX_URL_ca='s|^.*content="[0-9]*;\(http://[^/]*/[0-9]*\)".*$|\1|p'
REGEX_RAW_ca='s|^\(http://[^/]*/\)\([0-9]*\)$|\1raw/\2|'
# codepad
LANGUAGES_codepad="C C++ D Haskell Lua OCaml PHP Perl Plain%Text Python Ruby Scheme Tcl"
-POST_codepad="submit % % lang % % code"
+POST_codepad="submit % % lang % % % % code"
REGEX_URL_codepad='s|^--.*\(http://codepad.org/[^ ]\+\)|\1|p'
REGEX_RAW_codepad='s|^\(http://[^/]*/\)\([[:alnum:]]*\)$|\1\2/raw.rb|'
# dpaste
@@ -67,7 +80,7 @@ LANGUAGE_VALUES_dpaste="% Apache Bash Css Diff DjangoTemplate Haskell JScript Py
Ruby Rhtml Sql Xml"
EXPIRATIONS_dpaste="30%days 30%days%after%last%view"
EXPIRATION_VALUES_dpaste="off on"
-POST_dpaste="submit=Paste+it poster title language hold % content"
+POST_dpaste="submit=Paste+it poster title language hold % % % content"
REGEX_RAW_dpaste='s|^\(http://[^/]*/\)[^0-9]*\([0-9]*/\)$|\1\2plain/|'
# gists
LANGUAGES_gists="ActionScript Ada Apex AppleScript Arc Arduino ASP Assembly
@@ -141,8 +154,23 @@ objective-c objective-j ocaml ooc perl php text pov prolog python python3 py3tb
ragel-c ragel-cpp ragel-d ragel-java ragel-objc ragel-ruby raw rconsole rebol redcode rst rhtml rb \
rbcon splus sass scala scheme smalltalk smarty sql sqlite3 squidconf tcl tcsh tex diff vala vb.net \
vim xml xml+cheetah xml+django xml+evoque xml+mako xml+myghty xml+php xml+erb xml+smarty xslt yaml"
-POST_lodgeit="submit=Paste! % % language % % code"
+POST_lodgeit="submit=Paste! % % language % % % % code"
REGEX_RAW_lodgeit='s|^\(http://[^/]*/\)show\(/[[:alnum:]]*/\)$|\1raw\2|'
+# calculate
+LANGUAGES_calculate="Apache Bash Batch Boo C C# C++ Clojure Creole_Wiki CSS \
+CSV D Debian_control-files Django_Jinja_Templates Dylan Erlang eRuby_rhtml GAS GCC_Messages \
+Genshi_Templates Gettext_catalogs GL_Shader_language Haskell HTML INI_File Interactive_Ruby IO \
+IRC_Logs Java javac_Messages JavaScript JSP Lighttpd Literate_Haskell LLVM Lua Mako_Templates Matlab \
+Matlab_Session MiniD Multi-File Myghty_Templates MySQL Nasm Nginx Object-Pascal OCaml Perl PHP \
+PHP_(inline) Povray Python Python_Console_Sessions Python_Tracebacks reStructuredText Ruby Scala \
+Scheme Smalltalk Smarty sources.list SQL SquidConf TeX_LaTeX Text Unified_Diff Vim XML XSLT YAML"
+LANGUAGE_VALUES_calculate="apache bash bat boo c csharp cpp clojure creole css csv d control html+django \
+dylan erlang rhtml gas gcc-messages html+genshi gettext glsl haskell html ini irb io irc java \
+javac-messages js jsp lighttpd literate-haskell llvm lua html+mako matlab matlabsession minid multi \
+html+myghty mysql nasm nginx objectpascal ocaml perl html+php php povray python pycon pytb rst ruby \
+scala scheme smalltalk smarty sourceslist sql squidconf tex text diff vim xml xslt yaml"
+POST_calculate="submit=paste! % % language % parent private % text"
+REGEX_RAW_calculate='s|^\(http://[^/]*/\)show\(/[0-9]*/\)$|\1raw\2|'
### errors
die() {
@@ -340,6 +368,9 @@ Options:
-s, --service SERVICE set service to use (defaults to "$DEFAULT_SERVICE")
-e, --expiration EXPIRATION set when it should expire (defaults to "$DEFAULT_EXPIRATION")
+ -p, --parent PARENT set parent paste (defaults to "$DEFAULT_PARENT", make use id paste) (Calculate pastebin option)
+ -P, --private PRIVATE set private status (defaults to "$DEFAULT_PRIVATE") (Calculate pastebin option)
+
-S, --list-services list supported pastebin services
-L, --list-languages list languages supported by the specified service
-E, --list-expiration list expiration setting supported by the specified service
@@ -431,6 +462,18 @@ showlanguages() {
done | sort
}
+showprivate() {
+ local p priv d
+ priv=PRIVATE_$ENGINE
+ [[ -n $COMPLETIONS ]] && printlist ${!priv} | sort && exit 0
+ echo "Private supported by $(getrecipient) (case sensitive):"
+ [[ -z ${!priv} ]] && echo "$N\"$ENGINE\" has no support for setting language." >&2 && exit 1
+ for p in ${!priv}; do
+ [[ ${p//\%/ } = $DEFAULT_PRIVATE ]] && d="*" || d=" "
+ echo " $d${p//\%/ }"
+ done | sort
+}
+
showexpirations() {
local e expiration info d
expiration=EXPIRATIONS_$ENGINE
@@ -484,7 +527,7 @@ postdata() {
post=POST_$ENGINE
if [[ -n ${!post} ]]; then
nr=${!post//[^ ]}
- [[ 6 = ${#nr} ]] || die "\"${SERVICE}\" is not supported by ${FUNCNAME}()."
+ [[ 8 = ${#nr} ]] || die "\"${SERVICE}\" is not supported by ${FUNCNAME}()."
extra=${!post%% *}
[[ '%' = $extra ]] || echo -n "$extra&"
e() {
@@ -497,7 +540,7 @@ postdata() {
post=${post#$f }
done
}
- e "${!post#$extra }" NICK DESCRIPTION LANGUAGE EXPIRATION CVT_TABS INPUT
+ e "${!post#$extra }" NICK DESCRIPTION LANGUAGE EXPIRATION PARENT PRIVATE CVT_TABS INPUT
elif [[ function == $(type -t json_$ENGINE) ]]; then
json_$ENGINE "$DESCRIPTION" "$LANGUAGE" "$INPUT"
else
@@ -600,6 +643,16 @@ while [[ -n $1 ]]; do
-L | --list-languages )
LISTLANGUAGES=0
;;
+ -p | --parent )
+ requiredarg "$@"
+ PARENTSET=0
+ PARENT="$2"
+ ;;
+ -P | --private )
+ requiredarg "$@"
+ PRIVATESET=0
+ PRIVATE="$2"
+ ;;
-n | --nick )
requiredarg "$@"
NICK=$(escape "$2")
@@ -677,12 +730,16 @@ load_configs
DEFAULT_NICK=${DEFAULT_NICK:-$(whoami)} || die "whoami failed"
DEFAULT_SERVICE=${DEFAULT_SERVICE:-bpaste}
DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE:-Plain Text}
+DEFAULT_PARENT=${DEFAULT_PARENT:-''}
+DEFAULT_PRIVATE=${DEFAULT_PRIVATE:-0}
DEFAULT_EXPIRATION=${DEFAULT_EXPIRATION:-1 month}
SERVICE=${SERVICE:-${DEFAULT_SERVICE}}
ENGINE=ENGINE_$SERVICE
ENGINE="${!ENGINE}"
default="DEFAULT_NICK_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_NICK=${!default}
default="DEFAULT_LANGUAGE_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_LANGUAGE=${!default}
+default="DEFAULT_PARENT_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_PARENT=${!default}
+default="DEFAULT_PRIVATE_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_PRIVATE=${!default}
default="DEFAULT_EXPIRATION_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_EXPIRATION=${!default}
NICK=${NICK:-$(escape "${DEFAULT_NICK}")}
[[ -z $SOURCE ]] && SOURCE="stdin"
@@ -704,6 +761,10 @@ INFO_ARGS=${INFO_ARGS:-"--ignore-default-opts"}
LANGUAGE=${LANGUAGE:-${DEFAULT_LANGUAGE}}
verifylanguage
LANGUAGE=$(escape "$LANGUAGE")
+PARENT=${PARENT:-${DEFAULT_PARENT}}
+PARENT=$(escape "$PARENT")
+PRIVATE=${PRIVATE:-${DEFAULT_PRIVATE}}
+PRIVATE=$(escape "$PRIVATE")
EXPIRATION=${EXPIRATION:-${DEFAULT_EXPIRATION}}
verifyexpiration
EXPIRATION=$(escape "$EXPIRATION")
@@ -853,6 +914,7 @@ else
[[ -f $TMPF ]] || TMPF=$(mktemp /tmp/wgetpaste.XXXXXX)
if [[ -f $TMPF ]]; then
postdata > "$TMPF" || die "Failed to write to temporary file: \"$TMPF\"."
+ [[ $LANG =~ ru_RU ]] && enconv $TMPF
WGETARGS="--post-file=$TMPF"
else
# fall back to using --post-data if the temporary file could not be created

@ -0,0 +1,11 @@
--- /usr/bin/wgetpaste 2014-09-25 22:20:39.097103971 +0300
+++ wgetpaste 2014-10-09 10:06:41.765195553 +0300
@@ -200,7 +200,7 @@
xml+velocity xml xquery xslt xtend yaml"
EXPIRATIONS_pinnwand="1day 1week 1month never"
POST_pinnwand="submit=Paste! % % lexer expiry % code"
-REGEX_RAW_pinnwand='s|^\(http://[^/]*/\)show\(/[[:alnum:]]*/\)$|\1raw\2|'
+REGEX_RAW_pinnwand='s|^\(https\?://[^/]*/\)show\(/[[:alnum:]]*/\?\)$|\1raw\2|'
### errors
die() {

@ -0,0 +1,87 @@
--- /var/tmp/portage/app-text/wgetpaste-2.25-r1/work/wgetpaste-2.25/wgetpaste 2014-05-23 20:51:44.000000000 +0400
+++ /usr/bin/wgetpaste 2014-09-14 16:46:21.345261294 +0400
@@ -16,8 +16,10 @@
### services
SERVICES="bpaste ca codepad dpaste gists poundpython"
# bpaste
-ENGINE_bpaste=lodgeit
-URL_bpaste="http://bpaste.net/"
+ENGINE_bpaste=pinnwand
+URL_bpaste="https://bpaste.net/"
+DEFAULT_EXPIRATION_bpaste="1week"
+DEFAULT_LANGUAGE_bpaste="text"
# ca
ENGINE_ca=ca
URL_ca="http://pastebin.ca/"
@@ -143,6 +145,62 @@
vim xml xml+cheetah xml+django xml+evoque xml+mako xml+myghty xml+php xml+erb xml+smarty xslt yaml"
POST_lodgeit="submit=Paste! % % language % % code"
REGEX_RAW_lodgeit='s|^\(http://[^/]*/\)show\(/[[:alnum:]]*/\)$|\1raw\2|'
+# pinnwand
+LANGUAGES_pinnwand="ABAP ActionScript%3 ActionScript Ada ANTLR ANTLR%With%ActionScript%Target \
+ANTLR%With%CPP%Target ANTLR%With%C#%Target ANTLR%With%Java%Target ANTLR%With%ObjectiveC%Target \
+ANTLR%With%Perl%Target ANTLR%With%Python%Target ANTLR%With%Ruby%Target ApacheConf AppleScript \
+AspectJ aspx-cs aspx-vb Asymptote autohotkey AutoIt Awk Base%Makefile Bash Bash%Session Batchfile \
+BBCode Befunge BlitzMax Boo Brainfuck Bro BUGS ca65 CBM%BASIC%V2 C C++ C# Ceylon CFEngine3 \
+cfstatement Cheetah Clojure CMake c-objdump COBOL COBOLFree CoffeeScript Coldfusion%HTML Common%Lisp \
+Coq cpp-objdump Croc CSS CSS+Django/Jinja CSS+Genshi%Text CSS+Lasso CSS+Mako CSS+Myghty CSS+PHP \
+CSS+Ruby CSS+Smarty CUDA Cython Darcs%Patch Dart D Debian%Control%file Debian%Sourcelist Delphi dg \
+Diff Django/Jinja d-objdump DTD Duel Dylan DylanLID Dylan%session eC ECL Elixir Elixir%iex%session \
+Embedded%Ragel ERB Erlang Erlang%erl%session Evoque Factor Fancy Fantom Felix Fortran FoxPro FSharp \
+GAS Genshi Genshi%Text Gettext%Catalog Gherkin GLSL Gnuplot Go GoodData-CL Gosu Gosu%Template Groff \
+Groovy Haml Haskell haXe HTML+Cheetah HTML+Django/Jinja HTML+Evoque HTML+Genshi HTML HTML+Lasso \
+HTML+Mako HTML+Myghty HTML+PHP HTML+Smarty HTML+Velocity HTTP Hxml Hybris IDL INI Io Ioke IRC%logs \
+Jade JAGS Java JavaScript+Cheetah JavaScript+Django/Jinja JavaScript+Genshi%Text JavaScript \
+JavaScript+Lasso JavaScript+Mako JavaScript+Myghty JavaScript+PHP JavaScript+Ruby JavaScript+Smarty \
+Java%Server%Page JSON Julia%console Julia Kconfig Koka Kotlin Lasso Lighttpd%configuration%file \
+Literate%Haskell LiveScript LLVM Logos Logtalk Lua Makefile Mako MAQL Mason Matlab Matlab%session \
+MiniD Modelica Modula-2 MoinMoin/Trac%Wiki%markup Monkey MOOCode MoonScript Mscgen MuPAD MXML Myghty \
+MySQL NASM Nemerle NewLisp Newspeak Nginx%configuration%file Nimrod NSIS NumPy objdump Objective-C++ \
+Objective-C Objective-J OCaml Octave Ooc Opa OpenEdge%ABL Perl PHP PL/pgSQL \
+PostgreSQL%console%(psql) PostgreSQL%SQL%dialect PostScript POVRay PowerShell Prolog Properties \
+Protocol%Buffer Puppet PyPy%Log Python%3.0%Traceback Python%3 Python%console%session Python \
+Python%Traceback QML Racket Ragel%in%C%Host Ragel%in%CPP%Host Ragel%in%D%Host Ragel%in%Java%Host \
+Ragel%in%Objective%C%Host Ragel%in%Ruby%Host Ragel Raw%token%data RConsole Rd REBOL Redcode reg \
+reStructuredText RHTML RobotFramework RPMSpec Ruby%irb%session Ruby Rust Sass Scala \
+Scalate%Server%Page Scaml Scheme Scilab SCSS Shell%Session Smali Smalltalk Smarty Snobol SourcePawn \
+sqlite3con SQL SquidConf S Standard%ML Stan systemverilog Tcl Tcsh Tea TeX Text%only Text Treetop \
+TypeScript UrbiScript Vala VB.net Velocity verilog VGL vhdl VimL XML+Cheetah XML+Django/Jinja \
+XML+Evoque XML+Lasso XML+Mako XML+Myghty XML+PHP XML+Ruby XML+Smarty XML+Velocity XML XQuery XSLT \
+Xtend YAML"
+LANGUAGE_VALUES_pinnwand="abap as3 as ada antlr antlr-as antlr-cpp antlr-csharp antlr-java \
+antlr-objc antlr-perl antlr-python antlr-ruby apacheconf applescript aspectj aspx-cs aspx-vb asy ahk \
+autoit awk basemake bash console bat bbcode befunge blitzmax boo brainfuck bro bugs ca65 cbmbas c \
+cpp csharp ceylon cfengine3 cfs cheetah clojure cmake c-objdump cobol cobolfree coffee-script cfm \
+common-lisp coq cpp-objdump croc css css+django css+genshitext css+lasso css+mako css+myghty css+php \
+css+erb css+smarty cuda cython dpatch dart d control sourceslist delphi dg diff django d-objdump dtd \
+duel dylan dylan-lid dylan-console ec ecl elixir iex ragel-em erb erlang erl evoque factor fancy fan \
+felix fortran Clipper fsharp gas genshi genshitext pot Cucumber glsl gnuplot go gooddata-cl gosu gst \
+groff groovy haml haskell hx html+cheetah html+django html+evoque html+genshi html html+lasso \
+html+mako html+myghty html+php html+smarty html+velocity http haxeml hybris idl ini io ioke irc jade \
+jags java js+cheetah js+django js+genshitext js js+lasso js+mako js+myghty js+php js+erb js+smarty \
+jsp json jlcon julia kconfig koka kotlin lasso lighty lhs live-script llvm logos logtalk lua make \
+mako maql mason matlab matlabsession minid modelica modula2 trac-wiki monkey moocode moon mscgen \
+mupad mxml myghty mysql nasm nemerle newlisp newspeak nginx nimrod nsis numpy objdump objective-c++ \
+objective-c objective-j ocaml octave ooc opa openedge perl php plpgsql psql postgresql postscript \
+pov powershell prolog properties protobuf puppet pypylog py3tb python3 pycon python pytb qml racket \
+ragel-c ragel-cpp ragel-d ragel-java ragel-objc ragel-ruby ragel raw rconsole rd rebol redcode \
+registry rst rhtml RobotFramework spec rbcon rb rust sass scala ssp scaml scheme scilab scss \
+shell-session smali smalltalk smarty snobol sp sqlite3 sql squidconf splus sml stan systemverilog \
+tcl tcsh tea tex text text treetop ts urbiscript vala vb.net velocity verilog vgl vhdl vim \
+xml+cheetah xml+django xml+evoque xml+lasso xml+mako xml+myghty xml+php xml+erb xml+smarty \
+xml+velocity xml xquery xslt xtend yaml"
+EXPIRATIONS_pinnwand="1day 1week 1month never"
+POST_pinnwand="submit=Paste! % % lexer expiry % code"
+REGEX_RAW_pinnwand='s|^\(http://[^/]*/\)show\(/[[:alnum:]]*/\)$|\1raw\2|'
### errors
die() {
@@ -514,7 +572,7 @@
sed -n -e "${!regex}" <<< "$*"
else
[[ needstdout = $1 ]] && return 1
- sed -n -e 's|^.*Location: \(http://[^ ]*\).*$|\1|p' <<< "$*"
+ sed -n -e 's|^.*Location: \(https\{0,1\}://[^ ]*\).*$|\1|p' <<< "$*"
fi
}

@ -17,6 +17,7 @@ IUSE="zsh-completion +lodgeit-default"
DEPEND=""
RDEPEND="net-misc/wget
app-i18n/enca
zsh-completion? ( app-shells/zsh )"
src_unpack() {

@ -0,0 +1,42 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/wgetpaste/wgetpaste-2.25-r3.ebuild,v 1.9 2014/11/02 09:09:38 ago Exp $
EAPI="5"
inherit eutils
DESCRIPTION="Command-line interface to various pastebins"
HOMEPAGE="http://wgetpaste.zlin.dk/"
SRC_URI="http://wgetpaste.zlin.dk/${P}.tar.bz2"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE=""
DEPEND=""
RDEPEND="net-misc/wget
app-i18n/enca
"
src_unpack() {
unpack "${A}"
cd "${S}"
epatch "${FILESDIR}/calculate_wgetpaste-25.patch"
}
src_prepare() {
sed -i -e "s:/etc:\"${EPREFIX}\"/etc:g" wgetpaste || die
epatch "${FILESDIR}"/wgetpaste-2.25-pinnwand.patch
epatch "${FILESDIR}"/wgetpaste-2.25-pinnwand-raw.patch
}
src_install() {
dobin ${PN}
insinto /etc/wgetpaste.d
newins "${FILESDIR}"/wgetpaste-config-services services.conf
insinto /usr/share/zsh/site-functions
doins _wgetpaste
}
Loading…
Cancel
Save