Permalink
Browse files

Start to work on visit().

  • Loading branch information...
1 parent b4c6190 commit 40fdca6f6830712063bbeb40a563160562cdc2c9 @jkeenan committed Feb 24, 2010
Showing with 50 additions and 0 deletions.
  1. +50 −0 lib/CPAN/Mini/Visit/Simple.pm
@@ -173,4 +173,54 @@ sub refresh_list {
return [ sort map { $derived->{$_}{distro} } keys %{$derived} ];
}
+sub visit {
+ local $Archive::Extract::PREFER_BIN = 1;
+ local $Archive::Extract::WARN = 0;
+ my ($self) = @_;
+}
+
+#sub _visit {
+# my ($archive, @cmd_line) = @_;
+#
+# my $tempd = tempd;
+#
+# my $ae = Archive::Extract->new( archive => $archive );
+#
+# my $olderr;
+#
+# # stderr > /dev/null if quiet
+# if ( ! $Archive::Extract::WARN ) {
+# open $olderr, ">&STDERR";
+# open STDERR, ">", File::Spec->devnull;
+# }
+#
+# my $extract_ok = $ae->extract;
+#
+# # restore stderr if quiet
+# if ( ! $Archive::Extract::WARN ) {
+# open STDERR, ">&", $olderr;
+# close $olderr;
+# }
+#
+# if ( ! $extract_ok ) {
+# warn "Couldn't extract '$archive'\n" if $Archive::Extract::WARN;
+# return;
+# }
+#
+# # most distributions unpack a single directory that we must enter
+# # but some behave poorly and unpack to the current directory
+# my @children = dir()->children;
+# if ( @children == 1 && -d $children[0] ) {
+# chdir $children[0];
+# }
+#
+# # execute command
+# my $rc = system( @cmd_line );
+# if ( $rc == -1 ) {
+# warn "Error running '@cmd_line': $!\n";
+# }
+#
+# return;
+#}
+
1;

0 comments on commit 40fdca6

Please sign in to comment.