The following commit has been merged in the master branch:
commit 355dbdf36096cd3d1854bc3fd1f814e27796c493
Author: Guillem Jover <[email protected]>
Date:   Sat Sep 5 03:12:28 2009 +0200

    libdpkg: Allow quoting values in configuration file options

diff --git a/debian/changelog b/debian/changelog
index 5dbaafe..01f0215 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,7 @@ dpkg (1.15.4) UNRELEASED; urgency=low
   * Use po4a “--previous” support when updating the man pages.
     Suggested by Christian Perrier <[email protected]>.
   * On configuration error print file name and line number.
+  * Allow quoting values in configuration file options.
 
   [ Raphael Hertzog ]
   * Replace install-info by a wrapper around GNU's install-info. The wrapper
diff --git a/lib/dpkg/myopt.c b/lib/dpkg/myopt.c
index 7d5abcc..63cd931 100644
--- a/lib/dpkg/myopt.c
+++ b/lib/dpkg/myopt.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 
 #include <dpkg/dpkg.h>
+#include <dpkg/string.h>
 #include <dpkg/myopt.h>
 
 void
@@ -94,6 +95,10 @@ void myfileopt(const char* fn, const struct cmdinfo* 
cmdinfos) {
       *opt++ = '\0';
       if (*opt=='=') opt++;
       while (isspace(*opt)) opt++;
+
+      opt = str_strip_quotes(opt);
+      if (opt == NULL)
+        config_error(fn, line_num, _("unbalanced quotes in '%s'"), linebuf);
     }
 
     for (cip=cmdinfos; cip->olong || cip->oshort; cip++) {
diff --git a/man/dpkg.cfg.5 b/man/dpkg.cfg.5
index 9cbd0d7..a6ba0d2 100644
--- a/man/dpkg.cfg.5
+++ b/man/dpkg.cfg.5
@@ -1,4 +1,4 @@
-.TH dpkg.cfg 5 "2009-08-20" "Debian Project" "dpkg suite"
+.TH dpkg.cfg 5 "2009-09-05" "Debian Project" "dpkg suite"
 .SH NAME
 dpkg.cfg \- dpkg configuration file
 .
@@ -6,8 +6,8 @@ dpkg.cfg \- dpkg configuration file
 This file contains default options for dpkg. Each line contains a
 single option which is exactly the same as a normal command line
 option for dpkg except for the leading dashes which are not used
-here. Comments are allowed by starting a line with a hash sign
-("\fB#\fR").
+here. Quotes surrounding option values are stripped. Comments are
+allowed by starting a line with a hash sign ("\fB#\fR").
 .
 .SH FILES
 .I /etc/dpkg/dpkg.cfg.d/[0-9a-zA-Z_-]*
diff --git a/man/dselect.cfg.5 b/man/dselect.cfg.5
index bbfe222..c6cfbed 100644
--- a/man/dselect.cfg.5
+++ b/man/dselect.cfg.5
@@ -1,4 +1,4 @@
-.TH dselect.cfg 5 "2009-08-20" "Debian Project" "dpkg suite"
+.TH dselect.cfg 5 "2009-09-05" "Debian Project" "dpkg suite"
 .SH NAME
 dselect.cfg \- dselect configuration file
 .
@@ -6,8 +6,8 @@ dselect.cfg \- dselect configuration file
 This file contains default options for dselect. Each line contains a
 single option which is exactly the same as a normal commandline
 option for dselect except for the leading dashes which are not used
-here. Comments are allowed by starting a line with a hash sign
-("\fB#\fR").
+here. Quotes surrounding option values are stripped. Comments are
+allowed by starting a line with a hash sign ("\fB#\fR").
 .
 .SH FILES
 .I /etc/dpkg/dselect.cfg.d/[0-9a-zA-Z_-]*

-- 
dpkg's main repository


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

Reply via email to