Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=baa6d340301c176ada16f157cfb0e30da0db729e

commit baa6d340301c176ada16f157cfb0e30da0db729e
Author: James Buren <r...@frugalware.org>
Date:   Fri May 29 15:29:57 2009 -0500

pacman.cc
* add package load method

diff --git a/pacman.cc b/pacman.cc
index e4509ef..8d83511 100644
--- a/pacman.cc
+++ b/pacman.cc
@@ -48,9 +48,13 @@ bool Package::load(const std::string &name)
{
std::ifstream file( name.c_str() );
if( file.is_open() )
-       {
-               file.close();
pacman_pkg_load( (char *) name.c_str(), &pkg );
-       }
+       return isvalid();
+}
+
+bool Package::load(PM::Database &database,const std::string &name)
+{
+       if( database.isvalid() )
+               pkg = pacman_db_readpkg( database.get_db(), name.c_str() );
return isvalid();
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to