[SCM] dpkg's main repository branch, master, updated. 1.14.23-220-g6d08e24

2009-01-22 Thread Guillem Jover
The following commit has been merged in the master branch:
commit db9645cff36a3fff3c597764fb8d49fbc819bad7
Author: Guillem Jover guil...@debian.org
Date:   Thu Nov 20 06:03:57 2008 +0200

Sanitize --status-fd output by replacing newlines with spaces

Closes: #505172

diff --git a/ChangeLog b/ChangeLog
index 341a01a..43273c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-01-22  Guillem Jover  guil...@debian.org
 
+   * lib/log.c (statusfd_send): Use varbufsubstc to replace new lines
+   with spaces.
+
+2009-01-22  Guillem Jover  guil...@debian.org
+
* lib/dpkg-db.h (varbufsubstc): New function prototype.
* lib/varbuf.c (varbufsubstc): New function definition.
* lib/test/t-varbuf.c (test_varbuf_substc): New function.
diff --git a/debian/changelog b/debian/changelog
index 716876b..3658d94 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -53,6 +53,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low
   * Add new option --procsched to start-stop-daemon to be able to set the
 process scheduling policy and priority. Closes: #175740
   * Add initial C unit test suite for libdpkg.
+  * Sanitize --status-fd output by replacing newlines with spaces.
+Closes: #505172
 
   [ Raphael Hertzog ]
   * Enhance dpkg-shlibdeps's error message when a library can't be found to
diff --git a/lib/log.c b/lib/log.c
index 6852931..bfd5177 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -89,6 +89,9 @@ statusfd_send(const char *fmt, ...)
va_start(al, fmt);
varbufreset(vb);
varbufvprintf(vb, fmt, al);
+   /* Sanitize string to not include new lines, as front-ends should be
+* doing their own word-wrapping. */
+   varbufsubstc(vb, '\n', ' ');
varbufaddc(vb, '\n');
va_end(al);
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.14.23-220-g6d08e24

2009-01-22 Thread Guillem Jover
The following commit has been merged in the master branch:
commit 6d08e24e768558a45f94ab72a14904acf845b473
Author: Guillem Jover guil...@debian.org
Date:   Fri Jan 23 04:12:01 2009 +0200

Cleanup .gitignore files

Move common ignore matches to the top-level .gitignore.
Force directory matching by adding a trailing /.
Remove unused matches (enoent).
Add missing matches (t.tmp and autom4te.cache/).

diff --git a/.gitignore b/.gitignore
index 3134a00..0c0fc20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,16 @@
-build-tree
-config
-ABOUT-NLS
-INSTALL
+# Inherited ignores
+*.a
+*.o
+.deps/
 Makefile
 Makefile.in
+
+# Top dir ignores
+autom4te.cache/
+build-tree/
+config/
+ABOUT-NLS
+INSTALL
 configure
 config.*
 aclocal.m4
diff --git a/dpkg-deb/.gitignore b/dpkg-deb/.gitignore
index fbdfcef..135d53c 100644
--- a/dpkg-deb/.gitignore
+++ b/dpkg-deb/.gitignore
@@ -1,5 +1 @@
-*.o
-.deps
-Makefile
-Makefile.in
 dpkg-deb
diff --git a/dpkg-split/.gitignore b/dpkg-split/.gitignore
index af58309..dedc3fc 100644
--- a/dpkg-split/.gitignore
+++ b/dpkg-split/.gitignore
@@ -1,6 +1,2 @@
-*.o
-.deps
-Makefile
-Makefile.in
 dpkg-split
 mksplit
diff --git a/dselect/.gitignore b/dselect/.gitignore
index d4c3975..cce16ad 100644
--- a/dselect/.gitignore
+++ b/dselect/.gitignore
@@ -1,6 +1,2 @@
-*.o
-.deps
-Makefile
-Makefile.in
 curkeys.h
 dselect
diff --git a/dselect/methods/.gitignore b/dselect/methods/.gitignore
deleted file mode 100644
index 282522d..000
--- a/dselect/methods/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/dselect/po/.gitignore b/dselect/po/.gitignore
index 7a60b8e..4b5aa2c 100644
--- a/dselect/po/.gitignore
+++ b/dselect/po/.gitignore
@@ -1,6 +1,4 @@
 *.gmo
 *.sed
-Makefile
-Makefile.in
 POTFILES
 stamp-po
diff --git a/lib/.gitignore b/lib/.gitignore
index b29a435..ad7739a 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -1,6 +1 @@
-*.a
-*.o
-.deps
-Makefile
-Makefile.in
 trigdeferred.c
diff --git a/libcompat/.gitignore b/libcompat/.gitignore
deleted file mode 100644
index 83fafd5..000
--- a/libcompat/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.a
-*.o
-.deps
-Makefile
-Makefile.in
diff --git a/man/.gitignore b/man/.gitignore
index f267408..905daef 100644
--- a/man/.gitignore
+++ b/man/.gitignore
@@ -7,6 +7,4 @@ pl
 pt_BR
 ru
 sv
-Makefile
-Makefile.in
 man.stamp
diff --git a/origins/.gitignore b/origins/.gitignore
deleted file mode 100644
index 282522d..000
--- a/origins/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/po/.gitignore b/po/.gitignore
index 587f4f8..01e3875 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -2,8 +2,6 @@
 *.sin
 *.sed
 *.header
-Makefile
-Makefile.in
 Makefile.in.in
 Makevars.template
 POTFILES
diff --git a/scripts/.gitignore b/scripts/.gitignore
index ede2efb..4857018 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -1,5 +1,3 @@
-Makefile
-Makefile.in
 dpkg-architecture
 dpkg-buildpackage
 dpkg-checkbuilddeps
@@ -20,3 +18,4 @@ install-info
 install-info-stamp
 cleanup-info
 822-date
+t.tmp
diff --git a/scripts/po/.gitignore b/scripts/po/.gitignore
index 7a60b8e..4b5aa2c 100644
--- a/scripts/po/.gitignore
+++ b/scripts/po/.gitignore
@@ -1,6 +1,4 @@
 *.gmo
 *.sed
-Makefile
-Makefile.in
 POTFILES
 stamp-po
diff --git a/src/.gitignore b/src/.gitignore
index aff0d4f..9b61029 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,7 +1,3 @@
-*.o
-.deps
-Makefile
-Makefile.in
 dpkg
 dpkg-query
 dpkg-trigger
diff --git a/utils/.gitignore b/utils/.gitignore
index e63b785..bf5714e 100644
--- a/utils/.gitignore
+++ b/utils/.gitignore
@@ -1,6 +1 @@
-*.o
-.deps
-Makefile
-Makefile.in
-enoent
 start-stop-daemon

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.14.23-220-g6d08e24

2009-01-22 Thread Guillem Jover
The following commit has been merged in the master branch:
commit d186c839db61e96d7ad66e6ce04ea02aada8f206
Author: Guillem Jover guil...@debian.org
Date:   Tue Jan 20 01:03:55 2009 +0200

libdpkg: Use size_t in functions taking a size argument

diff --git a/ChangeLog b/ChangeLog
index ad1ddf5..82859e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-20  Guillem Jover  guil...@debian.org
+
+   * lib/dpkg-db.h (varbufdupc): Use size_t instead of ssize_t.
+   (varbufaddbuf): Use size_t instead of const int.
+   (nfstrnsave): Use size_t instead of int.
+
 2009-01-14  Guillem Jover  guil...@debian.org
 
* man/start-stop-daemon.8: Document new option --procsched.
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h
index 9111bee..c9c7489 100644
--- a/lib/dpkg-db.h
+++ b/lib/dpkg-db.h
@@ -379,7 +379,7 @@ struct varbuf;
 #define VARBUF_INIT { 0, 0, NULL }
 
 extern void varbufaddc(struct varbuf *v, int c);
-extern void varbufdupc(struct varbuf *v, int c, ssize_t s);
+extern void varbufdupc(struct varbuf *v, int c, size_t s);
 int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
 int varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
 void varbufinit(struct varbuf *v, size_t size);
@@ -387,7 +387,7 @@ void varbufreset(struct varbuf *v);
 void varbufextend(struct varbuf *v);
 void varbuffree(struct varbuf *v);
 #define varbufaddstr(v, s)  varbufaddbuf(v, s, strlen(s))
-extern void varbufaddbuf(struct varbuf *v, const void *s, const int l);
+extern void varbufaddbuf(struct varbuf *v, const void *s, size_t l);
 
 /* varbufinit must be called exactly once before the use of each varbuf
  * (including before any call to varbuffree), or the variable must be
@@ -446,7 +446,7 @@ int epochsdiffer(const struct versionrevision *a,
 /*** from nfmalloc.c ***/
 extern void *nfmalloc(size_t);
 char *nfstrsave(const char*);
-char *nfstrnsave(const char*, int);
+char *nfstrnsave(const char*, size_t);
 void nffreeall(void);
 
 /*** from showpkg.c ***/
diff --git a/lib/nfmalloc.c b/lib/nfmalloc.c
index a6950a8..5449edd 100644
--- a/lib/nfmalloc.c
+++ b/lib/nfmalloc.c
@@ -60,7 +60,9 @@ char *nfstrsave(const char *string) {
   return obstack_copy0 (db_obs, string, strlen(string));
 }
 
-char *nfstrnsave(const char *string, int l) {
+char *
+nfstrnsave(const char *string, size_t l)
+{
   OBSTACK_INIT;
   return obstack_copy0 (db_obs, string, l);
 }
diff --git a/lib/varbuf.c b/lib/varbuf.c
index 71068a8..eecdd45 100644
--- a/lib/varbuf.c
+++ b/lib/varbuf.c
@@ -35,7 +35,9 @@ varbufaddc(struct varbuf *v, int c)
   v-buf[v-used++]= c;
 }
 
-void varbufdupc(struct varbuf *v, int c, ssize_t n) {
+void
+varbufdupc(struct varbuf *v, int c, size_t n)
+{
   size_t old_used = v-used;
 
   v-used += n;
@@ -74,7 +76,9 @@ int varbufvprintf(struct varbuf *v, const char *fmt, va_list 
va) {
   return r;
 }
 
-void varbufaddbuf(struct varbuf *v, const void *s, const int l) {
+void
+varbufaddbuf(struct varbuf *v, const void *s, size_t l)
+{
   int ou;
   ou= v-used;
   v-used += l;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



[SCM] dpkg's main repository branch, master, updated. 1.14.23-220-g6d08e24

2009-01-22 Thread Guillem Jover
The following commit has been merged in the master branch:
commit b85e48d40910afd1f38d46e43ef40176fcbab28f
Author: Guillem Jover guil...@debian.org
Date:   Thu Jan 22 20:38:09 2009 +0200

libdpkg: Add a new varbufsubstc function

diff --git a/ChangeLog b/ChangeLog
index 3d2d0ae..341a01a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-01-22  Guillem Jover  guil...@debian.org
 
+   * lib/dpkg-db.h (varbufsubstc): New function prototype.
+   * lib/varbuf.c (varbufsubstc): New function definition.
+   * lib/test/t-varbuf.c (test_varbuf_substc): New function.
+   (test): Call test_varbuf_substc.
+
+2009-01-22  Guillem Jover  guil...@debian.org
+
* configure.ac (AC_CONFIG_FILES): Add 'lib/test/Makefile'.
* lib/Makefile.am (SUBDIRS): New variable.
* lib/dpkg-test.h: New file.
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h
index 7ed8d7b..2d85995 100644
--- a/lib/dpkg-db.h
+++ b/lib/dpkg-db.h
@@ -380,6 +380,7 @@ struct varbuf;
 
 extern void varbufaddc(struct varbuf *v, int c);
 extern void varbufdupc(struct varbuf *v, int c, size_t s);
+extern void varbufsubstc(struct varbuf *v, int c_src, int c_dst);
 int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
 int varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
 void varbufinit(struct varbuf *v, size_t size);
diff --git a/lib/test/t-varbuf.c b/lib/test/t-varbuf.c
index 2de4e95..4157b84 100644
--- a/lib/test/t-varbuf.c
+++ b/lib/test/t-varbuf.c
@@ -125,6 +125,23 @@ test_varbuf_dupc(void)
 }
 
 static void
+test_varbuf_substc(void)
+{
+   struct varbuf vb;
+
+   varbufinit(vb, 5);
+
+   varbufaddbuf(vb, 1234a5678a9012a, 15);
+
+   varbufsubstc(vb, 'a', 'z');
+   test_pass(vb.used == 15);
+   test_pass(vb.size = vb.used);
+   test_mem(vb.buf, ==, 1234z5678z9012z, 15);
+
+   varbuffree(vb);
+}
+
+static void
 test_varbuf_reset(void)
 {
struct varbuf vb;
@@ -153,6 +170,7 @@ test(void)
test_varbuf_addbuf();
test_varbuf_addc();
test_varbuf_dupc();
+   test_varbuf_substc();
test_varbuf_reset();
 
/* FIXME: Complete. */
diff --git a/lib/varbuf.c b/lib/varbuf.c
index 5ab780e..2b62fb8 100644
--- a/lib/varbuf.c
+++ b/lib/varbuf.c
@@ -46,6 +46,16 @@ varbufdupc(struct varbuf *v, int c, size_t n)
   memset(v-buf + old_used, c, n);
 }
 
+void
+varbufsubstc(struct varbuf *v, int c_src, int c_dst)
+{
+  size_t i;
+
+  for (i = 0; i  v-used; i++)
+if (v-buf[i] == c_src)
+  v-buf[i] = c_dst;
+}
+
 int varbufprintf(struct varbuf *v, const char *fmt, ...) {
   int r;
   va_list al;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org