[pacman-dev] Weird bug in sync/upgrade behavior
Dan McGee
dpmcgee at gmail.com
Mon May 12 08:58:56 EDT 2008
On Mon, May 12, 2008 at 7:54 AM, Dan McGee <dpmcgee at gmail.com> wrote:
> On Mon, May 12, 2008 at 7:38 AM, Allan McRae <mcrae_allan at hotmail.com> wrote:
> > Allan McRae wrote:
> >
> > > Dan McGee wrote:
> > >
> > >> Can anyone else try to reproduce this? Try deleting all .lastupdate
> > >> files except the one for core, if you have testing enabled, and seeing
> > >> what happens on the first and second runs of -Syu.
> > >>
> > >>
> > >
> >
> > > I can not replicate this at all...
> > >
> > >
> >
> > I have even tried adding the extra repos you have enabled with no
> > success in replicating.
>
> I was able to bisect it at least- and it was me. I haven't looked into
> why this broke it yet, but if anyone else wants to poke at it, feel
> free.
>
> 046003844739416ff6d168dd2dec76490adb0727 is first bad commit
> commit 046003844739416ff6d168dd2dec76490adb0727
> Author: Dan McGee <dan at archlinux.org>
> Date: Sun May 11 19:29:23 2008 -0500
>
> Remove some useless abstraction and start db cleanup
>
> We have some useless abstractions like an alpm_db_rewind function. I've read
> somewhere that readdir() was the worst filesystem function call invented,
> and what do we do? Add a wrapper around it. Kill this abstraction and move
> some other things into be_files that should be there anyway because they
> are so tied to how a files backend works.
>
> Signed-off-by: Dan McGee <dan at archlinux.org>
>
> :040000 040000 534812c4e1341825ff0ef0446bba8a7e865f6d43
> 24fd6a8b87d064809de09a295e7b8fd4ede198b9 M lib
> bisect run success
>
>
> $ git bisect log
> # bad: [663408532ae852e7123da6b9658df1cacc0c642d] Merge branch 'maint'
> # good: [e3d35b3274f13cc9ed8d79fa873d6348e424259e] Add detailed
> description to alpm_pkg_load
> git-bisect start 'master' 'maint'
> # good: [35135c0a0cbac592e72296c0ca64e9def0308942] Add -Rss option
> git-bisect good 35135c0a0cbac592e72296c0ca64e9def0308942
> # good: [db4258c1fdf27708968baf9c4e730a014af40fd8] Some comments for
> _alpm_unpack.
> git-bisect good db4258c1fdf27708968baf9c4e730a014af40fd8
> # good: [4e6361642e632b8631e3d12ee33b1cf5293edb83] Rework
> extract_single_file() temp file creation
> git-bisect good 4e6361642e632b8631e3d12ee33b1cf5293edb83
> # good: [502645c0e304a8ee062d8da7f162ff4c195e6be8] makepkg: Unify
> start and end messages
> git-bisect good 502645c0e304a8ee062d8da7f162ff4c195e6be8
> # good: [0bfc8adf377e7c0d4870fd79999b359a00bc96e2] contrib/paclist:
> list packages installed from given repo.
> git-bisect good 0bfc8adf377e7c0d4870fd79999b359a00bc96e2
> # good: [3c3cb001a441656c2afba62f0361b83d4987339c] Make all error
> messages use pm_fprintf
> git-bisect good 3c3cb001a441656c2afba62f0361b83d4987339c
> # bad: [13f24a5bdabf9c2c7bfa07aff7176495bb775a0d] Refactor
> pkg_load/parse_descfile into a new backend file
> git-bisect bad 13f24a5bdabf9c2c7bfa07aff7176495bb775a0d
> # bad: [046003844739416ff6d168dd2dec76490adb0727] Remove some useless
> abstraction and start db cleanup
> git-bisect bad 046003844739416ff6d168dd2dec76490adb0727
>
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index fcd555e..bfbf995 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <dirent.h>
/* libalpm */
#include "cache.h"
@@ -54,6 +55,7 @@ int _alpm_db_load_pkgcache(pmdb_t *db)
_alpm_log(PM_LOG_DEBUG, "loading package cache for repository '%s'\n",
db->treename);
+ rewinddir(db->handle);
while((info = _alpm_db_scan(db, NULL)) != NULL) {
_alpm_log(PM_LOG_FUNCTION, "adding '%s' to package
cache for db '%s'\n",
alpm_pkg_get_name(info), db->treename);
More information about the pacman-dev
mailing list