aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-19 17:15:01 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2009-03-19 17:15:01 +0000
commitce1f26c5f10d4a1a2c4c0de789371fedf2d4c88d (patch)
tree49ca73607b531606dd92df98ea1f2e294401cfef
parent30d4d8eedf640ce1c8b9a4ba5bd583075a1beceb (diff)
downloadgsc-ce1f26c5f10d4a1a2c4c0de789371fedf2d4c88d.tar.gz
gsc-ce1f26c5f10d4a1a2c4c0de789371fedf2d4c88d.tar.bz2
Bugfix in sv_sync_www
* cvs/sv_sync_www.c (do_sync): Do not sort the array. This causes malfunction on newly committed hierarchies. git-svn-id: file:///svnroot/gsc/trunk@337 d2de0444-eb31-0410-8365-af798a554d48
-rw-r--r--ChangeLog7
-rw-r--r--cvs/sv_sync_www.c46
2 files changed, 9 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index 6be08b2..2446d88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+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>
Bugfix
* git-svn-mirror-synch: Call git reset.
* git/git-svn-mirror-finish: Install SVN hook and add a README.git
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
@@ -575,63 +575,21 @@ schedule_job (uid_t uid, gid_t gid, const char *file,
return 0;
}
/* 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;
-
- /* Sort the array */
- qsort (array, count, sizeof array[0], ent_cmp);
+ struct sync_entry *sp;
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;
- }
+
if (debug)
fprintf (stderr, "do_sync: returning %d\n",rc);
return rc;
}
int

Return to:

Send suggestions and report system problems to the System administrator.