Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   DRAFT: API changes for pacman-3.5 (http://www.linux-archive.org/archlinux-pacman-development/485952-draft-api-changes-pacman-3-5-a.html)

Allan McRae 02-07-2011 02:58 AM

DRAFT: API changes for pacman-3.5
 
This is a draft for the README file update for pacman-3.5.

I have flagged two areas that I am not particularly clear at what
happened. I would be great if the people involved in those changes
could make the appropriate adjustments.


Allan


API CHANGES BETWEEN 3.4 AND 3.5
===============================

[REMOVED]
- alpm_db_register_local()
- alpm_pkg_has_force()

[CHANGED]
- interface to pkgcache
- alpm_db_get_pkgcache() returns pmpkghash_t
- alpm_db_get_pkgcache_list() can be used to get an alpm_list_t
interface to the pmpkghash_t
- alpm_trans_cb_progress type had some types changed from int to size_t


## HELP!!!
- these changes...
-int alpm_sync_target(char *target);
-int alpm_sync_dbtarget(char *db, char *target);
-int alpm_add_target(char *target);
-int alpm_remove_target(char *target);
+int alpm_add_pkg(pmpkg_t *pkg);
+int alpm_remove_pkg(pmpkg_t *pkg);


## HELP!!!
- alpm_deptest() is replaced by the more flexibile alpm_find_satisfier()
-int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
alpm_list_t *alpm_checkdeps(alpm_list_t *pkglist, int reversedeps,
alpm_list_t *remove, alpm_list_t *upgrade);
-alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets);
+pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char
*depstring);
+pmpkg_t *alpm_find_dbs_satisfier(alpm_list_t *dbs, const char
*depstring);



- size_t used for alpm_list_t sizes
- return type for alpm_list_count()
- parameter type in alpm_list_msort() and alpm_list_nth()

[ADDED]
- pmpkghash_t struct
- alpm_option_get_checkspace(), alpm_option_set_checkspace()
- alpm_find_grp_pkgs()
- alpm_trans_get_flags()
- error codes:
PM_ERR_DISK_SPACE, PM_ERR_WRITE
- flags
PM_TRANS_FLAG_NODEPVERSION, PM_TRANS_EVT_DISKSPACE_START,
PM_TRANS_EVT_DISKSPACE_DONE, PM_TRANS_CONV_SELECT_PROVIDER,
PM_TRANS_PROGRESS_DISKSPACE_START, PM_TRANS_PROGRESS_INTEGRITY_START

Xavier Chantry 02-19-2011 12:43 PM

DRAFT: API changes for pacman-3.5
 
On Mon, Feb 7, 2011 at 4:58 AM, Allan McRae <allan@archlinux.org> wrote:
> This is a draft for the README file update for pacman-3.5.
>
> I have flagged two areas that I am not particularly clear at what happened.
> *I would be great if the people involved in those changes could make the
> appropriate adjustments.
>

I am afraid that would be me.

>
>
> ## HELP!!!
> - these changes...
> * *-int alpm_sync_target(char *target);
> * *-int alpm_sync_dbtarget(char *db, char *target);
> * *-int alpm_add_target(char *target);
> * *-int alpm_remove_target(char *target);
> * *+int alpm_add_pkg(pmpkg_t *pkg);
> * *+int alpm_remove_pkg(pmpkg_t *pkg);
>

- the interface to add/remove targets was changed to take pmpkg_t
rather than char * which was ambiguous.

alpm_sync_target(char *target) and alpm_sync_dbtarget(char *db, char
*target) are replaced by alpm_add_pkg(pmpkg_t *pkg).
Packages can come from alpm_db_get_pkg (for normal targets),
alpm_find_dbs_satisfier (for versioned provisions) or
alpm_find_grp_pkgs (for groups).

alpm_add_target(char *target) is replaced by alpm_pkg_load + alpm_add_pkg.

alpm_remove_target is replaced by alpm_remove_pkg(pmpkg_t *pkg), with
packages coming from alpm_db_get_pkg(db_local, target) or
alpm_db_readgrp(db_local, target) + alpm_grp_get_pkgs(grp).

>
> ## HELP!!!
> - alpm_deptest() is replaced by the more flexibile alpm_find_satisfier()
> * *-int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
> * * alpm_list_t *alpm_checkdeps(alpm_list_t *pkglist, int reversedeps,
> * * * * * * * * * *alpm_list_t *remove, alpm_list_t *upgrade);
> * *-alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets);
> * *+pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring);
> * *+pmpkg_t *alpm_find_dbs_satisfier(alpm_list_t *dbs, const char
> *depstring);
>
>

- alpm_deptest() is replaced by the more flexible alpm_find_satisfier()
- alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) was removed because the
low levels function dealing with pmdepend_t (splitdep and depfree come
to mind) are not exposed, which makes depcmp useless to a frontend.

(I mentioned alpm_find_dbs_satisfier above in the target change)


All times are GMT. The time now is 11:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.