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 04-01-2011, 06:38 PM
kachelaqa
 
Default 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?
 
Old 04-01-2011, 06:44 PM
Dan McGee
 
Default Problem with alpm_pkg_changelog_open

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
 
Old 04-01-2011, 06:56 PM
kachelaqa
 
Default Problem with alpm_pkg_changelog_open

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)?
 
Old 04-01-2011, 07:00 PM
Dan McGee
 
Default Problem with alpm_pkg_changelog_open

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
 
Old 04-01-2011, 07:10 PM
kachelaqa
 
Default Problem with alpm_pkg_changelog_open

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!
 
Old 04-01-2011, 07:15 PM
Dan McGee
 
Default Problem with alpm_pkg_changelog_open

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
 

Thread Tools




All times are GMT. The time now is 04:25 AM.

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