diff options
| author | Dan McGee <dan@archlinux.org> | 2011-06-30 10:37:08 -0500 | 
|---|---|---|
| committer | Dan McGee <dan@archlinux.org> | 2011-06-30 10:37:08 -0500 | 
| commit | ad577b3cb46dcaf1b143c55324a6eecf9f0ad7f1 (patch) | |
| tree | d79aa34734791bb069eab172b8ea3e0ee12bedc6 /src/pacman | |
| parent | 0f4aaeee42135d06dd18eb585eab3bae0e5fbf34 (diff) | |
| parent | fed3e09c94d204b4655656c703a178e6fa2144b3 (diff) | |
Merge remote-tracking branch 'allan/breakshit'
Diffstat (limited to 'src/pacman')
| -rw-r--r-- | src/pacman/callback.c | 10 | ||||
| -rw-r--r-- | src/pacman/callback.h | 8 | ||||
| -rw-r--r-- | src/pacman/conf.c | 10 | ||||
| -rw-r--r-- | src/pacman/conf.h | 4 | ||||
| -rw-r--r-- | src/pacman/database.c | 4 | ||||
| -rw-r--r-- | src/pacman/deptest.c | 2 | ||||
| -rw-r--r-- | src/pacman/package.c | 14 | ||||
| -rw-r--r-- | src/pacman/package.h | 8 | ||||
| -rw-r--r-- | src/pacman/query.c | 40 | ||||
| -rw-r--r-- | src/pacman/remove.c | 14 | ||||
| -rw-r--r-- | src/pacman/sync.c | 84 | ||||
| -rw-r--r-- | src/pacman/upgrade.c | 12 | ||||
| -rw-r--r-- | src/pacman/util.c | 40 | ||||
| -rw-r--r-- | src/pacman/util.h | 14 | 
14 files changed, 132 insertions, 132 deletions
| diff --git a/src/pacman/callback.c b/src/pacman/callback.c index ffca8bec..f579e7ae 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -153,7 +153,7 @@ static void fill_progress(const int bar_percent, const int disp_percent,  /* callback to handle messages/notifications from libalpm transactions */ -void cb_trans_evt(pmtransevt_t event, void *data1, void *data2) +void cb_trans_evt(alpm_transevt_t event, void *data1, void *data2)  {  	switch(event) {  		case PM_TRANS_EVT_CHECKDEPS_START: @@ -251,7 +251,7 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)  /* callback to handle questions from libalpm transactions (yes/no) */  /* TODO this is one of the worst ever functions written. void *data ? wtf */ -void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, +void cb_trans_conv(alpm_transconv_t event, void *data1, void *data2,                     void *data3, int *response)  {  	switch(event) { @@ -312,7 +312,7 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,  			{  				alpm_list_t *providers = (alpm_list_t *)data1;  				int count = alpm_list_count(providers); -				char *depstring = alpm_dep_compute_string((pmdepend_t *)data2); +				char *depstring = alpm_dep_compute_string((alpm_depend_t *)data2);  				printf(_(":: There are %d providers available for %s:\n"), count,  						depstring);  				free(depstring); @@ -343,7 +343,7 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,  }  /* callback to handle display of transaction progress */ -void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, +void cb_trans_progress(alpm_transprog_t event, const char *pkgname, int percent,                         size_t howmany, size_t current)  {  	/* size of line to allocate for text printing (e.g. not progressbar) */ @@ -655,7 +655,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)  }  /* Callback to handle notifications from the library */ -void cb_log(pmloglevel_t level, const char *fmt, va_list args) +void cb_log(alpm_loglevel_t level, const char *fmt, va_list args)  {  	if(!fmt || strlen(fmt) == 0) {  		return; diff --git a/src/pacman/callback.h b/src/pacman/callback.h index 1109a3b2..30b5a71a 100644 --- a/src/pacman/callback.h +++ b/src/pacman/callback.h @@ -25,14 +25,14 @@  #include <alpm.h>  /* callback to handle messages/notifications from libalpm transactions */ -void cb_trans_evt(pmtransevt_t event, void *data1, void *data2); +void cb_trans_evt(alpm_transevt_t event, void *data1, void *data2);  /* callback to handle questions from libalpm transactions (yes/no) */ -void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, +void cb_trans_conv(alpm_transconv_t event, void *data1, void *data2,                     void *data3, int *response);  /* callback to handle display of transaction progress */ -void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, +void cb_trans_progress(alpm_transprog_t event, const char *pkgname, int percent,                     size_t howmany, size_t remain);  /* callback to handle receipt of total download value */ @@ -41,7 +41,7 @@ void cb_dl_total(off_t total);  void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total);  /* callback to handle messages/notifications from pacman library */ -void cb_log(pmloglevel_t level, const char *fmt, va_list args); +void cb_log(alpm_loglevel_t level, const char *fmt, va_list args);  #endif /* _PM_CALLBACK_H */ diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 076e854d..50b4988f 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -378,7 +378,7 @@ static int _parse_options(const char *key, char *value,  	return 0;  } -static int _add_mirror(pmdb_t *db, char *value) +static int _add_mirror(alpm_db_t *db, char *value)  {  	const char *dbname = alpm_db_get_name(db);  	/* let's attempt a replacement for the current repo */ @@ -420,8 +420,8 @@ static int _add_mirror(pmdb_t *db, char *value)  static int setup_libalpm(void)  {  	int ret = 0; -	enum _pmerrno_t err; -	pmhandle_t *handle; +	enum _alpm_errno_t err; +	alpm_handle_t *handle;  	pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n"); @@ -502,7 +502,7 @@ static int setup_libalpm(void)  	alpm_option_set_usedelta(handle, config->usedelta);  	alpm_option_set_ignorepkgs(handle, config->ignorepkg); -	alpm_option_set_ignoregrps(handle, config->ignoregrp); +	alpm_option_set_ignoregroups(handle, config->ignoregrp);  	alpm_option_set_noupgrades(handle, config->noupgrade);  	alpm_option_set_noextracts(handle, config->noextract); @@ -535,7 +535,7 @@ static int finish_section(struct section_t *section, int parse_options)  {  	int ret = 0;  	alpm_list_t *i; -	pmdb_t *db; +	alpm_db_t *db;  	pm_printf(PM_LOG_DEBUG, "config: finish section '%s'\n", section->name); diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 4c44bfdd..64b911ab 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -70,7 +70,7 @@ typedef struct __config_t {  	unsigned short group;  	unsigned short noask;  	unsigned int ask; -	pmtransflag_t flags; +	alpm_transflag_t flags;  	pgp_verify_t sigverify;  	/* conf file options */ @@ -92,7 +92,7 @@ typedef struct __config_t {  	char *xfercommand;  	/* our connection to libalpm */ -	pmhandle_t *handle; +	alpm_handle_t *handle;  } config_t;  /* Operations */ diff --git a/src/pacman/database.c b/src/pacman/database.c index 292fa54a..b7490cea 100644 --- a/src/pacman/database.c +++ b/src/pacman/database.c @@ -40,9 +40,9 @@  int pacman_database(alpm_list_t *targets)  {  	alpm_list_t *i; -	pmdb_t *db_local; +	alpm_db_t *db_local;  	int retval = 0; -	pmpkgreason_t reason; +	alpm_pkgreason_t reason;  	if(targets == NULL) {  		pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n")); diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c index 99abd72d..0055c37e 100644 --- a/src/pacman/deptest.c +++ b/src/pacman/deptest.c @@ -33,7 +33,7 @@ int pacman_deptest(alpm_list_t *targets)  {  	alpm_list_t *i;  	alpm_list_t *deps = NULL; -	pmdb_t *localdb = alpm_option_get_localdb(config->handle); +	alpm_db_t *localdb = alpm_option_get_localdb(config->handle);  	for(i = targets; i; i = alpm_list_next(i)) {  		char *target = alpm_list_getdata(i); diff --git a/src/pacman/package.c b/src/pacman/package.c index 32156c53..6b480873 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -45,7 +45,7 @@   * @param from the type of package we are dealing with   * @param extra should we show extra information   */ -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra) +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)  {  	const char *reason;  	time_t bdate, idate; @@ -83,7 +83,7 @@ void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra)  	/* turn depends list into a text list */  	for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { -		pmdepend_t *dep = (pmdepend_t *)alpm_list_getdata(i); +		alpm_depend_t *dep = (alpm_depend_t *)alpm_list_getdata(i);  		depstrings = alpm_list_add(depstrings, alpm_dep_compute_string(dep));  	} @@ -151,7 +151,7 @@ void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra)  }  static const char *get_backup_file_status(const char *root, -		const pmbackup_t *backup) +		const alpm_backup_t *backup)  {  	char path[PATH_MAX];  	const char *ret; @@ -192,7 +192,7 @@ static const char *get_backup_file_status(const char *root,  /* Display list of backup files and their modification states   */ -void dump_pkg_backups(pmpkg_t *pkg) +void dump_pkg_backups(alpm_pkg_t *pkg)  {  	alpm_list_t *i;  	const char *root = alpm_option_get_root(config->handle); @@ -200,7 +200,7 @@ void dump_pkg_backups(pmpkg_t *pkg)  	if(alpm_pkg_get_backup(pkg)) {  		/* package has backup files, so print them */  		for(i = alpm_pkg_get_backup(pkg); i; i = alpm_list_next(i)) { -			const pmbackup_t *backup = alpm_list_getdata(i); +			const alpm_backup_t *backup = alpm_list_getdata(i);  			const char *value;  			if(!backup->hash) {  				continue; @@ -216,7 +216,7 @@ void dump_pkg_backups(pmpkg_t *pkg)  /* List all files contained in a package   */ -void dump_pkg_files(pmpkg_t *pkg, int quiet) +void dump_pkg_files(alpm_pkg_t *pkg, int quiet)  {  	const char *pkgname, *root, *filestr;  	alpm_list_t *i, *pkgfiles; @@ -239,7 +239,7 @@ void dump_pkg_files(pmpkg_t *pkg, int quiet)  /* Display the changelog of a package   */ -void dump_pkg_changelog(pmpkg_t *pkg) +void dump_pkg_changelog(alpm_pkg_t *pkg)  {  	void *fp = NULL; diff --git a/src/pacman/package.h b/src/pacman/package.h index 7a5e5853..6f71d20e 100644 --- a/src/pacman/package.h +++ b/src/pacman/package.h @@ -29,11 +29,11 @@ enum pkg_from {  	PKG_FROM_SYNCDB  }; -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra); +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra); -void dump_pkg_backups(pmpkg_t *pkg); -void dump_pkg_files(pmpkg_t *pkg, int quiet); -void dump_pkg_changelog(pmpkg_t *pkg); +void dump_pkg_backups(alpm_pkg_t *pkg); +void dump_pkg_files(alpm_pkg_t *pkg, int quiet); +void dump_pkg_changelog(alpm_pkg_t *pkg);  #endif /* _PM_PACKAGE_H */ diff --git a/src/pacman/query.c b/src/pacman/query.c index 62472cb7..826c2262 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -95,7 +95,7 @@ static int search_path(char **filename, struct stat *bufptr)  	return -1;  } -static void print_query_fileowner(const char *filename, pmpkg_t *info) +static void print_query_fileowner(const char *filename, alpm_pkg_t *info)  {  	if(!config->quiet) {  		printf(_("%s is owned by %s %s\n"), filename, @@ -113,7 +113,7 @@ static int query_fileowner(alpm_list_t *targets)  	char *append;  	size_t max_length;  	alpm_list_t *t; -	pmdb_t *db_local; +	alpm_db_t *db_local;  	/* This code is here for safety only */  	if(targets == NULL) { @@ -189,7 +189,7 @@ static int query_fileowner(alpm_list_t *targets)  		for(i = alpm_db_get_pkgcache(db_local); i && !found; i = alpm_list_next(i)) {  			alpm_list_t *j; -			pmpkg_t *info = alpm_list_getdata(i); +			alpm_pkg_t *info = alpm_list_getdata(i);  			for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) {  				char *ppath, *pdname; @@ -240,7 +240,7 @@ static int query_search(alpm_list_t *targets)  {  	alpm_list_t *i, *searchlist;  	int freelist; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	/* if we have a targets list, search for packages matching it */  	if(targets) { @@ -256,7 +256,7 @@ static int query_search(alpm_list_t *targets)  	for(i = searchlist; i; i = alpm_list_next(i)) {  		alpm_list_t *grp; -		pmpkg_t *pkg = alpm_list_getdata(i); +		alpm_pkg_t *pkg = alpm_list_getdata(i);  		if(!config->quiet) {  			printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); @@ -299,23 +299,23 @@ static int query_group(alpm_list_t *targets)  	alpm_list_t *i, *j;  	char *grpname = NULL;  	int ret = 0; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	if(targets == NULL) { -		for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) { -			pmgrp_t *grp = alpm_list_getdata(j); +		for(j = alpm_db_get_groupcache(db_local); j; j = alpm_list_next(j)) { +			alpm_group_t *grp = alpm_list_getdata(j);  			const alpm_list_t *p;  			for(p = grp->packages; p; p = alpm_list_next(p)) { -				pmpkg_t *pkg = alpm_list_getdata(p); +				alpm_pkg_t *pkg = alpm_list_getdata(p);  				printf("%s %s\n", grp->name, alpm_pkg_get_name(pkg));  			}  		}  	} else {  		for(i = targets; i; i = alpm_list_next(i)) { -			pmgrp_t *grp; +			alpm_group_t *grp;  			grpname = alpm_list_getdata(i); -			grp = alpm_db_readgrp(db_local, grpname); +			grp = alpm_db_readgroup(db_local, grpname);  			if(grp) {  				const alpm_list_t *p;  				for(p = grp->packages; p; p = alpm_list_next(p)) { @@ -335,7 +335,7 @@ static int query_group(alpm_list_t *targets)  	return ret;  } -static int is_foreign(pmpkg_t *pkg) +static int is_foreign(alpm_pkg_t *pkg)  {  	const char *pkgname = alpm_pkg_get_name(pkg);  	alpm_list_t *j; @@ -343,8 +343,8 @@ static int is_foreign(pmpkg_t *pkg)  	int match = 0;  	for(j = sync_dbs; j; j = alpm_list_next(j)) { -		pmdb_t *db = alpm_list_getdata(j); -		pmpkg_t *findpkg = alpm_db_get_pkg(db, pkgname); +		alpm_db_t *db = alpm_list_getdata(j); +		alpm_pkg_t *findpkg = alpm_db_get_pkg(db, pkgname);  		if(findpkg) {  			match = 1;  			break; @@ -356,7 +356,7 @@ static int is_foreign(pmpkg_t *pkg)  	return 0;  } -static int is_unrequired(pmpkg_t *pkg) +static int is_unrequired(alpm_pkg_t *pkg)  {  	alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg);  	if(requiredby == NULL) { @@ -366,7 +366,7 @@ static int is_unrequired(pmpkg_t *pkg)  	return 0;  } -static int filter(pmpkg_t *pkg) +static int filter(alpm_pkg_t *pkg)  {  	/* check if this package was explicitly installed */  	if(config->op_q_explicit && @@ -396,7 +396,7 @@ static int filter(pmpkg_t *pkg)  /* Loop through the packages. For each package,   * loop through files to check if they exist. */ -static int check(pmpkg_t *pkg) +static int check(alpm_pkg_t *pkg)  {  	alpm_list_t *i;  	const char *root; @@ -446,7 +446,7 @@ static int check(pmpkg_t *pkg)  	return (errors != 0 ? 1 : 0);  } -static int display(pmpkg_t *pkg) +static int display(alpm_pkg_t *pkg)  {  	int ret = 0; @@ -482,8 +482,8 @@ int pacman_query(alpm_list_t *targets)  	int ret = 0;  	int match = 0;  	alpm_list_t *i; -	pmpkg_t *pkg = NULL; -	pmdb_t *db_local; +	alpm_pkg_t *pkg = NULL; +	alpm_db_t *db_local;  	/* First: operations that do not require targets */ diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 60027ae2..4a23ab2e 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -33,8 +33,8 @@  static int remove_target(const char *target)  { -	pmpkg_t *info; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_pkg_t *info; +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	alpm_list_t *p;  	if((info = alpm_db_get_pkg(db_local, target)) != NULL) { @@ -47,13 +47,13 @@ static int remove_target(const char *target)  	}  		/* fallback to group */ -	pmgrp_t *grp = alpm_db_readgrp(db_local, target); +	alpm_group_t *grp = alpm_db_readgroup(db_local, target);  	if(grp == NULL) {  		pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target);  		return -1;  	}  	for(p = grp->packages; p; p = alpm_list_next(p)) { -		pmpkg_t *pkg = alpm_list_getdata(p); +		alpm_pkg_t *pkg = alpm_list_getdata(p);  		if(alpm_remove_pkg(config->handle, pkg) == -1) {  			pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target,  					alpm_strerror(alpm_errno(config->handle))); @@ -102,7 +102,7 @@ int pacman_remove(alpm_list_t *targets)  	/* Step 2: prepare the transaction based on its type, targets and flags */  	if(alpm_trans_prepare(config->handle, &data) == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),  		        alpm_strerror(err));  		switch(err) { @@ -114,7 +114,7 @@ int pacman_remove(alpm_list_t *targets)  				break;  			case PM_ERR_UNSATISFIED_DEPS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmdepmissing_t *miss = alpm_list_getdata(i); +					alpm_depmissing_t *miss = alpm_list_getdata(i);  					char *depstring = alpm_dep_compute_string(miss->depend);  					printf(_(":: %s: requires %s\n"), miss->target, depstring);  					free(depstring); @@ -131,7 +131,7 @@ int pacman_remove(alpm_list_t *targets)  	/* Search for holdpkg in target list */  	int holdpkg = 0;  	for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) { -		pmpkg_t *pkg = alpm_list_getdata(i); +		alpm_pkg_t *pkg = alpm_list_getdata(i);  		if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) {  			pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"),  							alpm_pkg_get_name(pkg)); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index fa30b8da..ce57d3cd 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -95,7 +95,7 @@ static int sync_cleandb(const char *dbpath, int keep_used)  			len = strlen(dname);  			char *dbname = strndup(dname, len - 3);  			for(i = syncdbs; i && !found; i = alpm_list_next(i)) { -				pmdb_t *db = alpm_list_getdata(i); +				alpm_db_t *db = alpm_list_getdata(i);  				found = !strcmp(dbname, alpm_db_get_name(db));  			}  			free(dbname); @@ -146,7 +146,7 @@ static int sync_cleancache(int level)  {  	alpm_list_t *i;  	alpm_list_t *sync_dbs = alpm_option_get_syncdbs(config->handle); -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	alpm_list_t *cachedirs = alpm_option_get_cachedirs(config->handle);  	int ret = 0; @@ -196,7 +196,7 @@ static int sync_cleancache(int level)  			char path[PATH_MAX];  			size_t pathlen;  			int delete = 1; -			pmpkg_t *localpkg = NULL, *pkg = NULL; +			alpm_pkg_t *localpkg = NULL, *pkg = NULL;  			const char *local_name, *local_version;  			if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { @@ -249,7 +249,7 @@ static int sync_cleancache(int level)  				alpm_list_t *j;  				/* check if this package is in a sync DB */  				for(j = sync_dbs; j && delete; j = alpm_list_next(j)) { -					pmdb_t *db = alpm_list_getdata(j); +					alpm_db_t *db = alpm_list_getdata(j);  					pkg = alpm_db_get_pkg(db, local_name);  					if(pkg != NULL && alpm_pkg_vercmp(local_version,  								alpm_pkg_get_version(pkg)) == 0) { @@ -284,7 +284,7 @@ static int sync_synctree(int level, alpm_list_t *syncs)  	int success = 0, ret;  	for(i = syncs; i; i = alpm_list_next(i)) { -		pmdb_t *db = alpm_list_getdata(i); +		alpm_db_t *db = alpm_list_getdata(i);  		ret = alpm_db_update((level < 2 ? 0 : 1), db);  		if(ret < 0) { @@ -308,11 +308,11 @@ static int sync_synctree(int level, alpm_list_t *syncs)  	return (success > 0);  } -static void print_installed(pmdb_t *db_local, pmpkg_t *pkg) +static void print_installed(alpm_db_t *db_local, alpm_pkg_t *pkg)  {  	const char *pkgname = alpm_pkg_get_name(pkg);  	const char *pkgver = alpm_pkg_get_version(pkg); -	pmpkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); +	alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname);  	if(lpkg) {  		const char *lpkgver = alpm_pkg_get_version(lpkg);  		if(strcmp(lpkgver,pkgver) == 0) { @@ -329,10 +329,10 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)  	alpm_list_t *i, *j, *ret;  	int freelist;  	int found = 0; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	for(i = syncs; i; i = alpm_list_next(i)) { -		pmdb_t *db = alpm_list_getdata(i); +		alpm_db_t *db = alpm_list_getdata(i);  		/* if we have a targets list, search for packages matching it */  		if(targets) {  			ret = alpm_db_search(db, targets); @@ -348,7 +348,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)  		}  		for(j = ret; j; j = alpm_list_next(j)) {  			alpm_list_t *grp; -			pmpkg_t *pkg = alpm_list_getdata(j); +			alpm_pkg_t *pkg = alpm_list_getdata(j);  			if(!config->quiet) {  				printf("%s/%s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -397,8 +397,8 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)  		for(i = targets; i; i = alpm_list_next(i)) {  			const char *grpname = alpm_list_getdata(i);  			for(j = syncs; j; j = alpm_list_next(j)) { -				pmdb_t *db = alpm_list_getdata(j); -				pmgrp_t *grp = alpm_db_readgrp(db, grpname); +				alpm_db_t *db = alpm_list_getdata(j); +				alpm_group_t *grp = alpm_db_readgroup(db, grpname);  				if(grp) {  					/* get names of packages in group */ @@ -415,10 +415,10 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)  		}  	} else {  		for(i = syncs; i; i = alpm_list_next(i)) { -			pmdb_t *db = alpm_list_getdata(i); +			alpm_db_t *db = alpm_list_getdata(i); -			for(j = alpm_db_get_grpcache(db); j; j = alpm_list_next(j)) { -				pmgrp_t *grp = alpm_list_getdata(j); +			for(j = alpm_db_get_groupcache(db); j; j = alpm_list_next(j)) { +				alpm_group_t *grp = alpm_list_getdata(j);  				if(level > 1) {  					for(k = grp->packages; k; k = alpm_list_next(k)) { @@ -451,7 +451,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)  			strncpy(target, i->data, 512);  			pkgstr = strchr(target, '/');  			if(pkgstr) { -				pmdb_t *db = NULL; +				alpm_db_t *db = NULL;  				repo = target;  				*pkgstr = '\0';  				++pkgstr; @@ -471,7 +471,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)  				}  				for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { -					pmpkg_t *pkg = alpm_list_getdata(k); +					alpm_pkg_t *pkg = alpm_list_getdata(k);  					if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {  						dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -489,10 +489,10 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)  				pkgstr = target;  				for(j = syncs; j; j = alpm_list_next(j)) { -					pmdb_t *db = alpm_list_getdata(j); +					alpm_db_t *db = alpm_list_getdata(j);  					for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { -						pmpkg_t *pkg = alpm_list_getdata(k); +						alpm_pkg_t *pkg = alpm_list_getdata(k);  						if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {  							dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -510,10 +510,10 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)  		}  	} else {  		for(i = syncs; i; i = alpm_list_next(i)) { -			pmdb_t *db = alpm_list_getdata(i); +			alpm_db_t *db = alpm_list_getdata(i);  			for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { -				pmpkg_t *pkg = alpm_list_getdata(j); +				alpm_pkg_t *pkg = alpm_list_getdata(j);  				dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1);  			}  		} @@ -525,15 +525,15 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)  static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)  {  	alpm_list_t *i, *j, *ls = NULL; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	if(targets) {  		for(i = targets; i; i = alpm_list_next(i)) {  			const char *repo = alpm_list_getdata(i); -			pmdb_t *db = NULL; +			alpm_db_t *db = NULL;  			for(j = syncs; j; j = alpm_list_next(j)) { -				pmdb_t *d = alpm_list_getdata(j); +				alpm_db_t *d = alpm_list_getdata(j);  				if(strcmp(repo, alpm_db_get_name(d)) == 0) {  					db = d; @@ -555,10 +555,10 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)  	}  	for(i = ls; i; i = alpm_list_next(i)) { -		pmdb_t *db = alpm_list_getdata(i); +		alpm_db_t *db = alpm_list_getdata(i);  		for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { -			pmpkg_t *pkg = alpm_list_getdata(j); +			alpm_pkg_t *pkg = alpm_list_getdata(j);  			if(!config->quiet) {  				printf("%s %s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -580,12 +580,12 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)  static alpm_list_t *syncfirst(void) {  	alpm_list_t *i, *res = NULL; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	alpm_list_t *syncdbs = alpm_option_get_syncdbs(config->handle);  	for(i = config->syncfirst; i; i = alpm_list_next(i)) {  		char *pkgname = alpm_list_getdata(i); -		pmpkg_t *pkg = alpm_db_get_pkg(db_local, pkgname); +		alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);  		if(pkg == NULL) {  			continue;  		} @@ -598,11 +598,11 @@ static alpm_list_t *syncfirst(void) {  	return res;  } -static pmdb_t *get_db(const char *dbname) +static alpm_db_t *get_db(const char *dbname)  {  	alpm_list_t *i;  	for(i = alpm_option_get_syncdbs(config->handle); i; i = i->next) { -		pmdb_t *db = i->data; +		alpm_db_t *db = i->data;  		if(strcmp(alpm_db_get_name(db), dbname) == 0) {  			return db;  		} @@ -610,12 +610,12 @@ static pmdb_t *get_db(const char *dbname)  	return NULL;  } -static int process_pkg(pmpkg_t *pkg) +static int process_pkg(alpm_pkg_t *pkg)  {  	int ret = alpm_add_pkg(config->handle, pkg);  	if(ret == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		if(err == PM_ERR_TRANS_DUP_TARGET  				|| err == PM_ERR_PKG_IGNORED) {  			/* just skip duplicate or ignored targets */ @@ -634,7 +634,7 @@ static int process_group(alpm_list_t *dbs, char *group)  {  	int ret = 0;  	alpm_list_t *i; -	alpm_list_t *pkgs = alpm_find_grp_pkgs(dbs, group); +	alpm_list_t *pkgs = alpm_find_group_pkgs(dbs, group);  	int count = alpm_list_count(pkgs);  	if(!count) { @@ -653,7 +653,7 @@ static int process_group(alpm_list_t *dbs, char *group)  		for(i = pkgs; i; i = alpm_list_next(i)) {  			if(array[n++] == 0)  				continue; -			pmpkg_t *pkg = alpm_list_getdata(i); +			alpm_pkg_t *pkg = alpm_list_getdata(i);  			if(process_pkg(pkg) == 1) {  				ret = 1; @@ -663,7 +663,7 @@ static int process_group(alpm_list_t *dbs, char *group)  		}  	} else {  		for(i = pkgs; i; i = alpm_list_next(i)) { -			pmpkg_t *pkg = alpm_list_getdata(i); +			alpm_pkg_t *pkg = alpm_list_getdata(i);  			if(process_pkg(pkg) == 1) {  				ret = 1; @@ -678,7 +678,7 @@ cleanup:  static int process_targname(alpm_list_t *dblist, char *targname)  { -	pmpkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname); +	alpm_pkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname);  	/* #FS#23342 - skip ignored packages when user says no */  	if(alpm_errno(config->handle) == PM_ERR_PKG_IGNORED) { @@ -705,7 +705,7 @@ static int process_target(char *target)  	alpm_list_t *dblist = NULL;  	if(targname) { -		pmdb_t *db = NULL; +		alpm_db_t *db = NULL;  		*targname = '\0';  		targname++; @@ -763,7 +763,7 @@ static int sync_trans(alpm_list_t *targets)  	/* Step 2: "compute" the transaction based on targets and flags */  	if(alpm_trans_prepare(config->handle, &data) == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),  		        alpm_strerror(err));  		switch(err) { @@ -775,7 +775,7 @@ static int sync_trans(alpm_list_t *targets)  				break;  			case PM_ERR_UNSATISFIED_DEPS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmdepmissing_t *miss = alpm_list_getdata(i); +					alpm_depmissing_t *miss = alpm_list_getdata(i);  					char *depstring = alpm_dep_compute_string(miss->depend);  					printf(_(":: %s: requires %s\n"), miss->target, depstring);  					free(depstring); @@ -783,7 +783,7 @@ static int sync_trans(alpm_list_t *targets)  				break;  			case PM_ERR_CONFLICTING_DEPS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmconflict_t *conflict = alpm_list_getdata(i); +					alpm_conflict_t *conflict = alpm_list_getdata(i);  					/* only print reason if it contains new information */  					if(strcmp(conflict->package1, conflict->reason) == 0 ||  							strcmp(conflict->package2, conflict->reason) == 0) { @@ -830,13 +830,13 @@ static int sync_trans(alpm_list_t *targets)  	}  	if(alpm_trans_commit(config->handle, &data) == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),  		        alpm_strerror(err));  		switch(err) {  			case PM_ERR_FILE_CONFLICTS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmfileconflict_t *conflict = alpm_list_getdata(i); +					alpm_fileconflict_t *conflict = alpm_list_getdata(i);  					switch(conflict->type) {  						case PM_FILECONFLICT_TARGET:  							printf(_("%s exists in both '%s' and '%s'\n"), diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index c1f72f6d..31536a43 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -74,7 +74,7 @@ int pacman_upgrade(alpm_list_t *targets)  	/* add targets to the created transaction */  	for(i = targets; i; i = alpm_list_next(i)) {  		char *targ = alpm_list_getdata(i); -		pmpkg_t *pkg; +		alpm_pkg_t *pkg;  		if(alpm_pkg_load(config->handle, targ, 1, check_sig, &pkg) != 0) {  			pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", @@ -94,7 +94,7 @@ int pacman_upgrade(alpm_list_t *targets)  	/* Step 2: "compute" the transaction based on targets and flags */  	/* TODO: No, compute nothing. This is stupid. */  	if(alpm_trans_prepare(config->handle, &data) == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),  		        alpm_strerror(err));  		switch(err) { @@ -106,7 +106,7 @@ int pacman_upgrade(alpm_list_t *targets)  				break;  			case PM_ERR_UNSATISFIED_DEPS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmdepmissing_t *miss = alpm_list_getdata(i); +					alpm_depmissing_t *miss = alpm_list_getdata(i);  					char *depstring = alpm_dep_compute_string(miss->depend);  					/* TODO indicate if the error was a virtual package or not: @@ -118,7 +118,7 @@ int pacman_upgrade(alpm_list_t *targets)  				break;  			case PM_ERR_CONFLICTING_DEPS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmconflict_t *conflict = alpm_list_getdata(i); +					alpm_conflict_t *conflict = alpm_list_getdata(i);  					if(strcmp(conflict->package1, conflict->reason) == 0 ||  							strcmp(conflict->package2, conflict->reason) == 0) {  						printf(_(":: %s and %s are in conflict\n"), @@ -162,13 +162,13 @@ int pacman_upgrade(alpm_list_t *targets)  	}  	if(alpm_trans_commit(config->handle, &data) == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),  				alpm_strerror(err));  		switch(err) {  			case PM_ERR_FILE_CONFLICTS:  				for(i = data; i; i = alpm_list_next(i)) { -					pmfileconflict_t *conflict = alpm_list_getdata(i); +					alpm_fileconflict_t *conflict = alpm_list_getdata(i);  					switch(conflict->type) {  						case PM_FILECONFLICT_TARGET:  							printf(_("%s exists in both '%s' and '%s'\n"), diff --git a/src/pacman/util.c b/src/pacman/util.c index 75e67170..6a93f6df 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -49,7 +49,7 @@  #include "callback.h" -int trans_init(pmtransflag_t flags) +int trans_init(alpm_transflag_t flags)  {  	int ret;  	if(config->print) { @@ -60,7 +60,7 @@ int trans_init(pmtransflag_t flags)  	}  	if(ret == -1) { -		enum _pmerrno_t err = alpm_errno(config->handle); +		enum _alpm_errno_t err = alpm_errno(config->handle);  		pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"),  				alpm_strerror(err));  		if(err == PM_ERR_HANDLE_LOCK) { @@ -660,13 +660,13 @@ static alpm_list_t *create_verbose_header(int install)  }  /* returns package info as list of strings */ -static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) +static alpm_list_t *create_verbose_row(alpm_pkg_t *pkg, int install)  {  	char *str;  	double size;  	const char *label;  	alpm_list_t *ret = NULL; -	pmdb_t *ldb = alpm_option_get_localdb(config->handle); +	alpm_db_t *ldb = alpm_option_get_localdb(config->handle);  	/* a row consists of the package name, */  	pm_asprintf(&str, "%s", alpm_pkg_get_name(pkg)); @@ -674,7 +674,7 @@ static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install)  	/* old and new versions */  	if(install) { -		pmpkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg)); +		alpm_pkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg));  		pm_asprintf(&str, "%s",  				oldpkg != NULL ? alpm_pkg_get_version(oldpkg) : "");  		ret = alpm_list_add(ret, str); @@ -700,7 +700,7 @@ void display_targets(const alpm_list_t *pkgs, int install)  	const alpm_list_t *i;  	off_t isize = 0, rsize = 0, dlsize = 0;  	alpm_list_t *j, *lp, *header = NULL, *targets = NULL; -	pmdb_t *db_local = alpm_option_get_localdb(config->handle); +	alpm_db_t *db_local = alpm_option_get_localdb(config->handle);  	if(!pkgs) {  		return; @@ -708,10 +708,10 @@ void display_targets(const alpm_list_t *pkgs, int install)  	/* gather pkg infos */  	for(i = pkgs; i; i = alpm_list_next(i)) { -		pmpkg_t *pkg = alpm_list_getdata(i); +		alpm_pkg_t *pkg = alpm_list_getdata(i);  		if(install) { -			pmpkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg)); +			alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg));  			dlsize += alpm_pkg_download_size(pkg);  			if(lpkg) {  				/* add up size of all removed packages */ @@ -779,7 +779,7 @@ out:  	free(str);  } -static off_t pkg_get_size(pmpkg_t *pkg) +static off_t pkg_get_size(alpm_pkg_t *pkg)  {  	switch(config->op) {  		case PM_OP_SYNC: @@ -791,7 +791,7 @@ static off_t pkg_get_size(pmpkg_t *pkg)  	}  } -static char *pkg_get_location(pmpkg_t *pkg) +static char *pkg_get_location(alpm_pkg_t *pkg)  {  	alpm_list_t *servers;  	char *string = NULL; @@ -856,7 +856,7 @@ void print_packages(const alpm_list_t *packages)  		config->print_format = strdup("%l");  	}  	for(i = packages; i; i = alpm_list_next(i)) { -		pmpkg_t *pkg = alpm_list_getdata(i); +		alpm_pkg_t *pkg = alpm_list_getdata(i);  		char *string = strdup(config->print_format);  		char *temp = string;  		/* %n : pkgname */ @@ -882,7 +882,7 @@ void print_packages(const alpm_list_t *packages)  		/* %r : repo */  		if(strstr(temp,"%r")) {  			const char *repo = "local"; -			pmdb_t *db = alpm_pkg_get_db(pkg); +			alpm_db_t *db = alpm_pkg_get_db(pkg);  			if(db) {  				repo = alpm_db_get_name(db);  			} @@ -910,7 +910,7 @@ int str_cmp(const void *s1, const void *s2)  	return strcmp(s1, s2);  } -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg) +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg)  {  	alpm_list_t *old = alpm_pkg_get_optdepends(oldpkg);  	alpm_list_t *new = alpm_pkg_get_optdepends(newpkg); @@ -922,7 +922,7 @@ void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg)  	alpm_list_free(optdeps);  } -void display_optdepends(pmpkg_t *pkg) +void display_optdepends(alpm_pkg_t *pkg)  {  	alpm_list_t *optdeps = alpm_pkg_get_optdepends(pkg);  	if(optdeps) { @@ -949,8 +949,8 @@ void select_display(const alpm_list_t *pkglist)  	const char *dbname = NULL;  	for (i = pkglist; i; i = i->next) { -		pmpkg_t *pkg = alpm_list_getdata(i); -		pmdb_t *db = alpm_pkg_get_db(pkg); +		alpm_pkg_t *pkg = alpm_list_getdata(i); +		alpm_db_t *db = alpm_pkg_get_db(pkg);  		if(!dbname)  			dbname = alpm_db_get_name(db); @@ -1194,7 +1194,7 @@ int noyes(char *fmt, ...)  	return ret;  } -int pm_printf(pmloglevel_t level, const char *format, ...) +int pm_printf(alpm_loglevel_t level, const char *format, ...)  {  	int ret;  	va_list args; @@ -1207,7 +1207,7 @@ int pm_printf(pmloglevel_t level, const char *format, ...)  	return ret;  } -int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) +int pm_fprintf(FILE *stream, alpm_loglevel_t level, const char *format, ...)  {  	int ret;  	va_list args; @@ -1236,7 +1236,7 @@ int pm_asprintf(char **string, const char *format, ...)  	return ret;  } -int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list args) +int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args)  {  	int ret = 0;  	char *msg = NULL; @@ -1272,7 +1272,7 @@ int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list  	return ret;  } -int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args) +int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list args)  {  	int ret = 0; diff --git a/src/pacman/util.h b/src/pacman/util.h index d8ae7d80..5d86dfda 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -39,7 +39,7 @@  /* update speed for the fill_progress based functions */  #define UPDATE_SPEED_SEC 0.2f -int trans_init(pmtransflag_t flags); +int trans_init(alpm_transflag_t flags);  int trans_release(void);  int needs_root(void);  int getcols(void); @@ -58,19 +58,19 @@ void list_display(const char *title, const alpm_list_t *list);  void list_display_linebreak(const char *title, const alpm_list_t *list);  void display_targets(const alpm_list_t *pkgs, int install);  int str_cmp(const void *s1, const void *s2); -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg); -void display_optdepends(pmpkg_t *pkg); +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); +void display_optdepends(alpm_pkg_t *pkg);  void print_packages(const alpm_list_t *packages);  void select_display(const alpm_list_t *pkglist);  int select_question(int count);  int multiselect_question(char *array, int count);  int yesno(char *fmt, ...);  int noyes(char *fmt, ...); -int pm_printf(pmloglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); -int pm_fprintf(FILE *stream, pmloglevel_t level, const char *format, ...) __attribute__((format(printf,3,4))); +int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); +int pm_fprintf(FILE *stream, alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,3,4)));  int pm_asprintf(char **string, const char *format, ...); -int pm_vfprintf(FILE *stream, pmloglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); -int pm_vasprintf(char **string, pmloglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); +int pm_vfprintf(FILE *stream, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0))); +int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args) __attribute__((format(printf,3,0)));  #ifndef HAVE_STRNDUP  char *strndup(const char *s, size_t n); | 
