Crypt-License
view release on metacpan or search on metacpan
do { pop @_; next; } if $i eq '..';
$pwd = "/$i" . $pwd;
}
};
##### code
my $host = &Sys::Hostname::hostname;
($host = "\L$host") =~ s/\s+//g;
&$user_info((caller)[1]); # defaults
sub import {
my ($alm) = ((caller)[1] =~ m|.+/auto/(.+)/.+\.al$|);
my $level=0;
my $i;
my $ptr;
while (1) {
($level, @_) = &$seek_caller($level);
# package name in [0]
###$i=0;
###while(caller($i)) { ++$i }
###@_ = caller($i-1);
$ptr = (defined ${"$_[0]::ptr2_License"})
&$user_info($ptr->{path});
(my @lic = &get_file($ptr->{path})) ||
die "could not open license file for $user";
my %parms;
$#lic = &extract(\@lic,\%parms) -1;
my $expire = 0;
if ( exists $parms{EXP} ) { # if the EXPiration is present
($expire = &date2time($parms{EXP})) ||
die "invalid expiration date $user license";
}
@_ = split('/',(caller)[1]); # last element
if ( $_[$#_] =~ /\.pm$/ ) {
@_ = split(/\./,$_[$#_]); # remove extension
}
my $key = $_[$#_-1];
unless ( exists $ptr->{$key} ) {
@_ = ();
if (exists $ptr->{private}) {
@_ = split(',',$ptr->{private});
foreach $i (0..$#_) {
$_[$i] = join('/',split('::',$_[$i]));
}
}
my $match = (caller)[1];
if (grep($match =~ /$_\.pm$/,@_)) {
$ptr->{$key} = $parms{KEY} or die "missing private key $user";
} else {
$ptr->{$key} = $parms{PKEY} or die "missing public key $user";
}
}
delete $parms{KEY};
delete $parms{PKEY};
my %chk;
&get_vals(\%parms,\%chk);
Util/t/util.t view on Meta::CPAN
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
$test = 2;
# NOT really needed =>use vars qw($ptr2_License);
my $me = (getpwuid((stat(&{sub {(caller)[1]};}))[4]))[7];
my $expected = $me .'/'.'README.LICENSE';
my $rv = path2License();
print "ptr2_License text does not match
got: $ptr2_License->{path}
exp: $expected\nnot "
unless $ptr2_License->{path} eq $expected;
print "ok $test\n";
++$test;
makeCert.pl view on Meta::CPAN
'DATE', # creation date, mm-dd-yy | yyyy or mmm dd yy | yyyy
'EXP', # expiration date * optional
'KEY', # hex key
'PKEY', # hex public key
# ----------------------------------
);
my (@newtxt,@tmptxt,%parms);
# get license text
$_ = &{sub{(caller)[1]}}; # license txt directory
@_ = split('/',$_);
pop @_;
$_ = join('/',@_,$License);
&error("Could not open $License.
$License must be in the same directory as makeCert.pl")
unless @newtxt = Crypt::License::get_file($_);
push(@newtxt,''); # newline in file
# try to get template text
&error("Could not open $ARGV[0]")
( run in 0.758 second using v1.01-cache-2.11-cpan-a3c8064c92c )