Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 117207 Details for
Bug 175941
app-text/gnopaster-0.0.6 or dev-perl/Config-Simple-4.58: Cannot run gnopaster -> "Can't locate ConfigReader/Simple.pm"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
gnopaster after s/ConfigReader::/Config::/
gnopaster (text/plain), 6.07 KB, created by
Alexander Skwar
on 2007-04-25 09:26:27 UTC
(
hide
)
Description:
gnopaster after s/ConfigReader::/Config::/
Filename:
MIME Type:
Creator:
Alexander Skwar
Created:
2007-04-25 09:26:27 UTC
Size:
6.07 KB
patch
obsolete
>#!/usr/bin/perl ># ># $Id: $ ># vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: ># ># This file is part of GNOPASTER ># ># @author Milan 't4c' Berger <t4c@ghcif.de> ># @author Thomas 'mosez' Boerger <mosez@ghcif.de> ># @since 30/07/2005 ># @version $Revision $ ># ># Copyright (C) 2005-2007 ghcif.de <devel@ghcif.de> ># ># Gnopaster is free software; you can redistribute it and/or modify ># it under the terms of the GNU General Public License as published by ># the Free Software Foundation; either version 2 of the License, or ># (at your option) any later version. ># ># Gnopaster is distributed in the hope that it will be useful, ># but WITHOUT ANY WARRANTY; without even the implied warranty of ># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ># GNU General Public License for more details. ># ># You should have received a copy of the GNU General Public License ># along with this program; if not, write to the Free Software ># Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ># > ># ># CHANGELOG ># ># 0.0.1 initial release ># ># 0.0.2 cleaned ip code ># new helpfile ># set under GPL License ># added UserAgent ># ># 0.0.3 added http proxy support ># ># 0.0.4 added 3rd pasting option ># changed name to gnopaster.pl ># ># 0.0.5 changed regexp for compatibility ># with further gnopaste versions (>0.5.2) ># added UserAgent Versionstring ># ># 0.0.6 added support for configuration file ># added option for the tab width ># added support for mod_rewrite ># > ># ># CREDITS (in alphabetic order) ># ># google for giving our brains food (google.ru) ># MacFly for "Gimme a gnopaste.pl!" (german-bash.org) ># Nermal for nerves and kicking dt (nermal => IRCNet) ># our moms for teaching us reading (home.b0x) ># sh0 for preventing from the dark side (das.sho.org) ># tengri for idea and exbase (unixfreunde.de) ># zero for gettin sum regexp help (gpg: 0x857f10E0) ># > >use strict; >use warnings; > >use Getopt::Std; >use LWP; >use Config::Simple; > ># help function >sub help { > printf <<EOHELP; >gnopaster: > a free gnopaste submitter > >usage: > gnopaster [-h] [-l] [description] > >options: > -h display usage information. > -l scriptlanguage (C#, C++, C89, Java, PHP, > PL, Pascal, Perl, Python, Ruby, SQL, Scheme, > VB, XML, mIRC) > -t tab width > -C force creating configuration file > >examples: > dog foobar.pl | gnopaster.pl -l Perl my perlfile > pastes foobar.pl with scriptinglanguage perl > > gnopaster.pl My foobar.c you got it<foobar.c > pastes foobar.c without language and comment > My foobar.c > > grep ^[^#] foo.conf | gnopaster.pl > pastes foo.conf without comments > > You also can start gnopaster.pl and then enter Input > to paste, when you have done this you can send with > ^d (ctrl+d) > >configuration: > You can change the submission url on the config file, > to find on your home directory (~/.gnopasterrc) > >see also: > http://www.nopaste.info > http://gnopaste.ghcif.de >EOHELP >} > ># configure function >sub configure { > open(CFG, ">$_[0]"); > printf CFG "# the submission url with trailing slash\n"; > printf CFG "Url = http://nopaste.info/\n\n"; > printf CFG "# is mod_rewrite active on gnopaste?\n"; > printf CFG "# valid settings ar On and Off\n"; > printf CFG "ModRewrite = On\n"; > close(CFG); >} > ># some definitions going here >my $nick = $ENV{USER}; # poster's name >my $version = '0.0.6'; >my $proxy = $ENV{http_proxy}; # read proxy var >my $cfg_file = "$ENV{HOME}/.gnopasterrc"; # configuration file >my $url; # gnopaste submission url >my $desc; # description >my $sl; # scripting language >my $tw; # tab width >my $code; # pasted code >my $data; # gnopaste id output >my $modrewrite; # mod_rewrite option >my $config; # configuration read from file >my %options = (); # hash used for command line parsing > ># check command line options >die "error parsing command line.\n" unless getopts('Clht', \%options); > ># option create config file >if(defined $options{C}) { > configure($cfg_file); exit(0); >} > ># option display help >if(defined $options{h}) { > help(); exit(0); >} > ># option set script language >$sl = "Plain Text" unless defined $options{l}; >$sl = shift (@ARGV) if defined $options{l}; > ># option set tab width >$tw = "4" unless defined $options{t}; >$tw = shift (@ARGV) if defined $options{t}; > ># set description >foreach(@ARGV) { > $desc .= $_ . " "; >} > ># read stdin and set code >if(-t STDIN && -t STDOUT) { > print "Copy data you want to paste\n^d paste - ^c cancels\n\n"; >} > >while(<STDIN>) { > $code .= $_; >} > ># print error when we get no content >die "error - no data received from stdin.\n" unless length $code; > ># parse config file >$config = Config::Simple->new($cfg_file, [qw(Url ModRewrite)]); > ># if config does not exist create it >if(!$config->exists("Url") || !$config->exists("ModRewrite")) { > configure($cfg_file); > $config = Config::Simple->new($cfg_file, [qw(Url ModRewrite)]); >} > ># get config values >$url = $config->get("Url"); >$modrewrite = $config->get("ModRewrite"); > ># send form data >my $req = LWP::UserAgent->new; > >$req->agent('gnopaster/' . $version); >$req->proxy(['http'],$proxy); > >my $res = $req->post( > $url, > [ > 'name' => $nick, > 'code_lang' => $sl, > 'tab_length' => $tw, > 'description' => $desc, > 'code' => $code, > 'submit' => 'submit', > ], > 'content_type' => 'multipart/form-data', >); > ># fetch errors >die "$url error: ", $res->status_line unless $res->is_success; >die "Wrong content type at $url -- ", $res->content_type unless $res->content_type eq 'text/html'; > ># preparing output >$data = $res->content; > ># get the resulting link >if($modrewrite eq "On") { > if($data =~ s/^.*?<a href=.*?\/([A-Fa-f0-9]{10}.html?)".+$/$1/s) { > print "-> " . $url . $data . "\n"; exit(0); > } >} else { > if($data =~ s/^.*?<a href=.*?\/(index\.php\?id=[A-Fa-f0-9]{10})".+$/$1/s) { > print "-> " . $url . $data . "\n"; exit(0); > } >} > ># the server made a boo boo >print "Couldn't extract gnopaste url string\n"; >print "pastefile is too big?\n"; > ># uncomment for debugging >#print $res->content;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 175941
: 117207