Просмотр исходного кода

When building packages with dpkg-deb give a more useful error
message in case a conffile entry has leading whitespace. Patch
by David Lopez Moreno. Closes: #281562

Frank Lichtenheld лет назад: 20
Родитель
Сommit
4b306c2e34
3 измененных файлов с 17 добавлено и 5 удалено
  1. 6 0
      ChangeLog
  2. 4 1
      debian/changelog
  3. 7 4
      dpkg-deb/build.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2006-05-19  David Lopez Moreno  <david.lopez.moreno@hispalinux.es>
+
+	* dpkg-deb/build.c (do_build): If failing to stat a
+	conffile check for trailing whitespace in the conffiles
+	file to give a more useful error message.
+
 2006-05-19  Piotr Engelking  <inkerman42@gmail.com>
 
 	* lib/database.c (informative): Don't regard

+ 4 - 1
debian/changelog

@@ -39,7 +39,10 @@ dpkg (1.13.20~) UNRELEASED; urgency=low
   * Make --forget-old-unavail more reliable by deleting architecture
     information of removed packages. Patch by Piotr Engelking.
     Closes: #208532
-
+  * When building packages with dpkg-deb give a more useful error
+    message in case a conffile entry has leading whitespace. Patch
+    by David Lopez Moreno. Closes: #281562
+  
   [ Nicolas François ]
   * fix typos in the Russian man pages. Thanks to Stepan Golosunov.
     Closes: #366587

+ 7 - 4
dpkg-deb/build.c

@@ -286,10 +286,13 @@ void do_build(const char *const *argv) {
         strcat(controlfile, "/");
         strcat(controlfile, conffilename);
         if (lstat(controlfile,&controlstab)) {
-          if (errno == ENOENT)
-            ohshit(_("conffile `%.250s' does not appear in package"),conffilename);
-          else
-            ohshite(_("conffile `%.250s' is not stattable"),conffilename);
+	  if (errno == ENOENT) {
+	    if((n > 1) && isspace(conffilename[n-2]))
+	      fprintf(stderr, _("warning, "
+				"conffile filename `%s' contains trailing white spaces\n"), conffilename);
+	    ohshit(_("conffile `%.250s' does not appear in package"), conffilename);
+	  } else
+	    ohshite(_("conffile `%.250s' is not stattable"), conffilename);
         } else if (!S_ISREG(controlstab.st_mode)) {
           fprintf(stderr, _("warning, conffile `%s'"
                   " is not a plain file\n"), conffilename);