[pacman-dev] Weird bug in sync/upgrade behavior

Xavier shiningxc at gmail.com
Mon May 12 10:10:50 EDT 2008


On Mon, May 12, 2008 at 4:00 PM, Dan McGee <dpmcgee at gmail.com> wrote:
>
>  I thought the same thing- I saw a rewinddir call in db_scan, so I
>  removed what I thought was an extra one here. Either way, I don't plan
>  on applying the above patch, as we should just do the rewinddir() call
>  inside db_scan() or do something more sane than the above hackjob. I
>  just wanted to point out this was the issue.
>

Ok, I just understood how that worked now... I first thought we could
do rewinddir in db_scan but it's not easy. When we do a full scan, we
want do init the scan first with db_rewind, then scan each entry one
by one using one db_scan call each time.

I preferred the old way rather than the above hack, even if they do
exactly the same thing. It was a bit less obscure and more consistent:
_alpm_db_rewind(db);
while((info = _alpm_db_scan(db, NULL)) != NULL) {

Unless you find a better way of course :)

>  Allan- I don't know what filesystem you are using, but I wonder if it
>  has slightly different *dir() semantics so the bug did not manifest
>  itself there...
>

I was able to reproduce it without problems, with latest git and ext3
filesystem.




More information about the pacman-dev mailing list