From f9a7d8cba4ec1833d32dc8a9403053564b68d18a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 11 Jan 2008 08:43:10 -0600 Subject: Fix library interface Two functions defined in alpm.h were not marked with SYMEXPORT, causing linking errors if they were used. In addition, remove the incorrect use of the 'alpm_' prefix from an internal function and replace it with '_alpm_'. Fixes FS#9155. Signed-off-by: Dan McGee --- lib/libalpm/handle.c | 4 ++-- lib/libalpm/package.c | 2 +- lib/libalpm/package.h | 2 +- lib/libalpm/sync.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 7aab5161..aaadd86d 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -488,7 +488,7 @@ void SYMEXPORT alpm_option_add_ignorepkg(const char *pkg) handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg)); } -void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs) +void SYMEXPORT alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs) { if(handle->ignorepkg) FREELIST(handle->ignorepkg); if(ignorepkgs) handle->ignorepkg = ignorepkgs; @@ -534,7 +534,7 @@ void SYMEXPORT alpm_option_add_ignoregrp(const char *grp) handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp)); } -void alpm_option_set_ignoregrps(alpm_list_t *ignoregrps) +void SYMEXPORT alpm_option_set_ignoregrps(alpm_list_t *ignoregrps) { if(handle->ignoregrp) FREELIST(handle->ignoregrp); if(ignoregrps) handle->ignoregrp = ignoregrps; diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index e79c5b43..937ee3e0 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -825,7 +825,7 @@ void _alpm_pkg_free(pmpkg_t *pkg) } /* Is pkgB an upgrade for pkgA ? */ -int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg) +int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg) { int cmp = 0; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index d883eee1..d6c3eff9 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -90,7 +90,7 @@ pmpkg_t* _alpm_pkg_new(const char *name, const char *version); pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg); void _alpm_pkg_free(pmpkg_t *pkg); int _alpm_pkg_cmp(const void *p1, const void *p2); -int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg); +int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg); pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full); pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack); int _alpm_pkg_should_ignore(pmpkg_t *pkg); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 50de07ef..ced20c5a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -238,7 +238,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, } /* compare versions and see if we need to upgrade */ - if(alpm_pkg_compare_versions(local, spkg)) { + if(_alpm_pkg_compare_versions(local, spkg)) { _alpm_log(PM_LOG_DEBUG, "%s elected for upgrade (%s => %s)\n", alpm_pkg_get_name(local), alpm_pkg_get_version(local), alpm_pkg_get_version(spkg)); @@ -330,7 +330,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy local = _alpm_db_get_pkgfromcache(db_local, alpm_pkg_get_name(spkg)); if(local) { - if(alpm_pkg_compare_versions(local, spkg) == 0) { + if(_alpm_pkg_compare_versions(local, spkg) == 0) { /* spkg is NOT an upgrade */ if(trans->flags & PM_TRANS_FLAG_NEEDED) { _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), -- cgit v1.2.3-70-g09d2 From 318d5c4ba87b699c3a902bf906f55a3f905a1650 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 11 Jan 2008 09:25:44 -0600 Subject: Make the user-agent string a bit less verbose We shouldn't pass things like the kernel version in the user agent string, as it may be a bit too revealing and is not really necessary. Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=57555 Signed-off-by: Dan McGee --- src/pacman/pacman.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 4171055a..1aa29682 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -179,14 +179,12 @@ static void localize(void) */ static void setuseragent(void) { - const char *pacman = "Pacman/" PACKAGE_VERSION; - const char *libalpm = "libalpm/" LIB_VERSION; char agent[101]; struct utsname un; uname(&un); - snprintf(agent, 100, "%s (%s %s %s; %s) %s", pacman, un.sysname, - un.machine, un.release, setlocale(LC_MESSAGES, NULL), libalpm); + snprintf(agent, 100, "pacman/" PACKAGE_VERSION " (%s %s) libalpm/" LIB_VERSION, + un.sysname, un.machine); setenv("HTTP_USER_AGENT", agent, 0); } -- cgit v1.2.3-70-g09d2 From 8372a9e8c73ed18da5f027c99c8ac48c2f706b55 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 12 Jan 2008 11:03:50 +1000 Subject: Only notify of dependency check in removal if performed Moves "checking dependencies..." notification into code block where dependency checking is performed to stop spurious notification. Reference: http://archlinux.org/pipermail/pacman-dev/2008-January/010714.html Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- lib/libalpm/remove.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 4f6d6473..2f027951 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -97,9 +97,9 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) return(0); } - EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); - if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { + EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); + _alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies\n"); lp = alpm_checkdeps(db, 1, trans->packages, NULL); if(lp != NULL) { -- cgit v1.2.3-70-g09d2 From 8ffa6fa7adf291b3dad822c459e1372a31af09f1 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Fri, 11 Jan 2008 22:50:25 +0100 Subject: extends valgrind.supp and adds quick instructions. Signed-off-by: Chantry Xavier --- valgrind.supp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/valgrind.supp b/valgrind.supp index 20227349..1a452082 100644 --- a/valgrind.supp +++ b/valgrind.supp @@ -1,5 +1,8 @@ # pacman suppressions for valgrind. -# right now, I really just care about those stupid dl_relocates +# +# To have valgrind use this file (and have pactest use it as well), +# just create a ~/.valgrindrc containing the following line: +# --suppressions=/full/path/to/valgrind.supp # # Format of this file is: # { @@ -29,3 +32,16 @@ obj:*ld-2.?.so } +{ + pacman-msgsnd + Memcheck:Param + msgsnd(msgp->mtext) + fun:* +} + +{ + pacman-utimensat + Memcheck:Param + utimensat(filename) + fun:* +} -- cgit v1.2.3-70-g09d2