poldek: poldek/log.c, poldek/tests/sh/02-up-repo, poldek/vfile/ext...
mis
mis at pld-linux.org
Mon Jul 2 19:08:43 CEST 2007
Author: mis Date: Mon Jul 2 17:08:43 2007 GMT
Module: poldek Tag: HEAD
---- Log message:
- test for #5699 (oldbugs.pld-linux.org)
- fixed "endlinedness" in vfile's process_output()s
---- Files affected:
poldek/poldek:
log.c (1.31 -> 1.32)
poldek/poldek/tests/sh:
02-up-repo (1.3 -> 1.4)
poldek/poldek/vfile:
extcompr.c (1.8 -> 1.9) , fetch.c (1.42 -> 1.43)
---- Diffs:
================================================================
Index: poldek/poldek/log.c
diff -u poldek/poldek/log.c:1.31 poldek/poldek/log.c:1.32
--- poldek/poldek/log.c:1.31 Sun Jul 1 23:04:26 2007
+++ poldek/poldek/log.c Mon Jul 2 19:08:38 2007
@@ -161,9 +161,7 @@
fmt_len = strlen(fmt);
is_endlined = (fmt[fmt_len - 1] == '\n');
- if ((pri & LOGOPT_N) && is_endlined == 0 &&
- (int)sizeof(tmp_fmt) > fmt_len + 2) {
-
+ if ((pri & LOGOPT_N) && !is_endlined && (int)sizeof(tmp_fmt) > fmt_len + 2) {
memcpy(tmp_fmt, fmt, fmt_len);
tmp_fmt[fmt_len++] = '\n';
tmp_fmt[fmt_len] = '\0';
@@ -173,8 +171,11 @@
}
/* auto line break for errors and warnings */
- if (!last_endlined && !is_continuation && (pri & (LOGERR|LOGWARN)))
- buf[buf_len++] = '\n';
+ if (!last_endlined && !is_continuation && (pri & (LOGERR|LOGWARN))) {
+ buf[buf_len++] = '\n';
+ n_assert(0);
+ }
+
last_endlined = is_endlined;
================================================================
Index: poldek/poldek/tests/sh/02-up-repo
diff -u poldek/poldek/tests/sh/02-up-repo:1.3 poldek/poldek/tests/sh/02-up-repo:1.4
--- poldek/poldek/tests/sh/02-up-repo:1.3 Mon Jun 25 00:48:52 2007
+++ poldek/poldek/tests/sh/02-up-repo Mon Jul 2 19:08:38 2007
@@ -86,6 +86,21 @@
POLDEK_TESTING_DENIED_FILES=".gz" # should be up to date
$POLDEK_UP -Oautoupa=n -Osource="test,type=pndir $REPOURL" --up || fail "up failed"
$POLDEK_UP -Oautoupa=n -Osource="test,type=pndir $REPOURL" --upa || fail "up failed"
+
+
+ # autoupa on missing diff
+ msg "\n## Changing repo #5 (missing diff file and autoupa)"
+ sleep 1
+ add_package_to_repo
+ mkidx
+ msg "\n## up"
+
+ POLDEK_TESTING_DENIED_FILES=""
+ lastdiff=$(ls -tr $REPO/packages.i/packages.ndir.*.*.*-*.*.*.gz | tail -1)
+ [ -z "$lastdiff" ] && fail "no last diff?"
+ msg "lastdiff $lastdiff"
+ rm -f "$lastdiff"
+ $POLDEK_UP -Oautoupa=y -Osource="test,type=pndir $REPOURL" --up || fail "up"
}
-. ./sh/lib/shunit2
\ No newline at end of file
+. ./sh/lib/shunit2
================================================================
Index: poldek/poldek/vfile/extcompr.c
diff -u poldek/poldek/vfile/extcompr.c:1.8 poldek/poldek/vfile/extcompr.c:1.9
--- poldek/poldek/vfile/extcompr.c:1.8 Wed Nov 2 21:10:36 2005
+++ poldek/poldek/vfile/extcompr.c Mon Jul 2 19:08:38 2007
@@ -94,7 +94,11 @@
endl = 0;
}
- vf_loginfo("_%c", c);
+ if (c == '\n')
+ vf_loginfo("_\n");
+ else
+ vf_loginfo("_%c", c);
+
if (c == '\n' && cnt > 0)
endl = 1;
================================================================
Index: poldek/poldek/vfile/fetch.c
diff -u poldek/poldek/vfile/fetch.c:1.42 poldek/poldek/vfile/fetch.c:1.43
--- poldek/poldek/vfile/fetch.c:1.42 Mon Jun 25 01:35:47 2007
+++ poldek/poldek/vfile/fetch.c Mon Jul 2 19:08:38 2007
@@ -326,8 +326,12 @@
vf_loginfo("%s: ", prefix);
endl = 0;
}
-
- vf_loginfo("_%c", c);
+
+ if (c == '\n')
+ vf_loginfo("_\n"); /* is_endlined in log.c */
+ else
+ vf_loginfo("_%c", c);
+
if (c == '\n' && cnt > 0)
endl = 1;
@@ -336,8 +340,6 @@
}
}
}
-
-
static
int ffetch_file(struct ffetcher *fftch, const char *destdir,
================================================================
---- CVS-web:
http://cvs.pld-linux.org/poldek/poldek/log.c?r1=1.31&r2=1.32&f=u
http://cvs.pld-linux.org/poldek/poldek/tests/sh/02-up-repo?r1=1.3&r2=1.4&f=u
http://cvs.pld-linux.org/poldek/poldek/vfile/extcompr.c?r1=1.8&r2=1.9&f=u
http://cvs.pld-linux.org/poldek/poldek/vfile/fetch.c?r1=1.42&r2=1.43&f=u
More information about the pld-cvs-commit
mailing list