FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-07-2011, 09:36 PM
Dan McGee
 
Default Require handle for alpm_sync_sysupgrade()

Signed-off-by: Dan McGee <dan@archlinux.org>
---
lib/libalpm/alpm.h | 3 ++-
lib/libalpm/sync.c | 5 +----
src/pacman/sync.c | 2 +-
3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 50ab06e..2144401 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -858,10 +858,11 @@ int alpm_trans_release(pmhandle_t *handle);
/** @{ */

/** Search for packages to upgrade and add them to the transaction.
+ * @param handle the context handle
* @param enable_downgrade allow downgrading of packages if the remote version is lower
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_sync_sysupgrade(int enable_downgrade);
+int alpm_sync_sysupgrade(pmhandle_t *handle, int enable_downgrade);

/** Add a package to the transaction.
* If the package was loaded by alpm_pkg_load(), it will be freed upon
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 41f9f99..16be6d9 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -50,9 +50,6 @@
#include "diskspace.h"
#include "signing.h"

-/* global handle variable */
-extern pmhandle_t *handle;
-
/** Check for new version of pkg in sync repos
* (only the first occurrence is considered in sync)
*/
@@ -85,7 +82,7 @@ pmpkg_t SYMEXPORT *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync)
}

/** Search for packages to upgrade and add them to the transaction. */
-int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
+int SYMEXPORT alpm_sync_sysupgrade(pmhandle_t *handle, int enable_downgrade)
{
alpm_list_t *i, *j, *k;
pmtrans_t *trans;
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 6f8508e..4cd8d21 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -760,7 +760,7 @@ static int sync_trans(alpm_list_t *targets)
if(config->op_s_upgrade) {
printf(_(":: Starting full system upgrade...
"));
alpm_logaction(config->handle, "starting full system upgrade
");
- if(alpm_sync_sysupgrade(config->op_s_upgrade >= 2) == -1) {
+ if(alpm_sync_sysupgrade(config->handle, config->op_s_upgrade >= 2) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, "%s
", alpm_strerrorlast());
retval = 1;
goto cleanup;
--
1.7.5.2
 

Thread Tools




All times are GMT. The time now is 09:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org