App-Fetchware
view release on metacpan or search on metacpan
lib/App/Fetchware.pm view on Meta::CPAN
# Only one @enumerations should equal $option not more than one, hence
# the == 1 part.
die <<EOD unless (grep {config($option) eq $_} @$enumerations) == 1;
App-Fetchware: You specified the option [$option], but failed to specify only
one of its acceptable values [@$enumerations]. Please change the value you
specified [@{[config($option)]}] to one of the acceptable ones listed above, and try again.
EOD
}
}
}
return 'Syntax Ok';
}
sub end {
# Use cleanup_tempdir() to cleanup your tempdir for us.
cleanup_tempdir();
}
1;
sub hook ($$) {
my ($sub_to_hook, $callback) = @_;
die <<EOD unless App::Fetchware->can($sub_to_hook);
App-Fetchware: The subroutine [$sub_to_hook] you attempted to override does
not exist in this package. Perhaps you misspelled it, or it does not exist in
the current package.
EOD
override $sub_to_hook => $callback;
# Overriding the subroutine is not enough, because it is overriding it
# inside App::Fetchware, so I need to also override the subroutine inside
# hook()'s caller as done below.
{
no warnings 'redefine';
clone($sub_to_hook => (from => 'App::Fetchware', to => caller()));
}
}
###BUGALERT### Add an section of use cases. You know explaing why you'd use
#no_install, or why'd you'd use look, or why And so on.....
###BUGALERT### Create a fetchware command to do this for users perhaps even
#plugin it into Module::Starter???? If possible.
####BUGALERT## Even have so that you can specify which API subs you want to
#override or avoid overriding, and then it will create the skelton with stubs
#for those API sub already having some empty POD crap and the correct
#prototypes.
###BUGALERT### Actually implement croak or more likely confess() support!!!
__END__
=pod
=head1 NAME
App::Fetchware - App::Fetchware is Fetchware's API used to make extensions.
=head1 VERSION
version 1.016
=head1 SYNOPSIS
### App::Fetchware's use inside a Fetchwarefile.
### See fetchware's new command for an easy way to create Fetchwarefiles.
use App::Fetchware;
# Only program, lookup_url, one or more mirrors, and some method of
# verification are required.
program 'Your program';
lookup_url 'http://whatevermirror.your/program/is/on';
gpg_keys_url 'http://whatevermirror.your/program/gpg/key/url.asc';
mirror 'http://whatevermirror1.your/program/is/on';
mirror 'http://whatevermirror2.your/program/is/on';
mirror 'http://whatevermirror3.your/program/is/on';
mirror 'http://whatevermirror4.your/program/is/on';
mirror 'http://whatevermirror5.your/program/is/on';
# filter is not required, but is often needed to tell fetchware which
# program in the lookup_url directory or what specific version you would
# want to install. For example, Apache maintains 3 versions 2.0, 2.2, and
# 2.4. filter is what allows you to select which version you want fetchware
# to use.
( run in 0.893 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )