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

commit 9851ce47e6dcacff637bb7cdd8cb02609dd67ecf
Author: Priyank <priy...@frugalware.org>
Date:   Tue Jun 9 00:09:06 2009 +0530

Added new methods to class Package
* getDepends(): returns a PackageList of packages on which a package
depends
* getRemoves(): returns a PackageList of packages that the package
removes
* getReplaces(): returns a PackageList of packages that the package
replaces

diff --git a/pm.cc b/pm.cc
index 918e0a9..9cbc1b9 100644
--- a/pm.cc
+++ b/pm.cc
@@ -331,6 +331,45 @@ PackageList* Package::getProvides()
return ret;
}

+PackageList* Package::getDepends()
+{
+       PackageList *ret = NULL;
+       PM_LIST         *lst = NULL;
+
+       lst = (PM_LIST*) getInfo(PM_PKG_DEPENDS);
+       if ( lst )
+       {
+               ret = new PackageList(lst);
+       }
+       return ret;
+}
+
+PackageList* Package::getRemoves()
+{
+       PackageList *ret = NULL;
+       PM_LIST         *lst = NULL;
+
+       lst = (PM_LIST*) getInfo(PM_PKG_REMOVES);
+       if ( lst )
+       {
+               ret = new PackageList(lst);
+       }
+       return ret;
+}
+
+PackageList* Package::getReplaces()
+{
+       PackageList *ret = NULL;
+       PM_LIST         *lst = NULL;
+
+       lst = (PM_LIST*) getInfo(PM_PKG_REPLACES);
+       if ( lst )
+       {
+               ret = new PackageList(lst);
+       }
+       return ret;
+}
+
bool Package::checkMD5Sum()
{
bool ret = true;
diff --git a/pm.hh b/pm.hh
index 36ef2ba..594b20f 100644
--- a/pm.hh
+++ b/pm.hh
@@ -74,6 +74,9 @@ namespace PM
int getCompressedSize();
int getUncompressedSize();
int getReason();
+                       PackageList* getDepends();
+                       PackageList* getRemoves();
+                       PackageList* getReplaces();
PackageList* getProvides();
bool checkMD5Sum();
bool checkSHA1Sum();
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to