in reply to hoping to use PPM::InstallPackage

PPM 2.x is not compatible with PPM 3.x, for ppm3 see PPM::UI

Replies are listed 'Best First'.
Re^2: hoping to use PPM::InstallPackage
by ethrbunny (Monk) on Jun 07, 2007 at 15:59 UTC
    FWIW here is some code that will show you which repositories a given package is available from.
    use strict; use PPM::UI; my $target_list = PPM::UI::target_list(); my $rep_list = PPM::UI::repository_list(); my $list = PPM::UI::search( $rep_list->result, $target_list->result->[ +0], "Win32-FileOp", 1 ); my @arr = $list->{ "result" }; my $piece; foreach $piece ( @arr ) { my $piece0; foreach $piece0 ( @$piece) { print $piece0->{ "reps" }->[0]->{ "url_base" }; print "\n"; } }
    I don't understand all the nuances yet. Not by a long shot.

    Ill work on getting the PPM::Installer to be useful.
Re^2: hoping to use PPM::InstallPackage
by ethrbunny (Monk) on Jun 07, 2007 at 17:09 UTC
    Here is a bit that uses PPM::Installer to .. well.. install..
    use strict; use PPM::UI; my $target_list = PPM::UI::target_list(); my $rep_list = PPM::UI::repository_list(); PPM::UI::install( $rep_list->{ "result" }, $target_list->result->[0], +"XML::Tiny", {"dryrun" => 0}, \&status_callback)); sub status_callback { my($name, $version, $tname, $something, $p0, $p1, $p2) = @_; print "$name \t $version \t $tname \t $something \t $p0 \t $p1 \t + $p2 \n"; }
    There are some $opts for the install call - "from", "force", "follow" and "dryrun". The first 3 are as-is from PPM3.bat. "dryrun" is just what it says - show you what its going to do without actually doing it.