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

commit 2075e6041bfcbfbdb276a039b1acdb24c71b3b68
Author: Priyank <priy...@frugalware.org>
Date:   Fri Jun 5 17:11:01 2009 +0530

update test program

diff --git a/main.cc b/main.cc
index 761f61a..ae096a4 100644
--- a/main.cc
+++ b/main.cc
@@ -12,6 +12,7 @@ int main(int argc,char **argv)
{
Args            args;
Database        db;
+       Package         *p;

//if( !args.parseArgs(argc,argv) )
//      return 1;
@@ -25,6 +26,21 @@ int main(int argc,char **argv)
cout<<"database registered: "<<db.getName()<<endl;
else
db.printStatus();
+
+       /* query the database for package info */
+       if( (p = db.readPackage("gfpm")) )
+       {
+               cout<<"Name: "<<p->getName()<<endl;
+               cout<<"Version: "<<p->getVersion()<<endl;
+               cout<<"Description: "<<p->getDescription()<<endl;
+               cout<<"URL: "<<p->getURL()<<endl;
+               cout<<"Arch: "<<p->getArch()<<endl;
+               cout<<"Packager: "<<p->getPackager()<<endl;
+       }
+       else
+       {
+               cerr<<"Couldn't read package information."<<endl;
+       }

/* unregister database */
db.unregisterDb();
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to