From 486ef5b06c54db7d322a5dfb7995a3ecd117dbbe Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Mon, 30 Jun 2014 18:15:31 +0200 Subject: [PATCH] pkg: retrieve existing install (or register callback). --- src/Network/HTTPClient.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Network/HTTPClient.cxx b/src/Network/HTTPClient.cxx index bfab8284f..6c9100ff8 100644 --- a/src/Network/HTTPClient.cxx +++ b/src/Network/HTTPClient.cxx @@ -155,6 +155,14 @@ void FGHTTPClient::init() #endif // of ENABLE_PACKAGE_SYSTEM } +static naRef f_package_existingInstall( pkg::Package& pkg, + const nasal::CallContext& ctx ) +{ + return ctx.to_nasal( + pkg.existingInstall( ctx.getArg(0) ) + ); +} + static naRef f_package_uninstall(pkg::Package& pkg, const nasal::CallContext& ctx) { pkg::InstallRef ins = pkg.existingInstall(); @@ -253,6 +261,7 @@ void FGHTTPClient::postinit() .member("catalog", &pkg::Package::catalog) .method("install", &pkg::Package::install) .method("uninstall", &f_package_uninstall) + .method("existingInstall", &f_package_existingInstall) .method("lprop", &pkg::Package::getLocalisedProp) .member("fileSize", &pkg::Package::fileSizeBytes);