Update our mini-moosepan
Dave Rolsky [Thu, 30 Jul 2009 07:16:12 +0000 (02:16 -0500)]
Also fixed the script to make sure that the dependency checking is
using the same mirror as we actually fetch modules from.

moose-class/exercises/moosepan/RECENT
moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.89.tar.gz [deleted file]
moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.91.tar.gz [new file with mode: 0644]
moose-class/exercises/update-moosepan

index 32e67ec..0a951ba 100644 (file)
@@ -1,7 +1,2 @@
-authors/01mailrc.txt.gz
-authors/id/D/DR/DROLSKY/CHECKSUMS
-authors/id/D/DR/DROLSKY/Moose-0.88.tar.gz
-authors/id/V/VP/VPARSEVAL/CHECKSUMS
-authors/id/V/VP/VPARSEVAL/List-MoreUtils-0.24.tar.gz
+authors/id/D/DR/DROLSKY/Class-MOP-0.91.tar.gz
 modules/02packages.details.txt.gz
-modules/03modlist.data.gz
diff --git a/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.89.tar.gz b/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.89.tar.gz
deleted file mode 100644 (file)
index d4cd975..0000000
Binary files a/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.89.tar.gz and /dev/null differ
diff --git a/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.91.tar.gz b/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.91.tar.gz
new file mode 100644 (file)
index 0000000..5984e98
Binary files /dev/null and b/moose-class/exercises/moosepan/authors/id/D/DR/DROLSKY/Class-MOP-0.91.tar.gz differ
index 46b0dc4..8831a74 100755 (executable)
@@ -10,15 +10,42 @@ use Module::CoreList;
 use version;
 
 
+{
+    package CPAN::FindDependencies;
+
+    no warnings 'redefine';
+    # The real function assumes that if you provide an argument it's a
+    # local file, not a URI.
+    sub _get02packages {
+        my $file = shift;
+
+        get($file) ||
+            die(__PACKAGE__.": Couldn't fetch 02packages index file\n");
+    }
+}
+
+
 sub main {
-    my @deps = grep { is_real_dep($_) } finddeps('Moose');
+    # If this isn't fetched fresh each time, then CPAN::Mini gets
+    # confused (maybe it's a timestamp issue because of git?)
+    unlink './moosepan/modules/02packages.details.txt.gz'
+        or die $!;
+
+    my @deps
+        = grep { is_real_dep($_) }
+        finddeps( 'Moose',
+        '02packages' =>
+            'http://mirrors.kernel.org/cpan/modules/02packages.details.txt.gz'
+        );
 
     my @distros = map { $_->distribution() } @deps;
 
-    my $filter_sub = sub { return ! any { $_[0] eq $_ } @distros };
+    my $filter_sub = sub {
+        return !any { $_[0] eq $_ } @distros;
+    };
 
     CPAN::Mini->update_mirror(
-        remote       => 'ftp://mirrors2.kernel.org/pub/CPAN/',
+        remote       => 'http://mirrors.kernel.org/cpan/',
         local        => './moosepan',
         path_filters => $filter_sub,
         trace        => 1,