diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | cvs/sv_sync_www.c | 48 |
2 files changed, 10 insertions, 45 deletions
@@ -1,2 +1,9 @@ +2009-03-19 Sergey Poznyakoff <gray@gnu.org.ua> + + Bugfix in sv_sync_www + + * cvs/sv_sync_www.c (do_sync): Do not sort the array. This causes + malfunction on newly committed hierarchies. + 2009-02-13 Sergey Poznyakoff <gray@gnu.org.ua> diff --git a/cvs/sv_sync_www.c b/cvs/sv_sync_www.c index 7af1271..a251269 100644 --- a/cvs/sv_sync_www.c +++ b/cvs/sv_sync_www.c @@ -579,55 +579,13 @@ schedule_job (uid_t uid, gid_t gid, const char *file, /* Multi-job support */ -static int -dir_cmp (const char *a, const char *b) -{ - if (!a) - { - if (b) - return -1; - else - return 0; - } - else if (!b) - return 1; - return strcmp (a, b); -} - -static int -ent_cmp (const void *a, const void *b) -{ - const struct sync_entry *sa = a; - const struct sync_entry *sb = b; - int rc; - - rc = strcmp (sa->repo, sb->repo); - if (rc) - return rc; - rc = dir_cmp (sa->dir, sb->dir); - if (rc) - return rc; - return sa->files - sb->files; -} - int do_sync (struct sync_entry *array, size_t count) { int rc = 0; - struct sync_entry *sp, *lastp = NULL; + struct sync_entry *sp; - /* Sort the array */ - qsort (array, count, sizeof array[0], ent_cmp); - for (sp = array; sp < array + count; sp++) - { - if (lastp) - { - if (strcmp (lastp->repo, sp->repo) == 0 - && dir_cmp (lastp->dir, sp->dir) == 0) - continue; - } - rc |= sync_www (sp->repo, sp->dir, sp->files); - lastp = sp; - } + rc |= sync_www (sp->repo, sp->dir, sp->files); + if (debug) fprintf (stderr, "do_sync: returning %d\n",rc); |