NAME

slackget10::PkgTools - A wrapper for the pkgtools action(installpkg, upgradepkg and removepkg)

VERSION

Version 0.4.6

SYNOPSIS

This class is anoter wrapper for slack-get. It will encapsulate the pkgtools system call.

use slackget10::PkgTools;

my $pkgtool = slackget10::PkgTools->new($config);
$pkgtool->install($package1);
$pkgtool->remove($package_list);
foreach (@{$packagelist->get_all})
{
	print "Status for ",$_->name," : ",$_->status()->to_string,"\n";
}
$pkgtool->upgrade($package_list);

CONSTRUCTOR

new

Take a slackget10::Config object as argument :

my $pkgtool = new slackget10::PkgTool ($config);

FUNCTIONS

slackget10::PkgTools methods used the followings status :

0 : Package have been installed successfully.
1 : Package have been upgraded successfully.
2 : Package have been removed successfully.
3 : Can't install package : new package not found in the cache.
4 : Can't remove package : no such package installed.
5 : Can't upgrade package : new package not found in the cache.
6 : Can't install package : an error occured during <installpkg-binary /> system call
7 : Can't remove package : an error occured during <removepkg-binary /> system call
8 : Can't upgrade package : an error occured during <upgradepkg-binary /> system call
9 : Package scheduled for install on next reboot.
10 : An error occured in the slackget10::PkgTool class (during installpkg, upgradepkg or removepkg) but the class is unable to understand the error.

install

Take a single slackget10::Package object or a single slackget10::PackageList as argument and call installpkg on all this packages. Return 1 or undef if an error occured. But methods from the slackget10::PkgTools class don't return on the first error, it will try to install all packages. Additionnally, for each package, set a status.

$pkgtool->install($package_list);

upgrade

Take a single slackget10::Package object or a single slackget10::PackageList as argument and call upgradepkg on all this packages. Return 1 or undef if an error occured. But methods from the slackget10::PkgTools class don't return on the first error, it will try to install all packages. Additionnally, for each package, set a status.

$pkgtool->install($package_list) ;

remove

Take a single slackget10::Package object or a single slackget10::PackageList as argument and call installpkg on all this packages. Return 1 or undef if an error occured. But methods from the slackget10::PkgTools class don't return on the first error, it will try to install all packages. Additionnally, for each package, set a status.

$pkgtool->install($package_list);

info_output

Accessor to set/get the output medium to send informations about current operation. You must set a valid handle (STD*, filehandle, socket, etc.) or undef.

You can get an undefined value if the handle is not set.

Setting the output media activate the output system.

connection_id

Accessor to set/get the connection id of a connection to or from a slack-get daemon. This is here if the output handle is that kind of connection. Anyway this value must be true so set it to 1 if you want an output.

AUTHOR

DUPUIS Arnaud, <a.dupuis@infinityperl.org>

BUGS

Please report any bugs or feature requests to bug-slackget10-networking@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=slackget10. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2005 DUPUIS Arnaud, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.