File: bug-232815-getmysqlopt-ignore-comments.patch

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (34 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Package: wwwconfig-common
Version: 0.0.33
Severity: normal
Tags: patch

I have some commented-out sections in my .my.cnf file, and these are
not properly ignored.  This patch fixes this problem:

--- mysql.func.dpkg-dist	2004-02-14 19:03:11.000000000 -0500
+++ mysql.func	2004-02-14 18:57:38.000000000 -0500
@@ -17,7 +17,7 @@
     tmpwhat="$2"
     tmpsect="$1"
 
-    if grep "\[$tmpsect\]" $tmpcfgfile >/dev/null 2>&1 ; then
+    if grep -v '^#' $tmpcfgfile | grep "\[$tmpsect\]" >/dev/null 2>&1 ; then
 	getmysqlopt=$(grep -A 10 "\[$tmpsect\]" $tmpcfgfile | grep "^[[:space:]]*$tmpwhat[[:space:]]*=[[:space:]]*" | head -1 | sed "s|^[[:space:]]*$tmpwhat[[:space:]]*=[[:space:]]*||g; s|[[:space:]][[:space:]]*$||g;")
 	found=yes
     fi

The script also sets found=yes even if the requested option is not
present.  This is probably a bug, too, but I don't have a patch for
that.


-- System Information:
Debian Release: testing/unstable
Architecture: sparc
Kernel: Linux pulse-plasma-gun 2.4.21 #1 Thu Aug 7 20:30:12 EDT 2003 sparc64
Locale: LANG=C, LC_CTYPE=C

-- no debconf information