Hello community,
here is the log from the commit of package perl-App-Nopaste for openSUSE:Factory checked in at 2012-09-14 12:33:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-App-Nopaste (Old)
and /work/SRC/openSUSE:Factory/.perl-App-Nopaste.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-App-Nopaste", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-App-Nopaste/perl-App-Nopaste.changes 2011-12-27 18:13:50.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-App-Nopaste.new/perl-App-Nopaste.changes 2012-09-14 12:33:39.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Sep 4 13:09:10 UTC 2012 - coolo@suse.com
+
+- updated to 0.35
+ Don't barf when gist-ing STDIN. (Ricardo SIGNES)
+ Support for GitHub's v3 API [Вячеслав Тихановский (vti)]
+
+-------------------------------------------------------------------
Old:
----
App-Nopaste-0.33.tar.gz
New:
----
App-Nopaste-0.35.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-App-Nopaste.spec ++++++
--- /var/tmp/diff_new_pack.jFeghh/_old 2012-09-14 12:33:40.000000000 +0200
+++ /var/tmp/diff_new_pack.jFeghh/_new 2012-09-14 12:33:40.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-App-Nopaste
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,8 +15,9 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
Name: perl-App-Nopaste
-Version: 0.33
+Version: 0.35
Release: 0
Summary: Easy access to any pastebin
License: Artistic-1.0 or GPL-1.0+
@@ -36,16 +37,17 @@
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp)
BuildRequires: perl(HTML::Form)
+BuildRequires: perl(JSON)
BuildRequires: perl(Module::Pluggable)
BuildRequires: perl(Moose) >= 0.74
BuildRequires: perl(MooseX::Getopt) >= 0.17
BuildRequires: perl(WWW::Mechanize)
BuildRequires: perl(WWW::Pastebin::PastebinCom::Create)
-Requires: perl(MooseX::Getopt) >= 0.17
+Requires: perl(HTML::Form)
Requires: perl(Module::Pluggable)
-Requires: perl(WWW::Mechanize)
Requires: perl(Moose) >= 0.74
-Requires: perl(HTML::Form)
+Requires: perl(MooseX::Getopt) >= 0.17
+Requires: perl(WWW::Mechanize)
Recommends: perl(Browser::Open)
Recommends: perl(Clipboard)
Recommends: perl(WWW::Pastebin::PastebinCom::Create)
@@ -113,9 +115,6 @@
%check
%__make test
-%clean
-%{?buildroot:%__rm -rf "%{buildroot}"}
-
%files
%defattr(-,root,root)
%doc Changes
++++++ App-Nopaste-0.33.tar.gz -> App-Nopaste-0.35.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/Changes new/App-Nopaste-0.35/Changes
--- old/App-Nopaste-0.33/Changes 2011-12-15 18:22:12.000000000 +0100
+++ new/App-Nopaste-0.35/Changes 2012-07-17 21:34:55.000000000 +0200
@@ -1,5 +1,13 @@
Revision history for App-Nopaste
+0.35 Tue Jul 17 2012
+ Don't barf when gist-ing STDIN. (Ricardo SIGNES)
+
+0.34 Sat Jul 14 2012
+ Support for GitHub's v3 API [Вячеслав Тихановский (vti)]
+ Thanks also to Ricardo SIGNES for the call to arms:
+ http://rjbs.manxome.org/rubric/entry/1964
+
0.33 Thu Dec 15 2011
Support for --description in Gist (zengargoyle@gmail.com) [rt.cpan.org #73272]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/META.yml new/App-Nopaste-0.35/META.yml
--- old/App-Nopaste-0.33/META.yml 2011-12-15 18:21:45.000000000 +0100
+++ new/App-Nopaste-0.35/META.yml 2012-07-17 21:35:04.000000000 +0200
@@ -3,11 +3,12 @@
author:
- 'Shawn M Moore, C'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.59
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.59
distribution_type: module
-generated_by: 'Module::Install version 1.01'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.06'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,6 +25,7 @@
Config::GitLike: 0.00
File::Spec: 0
File::Temp: 0
+ JSON: 0
Module::Pluggable: 0
Moose: 0.74
MooseX::Getopt: 0.17
@@ -32,10 +34,10 @@
WWW::Pastebin::PastebinCom::Create: 0
perl: 5.8.3
resources:
- homepage: http://github.com/sartak/app-nopaste/tree
+ homepage: https://github.com/sartak/app-nopaste/tree
license: http://dev.perl.org/licenses/
repository:
type: git
url: git://github.com/sartak/app-nopaste.git
- web: http://github.com/sartak/app-nopaste/tree
-version: 0.33
+ web: https://github.com/sartak/app-nopaste/tree
+version: 0.35
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/Makefile.PL new/App-Nopaste-0.35/Makefile.PL
--- old/App-Nopaste-0.33/Makefile.PL 2011-08-30 17:44:47.000000000 +0200
+++ new/App-Nopaste-0.35/Makefile.PL 2012-07-14 16:39:21.000000000 +0200
@@ -15,6 +15,7 @@
requires 'MooseX::Getopt' => '0.17';
requires 'Class::Load';
requires 'URI::Escape';
+requires 'JSON';
features(
'pastebin.com support' => [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/AutoInstall.pm new/App-Nopaste-0.35/inc/Module/AutoInstall.pm
--- old/App-Nopaste-0.33/inc/Module/AutoInstall.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/AutoInstall.pm 2012-07-17 21:35:04.000000000 +0200
@@ -3,11 +3,12 @@
use strict;
use Cwd ();
+use File::Spec ();
use ExtUtils::MakeMaker ();
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.03';
+ $VERSION = '1.06';
}
# special map on pre-defined feature sets
@@ -17,11 +18,14 @@
);
# various lexical flags
-my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS );
+my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS );
my (
- $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps
+ $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps,
+ $UpgradeDeps
);
-my ( $PostambleActions, $PostambleUsed );
+my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps,
+ $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps,
+ $PostambleActionsListAllDeps, $PostambleUsed, $NoTest);
# See if it's a testing or non-interactive session
_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
@@ -31,6 +35,10 @@
$AcceptDefault = shift;
}
+sub _installdeps_target {
+ $InstallDepsTarget = shift;
+}
+
sub missing_modules {
return @Missing;
}
@@ -63,6 +71,11 @@
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
+ elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) {
+ $UpgradeDeps = 1;
+ __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
+ exit 0;
+ }
elsif ( $arg =~ /^--default(?:deps)?$/ ) {
$AcceptDefault = 1;
}
@@ -125,7 +138,7 @@
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
- $UnderCPAN = _check_lock(1) unless $SkipInstall;
+ $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
my ( @required, @tests, @skiptests );
@@ -175,7 +188,7 @@
}
# XXX: check for conflicts and uninstalls(!) them.
- my $cur = _load($mod);
+ my $cur = _version_of($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
@@ -207,6 +220,7 @@
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
+ or $InstallDepsTarget
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
@@ -237,10 +251,17 @@
}
}
- if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
+ if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
require Config;
- print
-"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
+ my $make = $Config::Config{make};
+ if ($InstallDepsTarget) {
+ print
+"*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n";
+ }
+ else {
+ print
+"*** Dependencies will be installed the next time you type '$make'.\n";
+ }
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
@@ -271,6 +292,10 @@
sub _check_lock {
return unless @Missing or @_;
+ if ($ENV{PERL5_CPANM_IS_RUNNING}) {
+ return _running_under('cpanminus');
+ }
+
my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
@@ -324,7 +349,7 @@
while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
# grep out those already installed
- if ( _version_cmp( _load($pkg), $ver ) >= 0 ) {
+ if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
push @installed, $pkg;
}
else {
@@ -332,6 +357,11 @@
}
}
+ if ($UpgradeDeps) {
+ push @modules, @installed;
+ @installed = ();
+ }
+
return @installed unless @modules; # nothing to do
return @installed if _check_lock(); # defer to the CPAN shell
@@ -363,7 +393,7 @@
# see if we have successfully installed them
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- if ( _version_cmp( _load($pkg), $ver ) >= 0 ) {
+ if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
push @installed, $pkg;
}
elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) {
@@ -463,6 +493,11 @@
} else {
die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
}
+ push @config, 'prereqs', $value;
+ } elsif ( $key eq 'force' ) {
+ push @config, $key, $value;
+ } elsif ( $key eq 'notest' ) {
+ push @config, 'skiptest', $value;
} else {
die "*** Cannot convert option $key to CPANPLUS version.\n";
}
@@ -497,10 +532,14 @@
# set additional options
while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
( $args{$opt} = $arg, next )
- if $opt =~ /^force$/; # pseudo-option
+ if $opt =~ /^(?:force|notest)$/; # pseudo-option
$CPAN::Config->{$opt} = $arg;
}
+ if ($args{notest} && (not CPAN::Shell->can('notest'))) {
+ die "Your version of CPAN is too old to support the 'notest' pragma";
+ }
+
local $CPAN::Config->{prerequisites_policy} = 'follow';
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
@@ -519,8 +558,16 @@
delete $INC{$inc};
}
- my $rv = $args{force} ? CPAN::Shell->force( install => $pkg )
- : CPAN::Shell->install($pkg);
+ my $rv = do {
+ if ($args{force}) {
+ CPAN::Shell->force( install => $pkg )
+ } elsif ($args{notest}) {
+ CPAN::Shell->notest( install => $pkg )
+ } else {
+ CPAN::Shell->install($pkg)
+ }
+ };
+
$rv ||= eval {
$CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
->{install}
@@ -575,7 +622,7 @@
my $ver = shift;
return
- if _version_cmp( _load($class), $ver ) >= 0; # no need to upgrade
+ if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade
if (
_prompt( "==> A newer version of $class ($ver) is required. Install?",
@@ -660,16 +707,30 @@
# load a module and return the version it reports
sub _load {
- my $mod = pop; # class/instance doesn't matter
+ my $mod = pop; # method/function doesn't matter
my $file = $mod;
-
$file =~ s|::|/|g;
$file .= '.pm';
-
local $@;
return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
}
+# report version without loading a module
+sub _version_of {
+ my $mod = pop; # method/function doesn't matter
+ my $file = $mod;
+ $file =~ s|::|/|g;
+ $file .= '.pm';
+ foreach my $dir ( @INC ) {
+ next if ref $dir;
+ my $path = File::Spec->catfile($dir, $file);
+ next unless -e $path;
+ require ExtUtils::MM_Unix;
+ return ExtUtils::MM_Unix->parse_version($path);
+ }
+ return undef;
+}
+
# Load CPAN.pm and it's configuration
sub _load_cpan {
return if $CPAN::VERSION and $CPAN::Config and not @_;
@@ -763,6 +824,35 @@
: "\$(NOECHO) \$(NOOP)"
);
+ my $deps_list = join( ',', @Missing, @Existing );
+
+ $PostambleActionsUpgradeDeps =
+ "\$(PERL) $0 --config=$config --upgradedeps=$deps_list";
+
+ my $config_notest =
+ join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}),
+ 'notest', 1 )
+ if $Config;
+
+ $PostambleActionsNoTest = (
+ ($missing and not $UnderCPAN)
+ ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing"
+ : "\$(NOECHO) \$(NOOP)"
+ );
+
+ $PostambleActionsUpgradeDepsNoTest =
+ "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list";
+
+ $PostambleActionsListDeps =
+ '@$(PERL) -le "print for @ARGV" '
+ . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing);
+
+ my @all = (@Missing, @Existing);
+
+ $PostambleActionsListAllDeps =
+ '@$(PERL) -le "print for @ARGV" '
+ . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all);
+
return %args;
}
@@ -797,11 +887,15 @@
sub postamble {
$PostambleUsed = 1;
+ my $fragment;
- return <<"END_MAKE";
+ $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
+AUTO_INSTALL
+
+ $fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
@@ -809,12 +903,28 @@
installdeps ::
\t$PostambleActions
+installdeps_notest ::
+\t$PostambleActionsNoTest
+
+upgradedeps ::
+\t$PostambleActionsUpgradeDeps
+
+upgradedeps_notest ::
+\t$PostambleActionsUpgradeDepsNoTest
+
+listdeps ::
+\t$PostambleActionsListDeps
+
+listalldeps ::
+\t$PostambleActionsListAllDeps
+
END_MAKE
+ return $fragment;
}
1;
__END__
-#line 1071
+#line 1193
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/AutoInstall.pm new/App-Nopaste-0.35/inc/Module/Install/AutoInstall.pm
--- old/App-Nopaste-0.33/inc/Module/Install/AutoInstall.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/AutoInstall.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -73,6 +73,17 @@
);
}
+sub installdeps_target {
+ my ($self, @args) = @_;
+
+ $self->include('Module::AutoInstall');
+ require Module::AutoInstall;
+
+ Module::AutoInstall::_installdeps_target(1);
+
+ $self->auto_install(@args);
+}
+
sub auto_install_now {
my $self = shift;
$self->auto_install(@_);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Base.pm new/App-Nopaste-0.35/inc/Module/Install/Base.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Base.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Base.pm 2012-07-17 21:35:04.000000000 +0200
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
}
# Suspend handler for "redefined" warnings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Can.pm new/App-Nopaste-0.35/inc/Module/Install/Can.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Can.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Can.pm 2012-07-17 21:35:04.000000000 +0200
@@ -3,13 +3,12 @@
use strict;
use Config ();
-use File::Spec ();
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -29,7 +28,7 @@
eval { require $mod; $pkg->VERSION($ver || 0); 1 };
}
-# check if we can run some command
+# Check if we can run some command
sub can_run {
my ($self, $cmd) = @_;
@@ -38,14 +37,88 @@
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
- my $abs = File::Spec->catfile($dir, $_[1]);
+ require File::Spec;
+ my $abs = File::Spec->catfile($dir, $cmd);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+ my $self = shift;
+
+ # Ensure we have the CBuilder module
+ $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+ # Do we have the configure_requires checker?
+ local $@;
+ eval "require ExtUtils::CBuilder;";
+ if ( $@ ) {
+ # They don't obey configure_requires, so it is
+ # someone old and delicate. Try to avoid hurting
+ # them by falling back to an older simpler test.
+ return $self->can_cc();
+ }
+
+ # Do we have a working C compiler
+ my $builder = ExtUtils::CBuilder->new(
+ quiet => 1,
+ );
+ unless ( $builder->have_compiler ) {
+ # No working C compiler
+ return 0;
+ }
+
+ # Write a C file representative of what XS becomes
+ require File::Temp;
+ my ( $FH, $tmpfile ) = File::Temp::tempfile(
+ "compilexs-XXXXX",
+ SUFFIX => '.c',
+ );
+ binmode $FH;
+ print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+ return 0;
+}
+
+int boot_sanexs() {
+ return 1;
+}
+
+END_C
+ close $FH;
+
+ # Can the C compiler access the same headers XS does
+ my @libs = ();
+ my $object = undef;
+ eval {
+ local $^W = 0;
+ $object = $builder->compile(
+ source => $tmpfile,
+ );
+ @libs = $builder->link(
+ objects => $object,
+ module_name => 'sanexs',
+ );
+ };
+ my $result = $@ ? 0 : 1;
+
+ # Clean up all the build files
+ foreach ( $tmpfile, $object, @libs ) {
+ next unless defined $_;
+ 1 while unlink;
+ }
+
+ return $result;
+}
+
+# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@
__END__
-#line 156
+#line 236
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Fetch.pm new/App-Nopaste-0.35/inc/Module/Install/Fetch.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Fetch.pm 2011-12-15 18:21:45.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Fetch.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/GithubMeta.pm new/App-Nopaste-0.35/inc/Module/Install/GithubMeta.pm
--- old/App-Nopaste-0.33/inc/Module/Install/GithubMeta.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/GithubMeta.pm 2012-07-17 21:35:04.000000000 +0200
@@ -7,18 +7,19 @@
use base qw(Module::Install::Base);
use vars qw($VERSION);
-$VERSION = '0.12';
+$VERSION = '0.16';
sub githubmeta {
my $self = shift;
return unless $Module::Install::AUTHOR;
return unless _under_git();
return unless $self->can_run('git');
- return unless my ($git_url) = `git remote show -n origin` =~ /URL: (.*)$/m;
+ my $remote = shift || 'origin';
+ return unless my ($git_url) = `git remote show -n $remote` =~ /URL: (.*)$/m;
return unless $git_url =~ /github\.com/; # Not a Github repository
my $http_url = $git_url;
$git_url =~ s![\w\-]+\@([^:]+):!git://$1/!;
- $http_url =~ s![\w\-]+\@([^:]+):!http://$1/!;
+ $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!;
$http_url =~ s!\.git$!/tree!;
$self->repository(
{
@@ -53,4 +54,4 @@
'Github';
__END__
-#line 114
+#line 117
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Include.pm new/App-Nopaste-0.35/inc/Module/Install/Include.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Include.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Include.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Makefile.pm new/App-Nopaste-0.35/inc/Module/Install/Makefile.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Makefile.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Makefile.pm 2012-07-17 21:35:04.000000000 +0200
@@ -8,7 +8,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -215,18 +215,22 @@
require ExtUtils::MakeMaker;
if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
- my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
- $self->build_requires( 'ExtUtils::MakeMaker' => $v );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+ # This previous attempted to inherit the version of
+ # ExtUtils::MakeMaker in use by the module author, but this
+ # was found to be untenable as some authors build releases
+ # using future dev versions of EU:MM that nobody else has.
+ # Instead, #toolchain suggests we use 6.59 which is the most
+ # stable version on CPAN at time of writing and is, to quote
+ # ribasushi, "not terminally fucked, > and tested enough".
+ # TODO: We will now need to maintain this over time to push
+ # the version up as new versions are released.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
} else {
# Allow legacy-compatibility with 5.005 by depending on the
# most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
- $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
}
# Generate the MakeMaker params
@@ -241,7 +245,6 @@
'all_from' if you prefer) in Makefile.PL.
EOT
- $DB::single = 1;
if ( $self->tests ) {
my @tests = split ' ', $self->tests;
my %seen;
@@ -412,4 +415,4 @@
__END__
-#line 541
+#line 544
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/ManifestSkip.pm new/App-Nopaste-0.35/inc/Module/Install/ManifestSkip.pm
--- old/App-Nopaste-0.33/inc/Module/Install/ManifestSkip.pm 2011-12-15 18:21:44.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/ManifestSkip.pm 2012-07-17 21:35:04.000000000 +0200
@@ -9,7 +9,7 @@
# - Module::Manifest::Skip
package Module::Install::ManifestSkip;
-use 5.008003;
+use 5.008001;
use strict;
use warnings;
@@ -19,7 +19,7 @@
use Module::Manifest::Skip 0.10 ();
";
-our $VERSION = '0.19';
+our $VERSION = '0.20';
our $AUTHOR_ONLY = 1;
my $skip_file = "MANIFEST.SKIP";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Metadata.pm new/App-Nopaste-0.35/inc/Module/Install/Metadata.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Metadata.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Metadata.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -151,15 +151,21 @@
sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
- my $self = shift;
- unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config\n";
- return $self;
+ my $self = shift;
+ my $value = @_ ? shift : 1;
+ if ( $self->{values}->{dynamic_config} ) {
+ # Once dynamic we never change to static, for safety
+ return 0;
}
- $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $value ? 1 : 0;
return 1;
}
+# Convenience command
+sub static_config {
+ shift->dynamic_config(0);
+}
+
sub perl_version {
my $self = shift;
return $self->{values}->{perl_version} unless @_;
@@ -170,7 +176,7 @@
# Normalize the version
$version = $self->_perl_version($version);
- # We don't support the reall old versions
+ # We don't support the really old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
@@ -582,7 +588,7 @@
sub requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
- my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Scripts.pm new/App-Nopaste-0.35/inc/Module/Install/Scripts.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Scripts.pm 2011-12-15 18:21:43.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Scripts.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/Win32.pm new/App-Nopaste-0.35/inc/Module/Install/Win32.pm
--- old/App-Nopaste-0.33/inc/Module/Install/Win32.pm 2011-12-15 18:21:45.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/Win32.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install/WriteAll.pm new/App-Nopaste-0.35/inc/Module/Install/WriteAll.pm
--- old/App-Nopaste-0.33/inc/Module/Install/WriteAll.pm 2011-12-15 18:21:45.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install/WriteAll.pm 2012-07-17 21:35:04.000000000 +0200
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/inc/Module/Install.pm new/App-Nopaste-0.35/inc/Module/Install.pm
--- old/App-Nopaste-0.33/inc/Module/Install.pm 2011-12-15 18:21:42.000000000 +0100
+++ new/App-Nopaste-0.35/inc/Module/Install.pm 2012-07-17 21:35:04.000000000 +0200
@@ -31,7 +31,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.01';
+ $VERSION = '1.06';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -451,7 +451,7 @@
}
sub _cmp ($$) {
- _version($_[0]) <=> _version($_[1]);
+ _version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
@@ -467,4 +467,4 @@
1;
-# Copyright 2008 - 2011 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/lib/App/Nopaste/Service/Gist.pm new/App-Nopaste-0.35/lib/App/Nopaste/Service/Gist.pm
--- old/App-Nopaste-0.33/lib/App/Nopaste/Service/Gist.pm 2011-12-15 18:19:52.000000000 +0100
+++ new/App-Nopaste-0.35/lib/App/Nopaste/Service/Gist.pm 2012-07-17 21:34:32.000000000 +0200
@@ -3,6 +3,9 @@
use warnings;
use base 'App::Nopaste::Service';
+use File::Basename ();
+use JSON ();
+
sub available { 1 }
sub forbid_in_default { 0 }
@@ -15,17 +18,29 @@
my ($self, %arg) = @_;
my $ua = LWP::UserAgent->new;
+ my $content = {
+ public => defined $arg{private} ? 0 : 1,
+ defined $arg{desc} ? (description => $arg{desc}) : (),
+ };
+
+ my $filename = defined $arg{filename}
+ ? File::Basename::basename($arg{filename})
+ : 'nopaste.txt';
+
+ $content->{files} = {
+ $filename => {
+ content => $arg{text}
+ }
+ };
+
+ $content = JSON::encode_json($content);
+
my %auth = $self->_get_auth;
my $res = $ua->post(
- 'https://gist.github.com/api/v1/json/new',
- {
- 'file_ext[gistfile1]' => '.' . ( $arg{lang} || 'txt' ),
- 'file_contents[gistfile1]' => $arg{text},
- %auth,
- defined $arg{private} ? (private => 1) : (),
- defined $arg{desc} ? (description => $arg{desc}) : (),
- },
+ 'https://api.github.com/gists',
+ 'Authorization' => "token $auth{oauth_token}",
+ Content => $content
);
return $self->return($res);
@@ -34,39 +49,50 @@
sub _get_auth {
my ($self) = @_;
- if ($ENV{GITHUB_USER} && $ENV{GITHUB_TOKEN}) {
- my $user = $ENV{GITHUB_USER};
- my $token = $ENV{GITHUB_TOKEN};
-
- return (
- login => $user,
- token => $token,
- );
- } elsif (eval "require Git; 1") {
- my $user = Git::config('github.user');
- my $token = Git::config('github.token');
-
- return unless $user and $token;
-
- return (
- login => $user,
- token => $token,
- );
- } elsif (eval "require Config::GitLike; 1") {
- my $gitconfig = Config::GitLike->new( confname => 'gitconfig' );
- $gitconfig->load;
- my $user = $gitconfig->get( key => 'github.user' );
- my $token = $gitconfig->get( key => 'github.token' );
-
- return unless $user and $token;
-
- return (
- login => $user,
- token => $token,
- );
+ if (my $oauth_token = $ENV{GITHUB_OAUTH_TOKEN}) {
+ return (oauth_token => $oauth_token);
}
- return;
+ die join("\n",
+ "Export GITHUB_OAUTH_TOKEN first. For example:",
+ " perl -Ilib -MApp::Nopaste::Service::Gist -e 'App::Nopaste::Service::Gist->create_token'"
+ ) . "\n";
+}
+
+sub create_token {
+ my ($self) = @_;
+
+ local $| = 1;
+ print "Username: ";
+ chomp(my $username = <>);
+ print "Password: ";
+ chomp(my $password = <>);
+ print "\n\n";
+
+ exit unless $username && $password;
+
+ my $parameters = {
+ scopes => ["gist"],
+ note => "App::Nopaste",
+ note_url => "https://metacpan.org/module/App::Nopaste",
+ };
+
+ my $ua = LWP::UserAgent->new;
+
+ my $request = HTTP::Request->new(POST => 'https://api.github.com/authorizations');
+ $request->authorization_basic($username, $password);
+ $request->content(JSON::encode_json($parameters));
+
+ my $response = $ua->request($request);
+
+ my $response_content = JSON::decode_json($response->decoded_content);
+
+ if ($response_content->{token} ) {
+ print "GITHUB_OAUTH_TOKEN=$response_content->{token}\n";
+ }
+ else {
+ print $response_content->{message} || "Unspecified error", "\n";
+ }
}
sub return {
@@ -80,7 +106,7 @@
return (0, "LWP Error: " . $res->content);
}
- my ($id) = $res->content =~ qr{"repo":"([0-9a-f]+)"};
+ my ($id) = $res->content =~ qr{"id":"([0-9a-f]+)"};
return (0, "Could not find paste link.") if !$id;
return (1, "http://gist.github.com/$id");
@@ -94,6 +120,24 @@
App::Nopaste::Service::Gist - http://gist.github.com/
+=head1 GitHub Authorization
+
+In order to create gists you have to get an oauth token. That could be easily
+obtained via curl:
+
+ curl -X POST 'https://USERNAME:PASSWORD@api.github.com/authorizations' \
+ -d '{"scopes":["gist"],"note":"App::Nopaste"}'
+
+or you can use this module to do the same:
+
+ perl -MApp::Nopaste::Service::Gist -e 'App::Nopaste::Service::Gist->create_token'
+
+This will grant gist rights to the LApp::Nopaste, don't worry you can revoke
+access rights anytime from the GitHub profile settings. Search for C<token> in
+response and export it as C environment variable.
+
+That's it!
+
=head1 AUTHOR
Ricardo SIGNES, C<< >>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-Nopaste-0.33/lib/App/Nopaste.pm new/App-Nopaste-0.35/lib/App/Nopaste.pm
--- old/App-Nopaste-0.33/lib/App/Nopaste.pm 2011-12-15 18:21:19.000000000 +0100
+++ new/App-Nopaste-0.35/lib/App/Nopaste.pm 2012-07-17 21:35:00.000000000 +0200
@@ -8,7 +8,7 @@
use base 'Exporter';
our @EXPORT_OK = 'nopaste';
-our $VERSION = '0.33';
+our $VERSION = '0.35';
sub nopaste {
# process arguments
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org