Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-20 09:10:23 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-20 09:10:23 +0000
commitaa1c0ba9f8787fc3b1a1190103e394b0c1c95922 (patch)
treeed0c9675f7fc5da043a69b36e0b8c6c8e05cb583 /lib/libalpm/sync.c
parentb8b9596b13de957566211b0e1db3e473ed66e147 (diff)
* repo-add script - to add entries to a db file directly from package data (no PKGBUILD)
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 9fd1884f..acc48362 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -790,7 +790,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, pmlist_t **data)
fname = _alpm_pkg_makefilename(spkg);
if(trans->flags & PM_TRANS_FLAG_PRINTURIS) {
- EVENT(trans, PM_TRANS_EVT_PRINTURI, alpm_db_getinfo(current, PM_DB_FIRSTSERVER), fname);
+ EVENT(trans, PM_TRANS_EVT_PRINTURI, (char *)alpm_db_get_url(current), fname);
} else {
struct stat buf;
snprintf(path, PATH_MAX, "%s/%s", ldir, fname);
@@ -818,11 +818,8 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, pmlist_t **data)
*/
_alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n"));
alpm_logaction(_("warning: couldn't create package cache, using /tmp instead"));
- snprintf(ldir, PATH_MAX, "%s/tmp", handle->root);
- if(_alpm_handle_set_option(handle, PM_OPT_CACHEDIR, (long)"/tmp") == -1) {
- _alpm_log(PM_LOG_WARNING, _("failed to set option CACHEDIR (%s)\n"), alpm_strerror(pm_errno));
- RET_ERR(PM_ERR_RETRIEVE, -1);
- }
+ snprintf(ldir, PATH_MAX, "%stmp", alpm_option_get_root());
+ alpm_option_set_cachedir(ldir);
varcache = 0;
}
}
@@ -1054,4 +1051,28 @@ error:
return(-1);
}
+unsigned char alpm_sync_get_type(pmsyncpkg_t *sync)
+{
+ /* Sanity checks */
+ ASSERT(sync != NULL, return(-1));
+
+ return sync->type;
+}
+
+pmpkg_t *alpm_sync_get_package(pmsyncpkg_t *sync)
+{
+ /* Sanity checks */
+ ASSERT(sync != NULL, return(NULL));
+
+ return sync->pkg;
+}
+
+void *alpm_sync_get_data(pmsyncpkg_t *sync)
+{
+ /* Sanity checks */
+ ASSERT(sync != NULL, return(NULL));
+
+ return sync->data;
+}
+
/* vim: set ts=2 sw=2 noet: */