diff options
author | Klaus Kaempf <kkaempf@suse.de> | 2008-01-04 14:53:05 +0000 |
---|---|---|
committer | Klaus Kaempf <kkaempf@suse.de> | 2008-01-04 14:53:05 +0000 |
commit | d4cc87d6c4c8748b3532ffc13a39761bd47f0e6a (patch) | |
tree | 37778f5f64c97a08acf14c223137d0536e6089c2 /examples | |
parent | 2c41d48ed58e20ea4ef7e3db463299e1844512e0 (diff) | |
download | libsolv-d4cc87d6c4c8748b3532ffc13a39761bd47f0e6a.tar.gz libsolv-d4cc87d6c4c8748b3532ffc13a39761bd47f0e6a.tar.bz2 libsolv-d4cc87d6c4c8748b3532ffc13a39761bd47f0e6a.zip |
adapt to swig bindings (incomplete, non-working)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/perl/example.pl | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples/perl/example.pl b/examples/perl/example.pl index 7b4fe82..fae0d2c 100644 --- a/examples/perl/example.pl +++ b/examples/perl/example.pl @@ -1,40 +1,40 @@ #!/usr/bin/perl -use lib './blib/arch/auto/SaT'; +use lib '../../build/bindings/perl'; -use SaT; +use satsolverx; # Open Solvable file -open(F, "gzip -cd tmp/primary.gz |") || die; +# open(F, "gzip -cd tmp/primary.gz |") || die; # Create Pool and Repository -my $pool = new SaT::_Pool; -my $repo = $pool -> createRepo('repo'); +my $pool = new satsolverx::Pool; +my $repo = $pool -> create_repo('repo'); # Add Solvable to Repository -$repo -> addSolvable (F); -close(F) || die; +$repo -> add_solv ("tmp/primary"); +# close(F) || die; # Create Solver -my $solver = new SaT::Solver ($pool); +my $solver = $pool -> create_solver(); # Create dependencies to provides table -$pool -> createWhatProvides(); +$pool -> prepare(); -# Create Queue -my $job = new SaT::Queue; +# Create Transactions +my $job = $pool -> create_transaction(); # Push jobs on Queue -$job -> queuePush ( $SaT::SOLVER_INSTALL_SOLVABLE ); -if (! $job -> queuePush ( $pool -> selectSolvable ($repo,"pattern:default"))) { - die "failed to push job"; -} +my $pat = $pool -> find( "pattern:default" ) || die; +$job -> install( $pat ); + +# $job -> install( "pattern:default" ); # Solve the jobs $solver -> solve ($job); # Print packages to install -$a = $solver -> getInstallList($pool); +$a = $solver -> getInstallList(); foreach my $c (@{$a}) { print "$c\n"; } |