ソースを参照

libdpkg: Always print a massage on warning when parsing control files

The warnings were only being issues on dpkg-deb parsing, which greatly
defeats their purpose, as using dpkg-deb is not truly needed to
generate '.deb' packages. So printing always will give them wider
exposure.

The parse_warn() function is not using warning() though, which makes
the output miss the program name, but the changes needed for this are
too intrusive at this time, and it's only a cosmetic issue afterall, so
we'll leave this for later.
Guillem Jover 16 年 前
コミット
30bd7ddbff
共有2 個のファイルを変更した5 個の追加1 個の削除を含む
  1. 1 0
      debian/changelog
  2. 4 1
      lib/dpkg/parse.c

+ 1 - 0
debian/changelog

@@ -3,6 +3,7 @@ dpkg (1.15.8.4) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Fix use after free segfault on update-alternatives --remove-all.
     Closes: #591653, #591654
+  * Always print a massage on warning when parsing control files.
 
   [ Raphaël Hertzog ]
   * Fix make -C man install so that it actually finds the manual pages

+ 4 - 1
lib/dpkg/parse.c

@@ -106,7 +106,10 @@ int parsedb(const char *filename, enum parsedbflags flags,
   ps.filename = filename;
   ps.flags = flags;
   ps.lno = 0;
-  ps.warnto = warnto;
+  if (warnto == NULL)
+    ps.warnto = stderr;
+  else
+    ps.warnto = warnto;
   ps.warncount = 0;
 
   newpifp= (flags & pdb_recordavailable) ? &newpig.available : &newpig.installed;