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

commit 0a5c58e6d96c722b92e6981adb790a0ad5a884de
Author: Priyank <priy...@frugalware.org>
Date:   Mon Jun 8 14:44:43 2009 +0530

updates in class Package
* new method: getOwners() gets the list of packages that own a specified
file

diff --git a/pm.cc b/pm.cc
index 0c4833f..8249509 100644
--- a/pm.cc
+++ b/pm.cc
@@ -371,6 +371,19 @@ static int versionCompare(const std::string v1,const 
std::string v2)
return pacman_pkg_vercmp(v1.c_str(),v2.c_str());
}

+static bool getOwners(PackageList& plist,const string filename)
+{
+       bool    ret = false;
+       PM_LIST *list = NULL;
+
+       if ( (list=pacman_pkg_getowners((char*)filename.c_str())) )
+       {
+               plist = PackageList(list);
+               ret = true;
+       }
+       return ret;
+}
+
Group::Group()
{
grp = NULL;
diff --git a/pm.hh b/pm.hh
index 946caf7..fda4da4 100644
--- a/pm.hh
+++ b/pm.hh
@@ -79,6 +79,7 @@ namespace PM
bool loadFromFile(Package& p,const std::string file);
void free();
/* static methods */
+                       static bool getOwners(PackageList& plist,const 
std::string filename);
static int versionCompare(const std::string v1,const std::string v2);
};
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to