diff options
author | 2013-05-01 04:32:23 +1200 | |
---|---|---|
committer | 2013-05-01 04:32:23 +1200 | |
commit | 97a9f54ae24685b93b209ad1878c309436de5847 (patch) | |
tree | 01ee44cc4658267c130016023fee0b1970f40a44 /scripts | |
parent | [scripts] deptools.pm : add DateManip to the exception list (diff) | |
download | perl-overlay-97a9f54ae24685b93b209ad1878c309436de5847.tar.gz perl-overlay-97a9f54ae24685b93b209ad1878c309436de5847.tar.bz2 perl-overlay-97a9f54ae24685b93b209ad1878c309436de5847.zip |
[scripts] deptools.pm : add ExtUtils-Depends to exception list
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gen_metadata.pl | 79 | ||||
-rw-r--r-- | scripts/lib/deptools.pm | 59 | ||||
-rw-r--r-- | scripts/virtualmap.pl | 102 |
3 files changed, 211 insertions, 29 deletions
diff --git a/scripts/gen_metadata.pl b/scripts/gen_metadata.pl new file mode 100644 index 000000000..ba31fd80c --- /dev/null +++ b/scripts/gen_metadata.pl @@ -0,0 +1,79 @@ +use 5.12.2; +use strict; +use warnings; + + +use FindBin; +use lib "$FindBin::Bin/lib"; +use env::gentoo::perl_experimental; +use optparse; +use utf8; +use XML::Smart; + +my $env = env::gentoo::perl_experimental->new(); +my $opts = optparse->new( + argv => \@ARGV, + help => sub { print <DATA>; return } +); + +my $root = $env->root; +use Path::Class::Dir; + +my $cwd = Path::Class::Dir->new('.')->absolute; + +my $package_dir = $cwd; + +if( $opts->has_long_opt('package-dir') ) { + $package_dir = Path::Class::Dir->new($opts->long_opt('package-dir'))->absolute; +} +if( not scalar grep { not $_->is_dir and $_->basename =~ /\.ebuild$/ } $package_dir->children ) { + die "Sorry, there are no .ebuild files in this directory, not going to create a metadata.xml file here!"; +} + +if( $opts->has_long_opt('new') ) { + say "Generating a new metdata.xml"; + if ( -e $package_dir->file('metadata.xml')->stat ){ + # die "Error: metadata.xml already exists here"; + } + my $herd = 'perl'; + my $maintainer_name; + my $maintainer_email; + my $cpan_id; + + if( $opts->has_long_opt('herd') ) { + $herd = $opts->long_opt('herd'); + } + if( $opts->has_long_opt('maintainer-name') ){ + $maintainer_name = $opts->long_opt('maintainer-name'); + } + if( $opts->has_long_opt('maintainer-email') ){ + $maintainer_email = $opts->long_opt('maintainer-email'); + } + if( $opts->has_long_opt('cpan-id') ) { + $cpan_id = $opts->long_opt('cpan-id'); + } + my $xml = XML::Smart->new('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"><pkgmetadata></pkgmetadata>'); + $xml->{pkgmetadata}->{herd}->[0] = $herd; + # $xml->{pkgmetadata}->{herd}->set_node(1); + if ( defined $maintainer_name ) { + $xml->{pkgmetadata}->{maintainer}->{name} = $maintainer_name; + # $xml->{pkgmetadata}->{maintainer}->{name}->set_node(1); + } + if( defined $maintainer_email ) { + $xml->{pkgmetadata}->{maintainer}->{email} = $maintainer_email; + # $xml->{pkgmetadata}->{maintainer}->{email}->set_node(1); + } + if( defined $cpan_id ) { + $xml->{pkgmetadata}->{upstream}->{'remote-id'}->content($cpan_id); + $xml->{pkgmetadata}->{upstream}->{'remote-id'}->{type} = 'cpan'; + } + + $xml->apply_dtd('http://www.gentoo.org/dtd/metadata.dtd'); + + print scalar $xml->data( nodtd => 1, meta => { 'script' => 'perl-experimental/scripts/gen_metadata.pl' } ); +} + + +__DATA__ + +__END__ diff --git a/scripts/lib/deptools.pm b/scripts/lib/deptools.pm index 2618ae7f6..8bd55955d 100644 --- a/scripts/lib/deptools.pm +++ b/scripts/lib/deptools.pm @@ -40,35 +40,36 @@ sub _vmap_perl_native { # ::gentoo Exceptions sub _vmap_perl_strange { return ( - 'App-SVN-Bisect' => 'dev-util/App-SVN-Bisect', - 'Autodia' => 'dev-utils/autodia', - 'BioPerl' => 'sci-biology/bioperl', - 'BioPerl-DB' => 'sci-biology/bioperl-db', - 'BioPerl-Network' => 'sci-biology/bioperl-network', - 'BioPerl-Run' => 'sci-biology/bioperl-run', - 'CGI-Simple' => perl 'Cgi-Simple', - 'Config-General' => perl 'config-general', - 'Crypt-CBC' => perl 'crypt-cbc', - 'Digest' => virtual 'digest-base', - 'Date-Manip' => perl 'DateManip', - 'GBrowse' => 'sci-biology/GBrowse', - 'Glib' => perl 'glib-perl', - 'I18N-LangTags' => virtual 'i18n-langtags', - 'Image-ExifTool' => 'media-libs/exiftool', - 'Locale-Maketext' => virtual 'locale-maketext', - 'Net-Ping' => virtual 'net-ping', - 'Net-Server' => perl 'net-server', - 'Padre' => 'app-editors/padre', - 'PathTools' => virtual 'File-Spec', - 'Perl-Tidy' => perl 'perltidy', - 'Pod-Parser' => virtual 'PodParser', - 'SVK' => 'dev-vcs/svk', - 'Set-Scalar' => perl 'set-scalar', - 'Snapback2' => 'app-backup/snapback2', - 'Text-Template' => perl 'text-template', - 'XML-XSH2' => 'app-editors/XML-XSH2', - 'YAML' => perl 'yaml', - 'ack' => 'sys-apps/ack', + 'App-SVN-Bisect' => 'dev-util/App-SVN-Bisect', + 'Autodia' => 'dev-utils/autodia', + 'BioPerl' => 'sci-biology/bioperl', + 'BioPerl-DB' => 'sci-biology/bioperl-db', + 'BioPerl-Network' => 'sci-biology/bioperl-network', + 'BioPerl-Run' => 'sci-biology/bioperl-run', + 'CGI-Simple' => perl 'Cgi-Simple', + 'Config-General' => perl 'config-general', + 'Crypt-CBC' => perl 'crypt-cbc', + 'Date-Manip' => perl 'DateManip', + 'Digest' => virtual 'digest-base', + 'ExtUtils-Depends' => perl 'extutils-depends', + 'GBrowse' => 'sci-biology/GBrowse', + 'Glib' => perl 'glib-perl', + 'I18N-LangTags' => virtual 'i18n-langtags', + 'Image-ExifTool' => 'media-libs/exiftool', + 'Locale-Maketext' => virtual 'locale-maketext', + 'Net-Ping' => virtual 'net-ping', + 'Net-Server' => perl 'net-server', + 'Padre' => 'app-editors/padre', + 'PathTools' => virtual 'File-Spec', + 'Perl-Tidy' => perl 'perltidy', + 'Pod-Parser' => virtual 'PodParser', + 'SVK' => 'dev-vcs/svk', + 'Set-Scalar' => perl 'set-scalar', + 'Snapback2' => 'app-backup/snapback2', + 'Text-Template' => perl 'text-template', + 'XML-XSH2' => 'app-editors/XML-XSH2', + 'YAML' => perl 'yaml', + 'ack' => 'sys-apps/ack', ); } diff --git a/scripts/virtualmap.pl b/scripts/virtualmap.pl new file mode 100644 index 000000000..2ace06454 --- /dev/null +++ b/scripts/virtualmap.pl @@ -0,0 +1,102 @@ + +{ + + package VirtualRecord; + use 5.16.0; + use Moo; + + has virtual_name => ( is => rw =>, required => 1, ); + has virtual_corepackage => ( is => rw =>, required => 1, ); + has virtual_check_module => ( is => rw =>, required => 1, ); + has repo => ( is => rw =>, required => 1, ); + + +} +{ + package VDB; + use 5.16.0; + use Quote::Sub; + has items => ( is => rw => , default => quote_sub(q{ [] }); + + sub add_item { + my ( $self , @args ) = @_ ; + my $rec = VirtualRecord->new( + virtual_name => $args[0], + virtual_corepackage => $args[1], + virtual_check_moodule => $args[2], + repo => $args[3]; + ); + push @{ $self->items }, $rec; + } + sub add_items { + my ( $self, @args ) = @_; + for my $rec ( @args ){ + $self->add_item( @{$rec} ); + } + } +} + +sub atom_expand { + my $atom = shift; + my $package = $atom =~ s/::/-/gr; + my $virtual = $package =~ s/^/perl-/r; + return ( $virtual, $package, $atom ); +} +my $vdb = VDB->new(); +$vdb->add_items( + ( map { [ atom_expand($_), 'perl-experimental' ] } qw( + Archive::Extract + B::Debug + B::Lint + constant + CPAN + CPANPLUS + CPANPLUS::Dist::Build + Devel::DProf + Devel::PPPort + Devel::SelfStubber + Dumpvalue + Exporter + ExtUtils::MakeMaker + File::Fetch + Filter::Simple + HTTP::Tiny + if + IPC::SysV + Log::Message + Log::Message::Simple + Math::Complex + Module::CoreList + NEXT + Object::Accessor + Pod::LaTeX + Pod::Perldoc + Pod::Plainer + SelfLoader + Term::UI + Unicode::Collate + Unicode::Normalize + )), + [ 'perl-i18n-langtags' , 'i18n-langtags', 'I18N::LangTags' , 'perl-experimental'] +); +$vdb->add_items( + ( map { [ atom_expand($_), 'gentoo' ] } qw( + Archive::Tar + Attribute::Handlers + AutoLoader + CGI + Class::ISA + Compress::Raw::Bzip2 + Compress::Raw::Zlib + CPAN::Meta + CPAN::Meta::Requirements + CPAN::Meta::YAML + Data::Dumper + DB_File + )), + [ 'perl-digest-base' , 'digest-base', 'Digest' , 'gentoo'], + ( map { [ atom_expand($_), 'gentoo' ] } qw( + )), + +); + |