Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=e705cafcf84d11cc773c5fb4b80411e2a0496703
commit e705cafcf84d11cc773c5fb4b80411e2a0496703 Author: Priyank <priy...@frugalware.org> Date: Thu Jun 4 16:40:35 2009 +0530 Added two new methods to the Database class * methods: Name, FirstServer diff --git a/main.m b/main.m index d947c36..16b6415 100644 --- a/main.m +++ b/main.m @@ -4,19 +4,21 @@ int main(void) { id db; id pkg; - + /* initialize libpacman */ pacman_initialize ("/"); - + /* register the local package database */ db = [[Database new] Register: "local"]; - + if ( [db Status] ) { [db PrintStatus:stderr]; return 1; } - + + printf ("Repository: %s\n", [db Name]); + /* query the database */ pkg = [db ReadPackage: "gfpm"]; diff --git a/pm.h b/pm.h index 7e00468..6a6dab4 100644 --- a/pm.h +++ b/pm.h @@ -19,6 +19,8 @@ { PM_DB *db; /* database pointer */ } +- (STR) Name; +- (STR) FirstServer; - Register: (STR) s; - Unregister; - Update: (int) f; diff --git a/pm.m b/pm.m index ce6ebee..7ab4342 100644 --- a/pm.m +++ b/pm.m @@ -24,6 +24,14 @@ @end @implementation Database +- (STR) Name +{ + return pacman_db_getinfo(db,PM_DB_TREENAME); +} +- (STR) FirstServer +{ + return pacman_db_getinfo(db,PM_DB_FIRSTSERVER); +} - Register: (STR) s { _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git