The following commit has been merged in the master branch:
commit ba908783e306ba38457a84fd6d975ca69e351e56
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 24 04:35:07 2010 +0200

    libdpkg: Always print parse warnings on stderr
    
    Remove now unused warnto from parsedb_stat struct.

diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index e4df4ff..8f02641 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -265,7 +265,7 @@ void do_build(const char *const *argv) {
     strcat(controlfile, "/" BUILDCONTROLDIR "/" CONTROLFILE);
     warns = 0;
     parsedb(controlfile, pdb_recordavailable|pdb_rejectstatus,
-            &checkedinfo, stderr, &warns);
+            &checkedinfo, &warns);
     if (strspn(checkedinfo->name,
                "abcdefghijklmnopqrstuvwxyz0123456789+-.")
         != strlen(checkedinfo->name))
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index fb662f8..8485d07 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -258,7 +258,7 @@ void do_showinfo(const char* const* argv) {
   info_prepare(&argv,&debar,&directory,1);
 
   parsedb(CONTROLFILE, pdb_recordavailable | pdb_rejectstatus | 
pdb_ignorefiles,
-          &pkg, NULL, NULL);
+          &pkg, NULL);
   pkg_format_show(fmt, pkg, &pkg->available);
 }
 
diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c
index 0366ce4..4e81639 100644
--- a/lib/dpkg/dbmodify.c
+++ b/lib/dpkg/dbmodify.c
@@ -75,8 +75,7 @@ static void cleanupdates(void) {
   struct dirent **cdlist;
   int cdn, i;
 
-  parsedb(statusfile, pdb_lax_parser | pdb_weakclassification,
-          NULL, NULL, NULL);
+  parsedb(statusfile, pdb_lax_parser | pdb_weakclassification, NULL, NULL);
 
   *updatefnrest = '\0';
   updateslength= -1;
@@ -88,7 +87,7 @@ static void cleanupdates(void) {
     for (i=0; i<cdn; i++) {
       strcpy(updatefnrest, cdlist[i]->d_name);
       parsedb(updatefnbuf, pdb_lax_parser | pdb_weakclassification,
-              NULL, NULL, NULL);
+              NULL, NULL);
       if (cstatus < msdbrw_write) free(cdlist[i]);
     }
 
@@ -255,7 +254,7 @@ modstatdb_init(const char *admindir, enum modstatdb_rw 
readwritereq)
     if(!(cflags & msdbrw_noavail))
     parsedb(availablefile,
             pdb_recordavailable | pdb_rejectstatus | pdb_lax_parser,
-            NULL,NULL,NULL);
+            NULL, NULL);
   }
 
   if (cstatus >= msdbrw_write) {
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index d54d93b..1fab1a4 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -243,7 +243,7 @@ enum parsedbflags {
 
 const char *pkg_name_is_illegal(const char *p, const char **ep);
 int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep,
-            FILE *warnto, int *warncount);
+            int *warncount);
 void copy_dependency_links(struct pkginfo *pkg,
                            struct dependency **updateme,
                            struct dependency *newdepends,
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index 444f113..08e8bd3 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -81,8 +81,9 @@ const struct fieldinfo fieldinfos[]= {
 };
 
 int parsedb(const char *filename, enum parsedbflags flags,
-            struct pkginfo **donep, FILE *warnto, int *warncount) {
-  /* warnto, warncount and donep may be null.
+            struct pkginfo **donep, int *warncount)
+{
+  /* warncount and donep may be null.
    * If donep is not null only one package's information is expected.
    */
   
@@ -106,10 +107,6 @@ int parsedb(const char *filename, enum parsedbflags flags,
   ps.filename = filename;
   ps.flags = flags;
   ps.lno = 0;
-  if (warnto == NULL)
-    ps.warnto = stderr;
-  else
-    ps.warnto = warnto;
   ps.warncount = 0;
 
   newpifp= (flags & pdb_recordavailable) ? &newpig.available : 
&newpig.installed;
diff --git a/lib/dpkg/parsedump.h b/lib/dpkg/parsedump.h
index 55e03d0..563397f 100644
--- a/lib/dpkg/parsedump.h
+++ b/lib/dpkg/parsedump.h
@@ -28,7 +28,6 @@ struct parsedb_state {
        enum parsedbflags flags;
        const char *filename;
        int lno;
-       FILE *warnto;
        int warncount;
 };
 
diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
index 853a25d..70a4f8c 100644
--- a/lib/dpkg/parsehelp.c
+++ b/lib/dpkg/parsehelp.c
@@ -72,11 +72,9 @@ parse_warn(struct parsedb_state *ps,
 
   va_start(args, fmt);
   ps->warncount++;
-  if (ps->warnto) {
-    strcat(q,"\n");
-    if (vfprintf(ps->warnto, buf2, args) == EOF)
-      ohshite(_("failed to write parsing warning"));
-  }
+  strcat(q, "\n");
+  if (vfprintf(stderr, buf2, args) == EOF)
+    ohshite(_("failed to write parsing warning"));
   va_end(args);
 }
 
diff --git a/src/processarc.c b/src/processarc.c
index e9641d7..2090144 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -241,7 +241,7 @@ void process_archive(const char *filename) {
   strcpy(cidirrest,CONTROLFILE);
 
   parsedb(cidir, pdb_recordavailable | pdb_rejectstatus | pdb_ignorefiles,
-          &pkg,NULL,NULL);
+          &pkg, NULL);
   if (!pkg->files) {
     pkg->files= nfmalloc(sizeof(struct filedetails));
     pkg->files->next = NULL;
diff --git a/src/update.c b/src/update.c
index fa42781..97c1218 100644
--- a/src/update.c
+++ b/src/update.c
@@ -80,12 +80,12 @@ void updateavailable(const char *const *argv) {
 
   if (cipaction->arg == act_avmerge)
     parsedb(vb.buf, pdb_recordavailable | pdb_rejectstatus | pdb_lax_parser,
-            NULL, NULL, NULL);
+            NULL, NULL);
 
   if (cipaction->arg != act_avclear)
     count += parsedb(sourcefile,
                     pdb_recordavailable | pdb_rejectstatus | pdb_ignoreolder,
-                     NULL, NULL, NULL);
+                     NULL, NULL);
 
   if (!f_noact) {
     writedb(vb.buf,1,0);

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to