summaryrefslogtreecommitdiffstats
path: root/preps
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-06-01 19:45:05 +0200
committerJustin Davis <jrcd83@gmail.com>2012-06-01 19:45:05 +0200
commitd69b44bc8391f8adc3353e3778e291ff54e82e47 (patch)
tree22e80e392551a781114621c0ea43e171acf40ca4 /preps
parent29be38d2671db067c86e07fa6177cd14055a32ea (diff)
downloadgenpkg-d69b44bc8391f8adc3353e3778e291ff54e82e47.tar.gz
genpkg-d69b44bc8391f8adc3353e3778e291ff54e82e47.tar.xz
Update CPAN index filenames everywhere they are used.
cpandists => cpan.dists cpanmods => cpan.mods Fixes a bug where loadcore tried to use _vardir in perl-dist.
Diffstat (limited to 'preps')
-rwxr-xr-xpreps/perl4
-rwxr-xr-xpreps/perl.d/fetchcpan8
-rwxr-xr-xpreps/perl.d/perl-dist19
3 files changed, 16 insertions, 15 deletions
diff --git a/preps/perl b/preps/perl
index 9f8bb35..b17200c 100755
--- a/preps/perl
+++ b/preps/perl
@@ -24,7 +24,7 @@ sub matchdist
my $var = $ENV{'PKGVAR'}
or err('PKGVAR env variable is unset');
- if(!-f "$var/cpandists" || -M "$var/cpandists" > 1) {
+ if(!-f "$var/cpan.dists" || -M "$var/cpan.dists" > 1) {
print STDERR "$PROG: Refreshing local CPAN data... ";
my $cwd = getcwd();
chdir $var or die "chdir: $!";
@@ -34,7 +34,7 @@ sub matchdist
chdir $cwd or die "chdir: $!";
}
- open(DISTS, '<', "$var/cpandists") or err("open: $!");
+ open(DISTS, '<', "$var/cpan.dists") or err("open: $!");
while(<DISTS>) {
my @f = split;
my $d = lc $f[0]; $d =~ tr/-_/--/s;
diff --git a/preps/perl.d/fetchcpan b/preps/perl.d/fetchcpan
index c39a3df..b9ddeaa 100755
--- a/preps/perl.d/fetchcpan
+++ b/preps/perl.d/fetchcpan
@@ -31,13 +31,13 @@ NR < 10 { next }
END {
for (dist in dists) {
ver = dists[dist]
- print dist, ver, paths[dist] | "sort >cpan.dists"
+ print dist, ver, paths[dist] | "sort > cpan.dists"
}
- close("sort >cpandists")
+ close("sort > cpan.dists")
# Prints modules out in sorted order, too!
- while(getline<"cpandists" > 0) {
- print $1 "\n" mods[$1,$2] >"cpan.mods"
+ while((getline < "cpan.dists") > 0) {
+ print $1 "\n" mods[$1,$2] > "cpan.mods"
}
}
diff --git a/preps/perl.d/perl-dist b/preps/perl.d/perl-dist
index 4dd0d84..dd1413c 100755
--- a/preps/perl.d/perl-dist
+++ b/preps/perl.d/perl-dist
@@ -18,6 +18,7 @@ my %CoreMods = loadcore();
package Convert;
*DBG = *main::DBG;
+*vardir = *main::vardir;
use LWP::UserAgent qw();
use YAML::XS qw();
@@ -298,9 +299,9 @@ sub _distsofmods
return () if(@mods == 0);
@mods = _nocore(@mods);
- my $var = _vardir();
+ my $var = vardir();
open my $fh, '<', "$var/cpan.mods"
- or die "$PROG: failed to open $var/cpanmods: $!";
+ or die "$PROG: failed to open $var/cpan.mods: $!";
my %mods = map { ($_ => 1) } @mods;
my %dists;
@@ -337,12 +338,6 @@ sub _nocore
return @mods;
}
-sub _vardir
-{
- return $ENV{'PKGVAR'}
- or die "$PROG: PKGVAR env variable is unset\n";
-}
-
#-----------------------------------------------------------------------------
package main;
@@ -595,9 +590,15 @@ sub _readmedesc
return undef;
}
+sub vardir
+{
+ return $ENV{'PKGVAR'}
+ or die "$PROG: PKGVAR env variable is unset\n";
+}
+
sub loadcore
{
- my $cmpath = _vardir() . '/perlcore.mods';
+ my $cmpath = vardir() . '/perlcore.mods';
unless(-f $cmpath){
print STDERR <<"END_ERR";
$PROG: error: $cmpath is missing.