[pacman-dev] Problem with alpm_pkg_changelog_open
hello i have used swig to create some python bindings for libalpm. with pacman-3.4 it was possible to use alpm_pkg_changelog_open with packages from both the local and sync databases. with pacman-3.5, however, packages from sync databases now produce a segfault (local packages still work fine). here is a sample of some code which is currently segfaulting for me: int test_changelog(pmpkg_t *pkg) { void *fp = NULL; if (pkg != NULL) { if ((fp = alpm_pkg_changelog_open(pkg)) != NULL) { alpm_pkg_changelog_close(pkg, fp); return 1; } } return 0; } am i doing something wrong, or should i post a bug report?
On Fri, Apr 1, 2011 at 1:38 PM, kachelaqa <kachelaqa@gmail.com> wrote:
hello
i have used swig to create some python bindings for libalpm.
with pacman-3.4 it was possible to use alpm_pkg_changelog_open with packages from both the local and sync databases.
with pacman-3.5, however, packages from sync databases now produce a segfault (local packages still work fine).
here is a sample of some code which is currently segfaulting for me:
int test_changelog(pmpkg_t *pkg) { void *fp = NULL;
if (pkg != NULL) { if ((fp = alpm_pkg_changelog_open(pkg)) != NULL) { alpm_pkg_changelog_close(pkg, fp); return 1; } } return 0; }
am i doing something wrong, or should i post a bug report?
It is definitely a bug in the sense that it segfaults- we provide no changelog_* functions in the sync (or default) pkg_operations callback. Where have you actually seen changelogs in sync databases? -Dan
On 01/04/11 19:44, Dan McGee wrote:
It is definitely a bug in the sense that it segfaults- we provide no changelog_* functions in the sync (or default) pkg_operations callback.
pardon my ignorance, but what is _package_changelog_open in be_package.c for?
Where have you actually seen changelogs in sync databases?
well, it's difficult for me to check for specific changelogs at the moment. are you saying that they are not stored in sync databases at all? even if there is one in the local database (e.g. scite)?
On Fri, Apr 1, 2011 at 1:56 PM, kachelaqa <kachelaqa@gmail.com> wrote:
On 01/04/11 19:44, Dan McGee wrote:
It is definitely a bug in the sense that it segfaults- we provide no changelog_* functions in the sync (or default) pkg_operations callback.
pardon my ignorance, but what is _package_changelog_open in be_package.c for?
pacman -Qpc <package file> Not sync *database packages*, but *package files*. be_local: /var/lib/pacman/local be_sync: /var/lib/pacman/sync/*.db be_package: package files
Where have you actually seen changelogs in sync databases?
well, it's difficult for me to check for specific changelogs at the moment. are you saying that they are not stored in sync databases at all? even if there is one in the local database (e.g. scite)?
Nope. $ bsdtar tf /var/lib/pacman/sync/community.db | grep scite scite-2.24-1/ scite-2.24-1/desc scite-2.24-1/depends -Dan
On 01/04/11 20:00, Dan McGee wrote:
On Fri, Apr 1, 2011 at 1:56 PM, kachelaqa<kachelaqa@gmail.com> wrote:
On 01/04/11 19:44, Dan McGee wrote:
It is definitely a bug in the sense that it segfaults- we provide no changelog_* functions in the sync (or default) pkg_operations callback.
pardon my ignorance, but what is _package_changelog_open in be_package.c for?
pacman -Qpc<package file>
Not sync *database packages*, but *package files*.
be_local: /var/lib/pacman/local be_sync: /var/lib/pacman/sync/*.db be_package: package files
ah, yes of course - thanks
Where have you actually seen changelogs in sync databases?
well, it's difficult for me to check for specific changelogs at the moment. are you saying that they are not stored in sync databases at all? even if there is one in the local database (e.g. scite)?
Nope.
$ bsdtar tf /var/lib/pacman/sync/community.db | grep scite scite-2.24-1/ scite-2.24-1/desc scite-2.24-1/depends
okay, so changelogs are only ever stored in the local database. so all i have to do is check whether a package is installed before attempting to retrieve a changelog. thanks for your help!
On Fri, Apr 1, 2011 at 2:10 PM, kachelaqa <kachelaqa@gmail.com> wrote:
On 01/04/11 20:00, Dan McGee wrote:
On Fri, Apr 1, 2011 at 1:56 PM, kachelaqa<kachelaqa@gmail.com> wrote:
On 01/04/11 19:44, Dan McGee wrote:
It is definitely a bug in the sense that it segfaults- we provide no changelog_* functions in the sync (or default) pkg_operations callback.
pardon my ignorance, but what is _package_changelog_open in be_package.c for?
pacman -Qpc<package file>
Not sync *database packages*, but *package files*.
be_local: /var/lib/pacman/local be_sync: /var/lib/pacman/sync/*.db be_package: package files
ah, yes of course - thanks
Where have you actually seen changelogs in sync databases?
well, it's difficult for me to check for specific changelogs at the moment. are you saying that they are not stored in sync databases at all? even if there is one in the local database (e.g. scite)?
Nope.
$ bsdtar tf /var/lib/pacman/sync/community.db | grep scite scite-2.24-1/ scite-2.24-1/desc scite-2.24-1/depends
okay, so changelogs are only ever stored in the local database. so all i have to do is check whether a package is installed before attempting to retrieve a changelog.
Well you will be looking at very different pmpkg_t objects as well- one loaded from a sync database vs. one loaded from a local database. Either way, I'll fix it so it doesn't segfault and just returns NULL when calling changelog_open on a sync database package. -Dan
participants (2)
-
Dan McGee
-
kachelaqa